LaTeX forum ⇒ Text FormattingCommand to start paragraph with more spacing and no indent? Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
User avatar
Bozack
Posts: 115
Joined: Wed Feb 06, 2008 4:21 pm

Command to start paragraph with more spacing and no indent?

Postby Bozack » Fri Aug 14, 2015 4:43 pm

I usually use the standard LaTeX behavior for new paragraphs - a new line, allowing an indentation of the first line in the new paragraph. I also use sections to split up major parts of the document.

Sometimes, however, I like to break up my text in sections without headers - creating a new paragraph with an empty line before it, and no indentation, like this:

  1. bla blah top paragraph.
  2. \\ \\
  3. \noindent Blah blah new paragraph

I feel that this splits up the text in a nice way, when a section (or subsection) gets long. It could, for example, look like this:

examplepicture1.png
Example of a new paragraph with a line skip and no indent.
examplepicture1.png (55.12 KiB) Viewed 13854 times

My question is now the following: Would it be possible to get this behavior as a command, instead of manually putting the newlines and removing the indentation? This could be just like making a \section-like command, but without actually having a header - only simply making some spacing and starting without an indent after the command has been issued.

I get an error if there are empty lines in the LaTeX code before the newlines: Sometimes I put in code for floats etc. between the paragraphs, and would like to be able to have empty lines in the code surrounding these (making it easier to read and manage). With my current approach, I either have to manually comment out each empty line of code, or not have empty lines, making the code hard to read. With the command (let's call it \skippingparagraph), I would be able to have code looking like

  1. bla blah top paragraph.
  2.  
  3. \begin{figure}[htbp]
  4. I'm a figure!
  5. \end{figure}
  6.  
  7. \skippingparagraph
  8. Blah blah new paragraph

instead of

  1. bla blah top paragraph.
  2. %
  3. \begin{figure}[htbp]
  4. I'm a figure!
  5. \end{figure}
  6. %
  7. \\ \\
  8. \noindent Blah blah new paragraph

Of course this command would have to do the correct thing when it ends up making the new paragraph at the top of a page or underneath a float (then the spacing shouldn't suddenly make the paragraph start further down on the page).

I realize this question is a little silly, since the command wouldn't make much of a difference, but I like to keep my code clean, and this has bothered me for years. My google-fu hasn't been strong enough to find anything related before this.

Thank you in advance for anyone giving it a try! :)

I tend to use the article or book document classes - although I don't think this will change much for this problem.
OS, LaTeX-system, editor: Arch Linux 64bit, TeXlive, Kile | Windows 7 Professional 64bit, MikTeX 2.9, TeXnicCenter 2.0 beta 1 64bit

Tags:

User avatar
Stefan Kottwitz
Site Admin
Posts: 9416
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Fri Aug 14, 2015 5:37 pm

Very nice to see you again here in the forum!

It's good that you post this question, because line end commands are not a good choice to create vertical space. As you thought, it can be a problem when a page break happens right before: the dummy line would be at the top of the next page, but we would not need this white space there.

You can define the desired command like this:

  1. \newcommand*{\skippingparagraph}{\par\vspace{\baselineskip}}


It breaks the paragraph and adds a vertical space of the height of one line. Indentation should not happen, but you could also add \noindent to the macro.

If you would prefer to have an empty line anyway, which makes the paragraph break, you could remove the \par from the macro.

Stefan
Site admin

User avatar
Bozack
Posts: 115
Joined: Wed Feb 06, 2008 4:21 pm

Postby Bozack » Fri Aug 14, 2015 5:49 pm

This is absolutely perfect, thank you so much for the quick reply! Stefan to the rescue again! ;)

I ended up using

  1. \newcommand*{\skippingparagraph}{\par\vspace{\baselineskip}\noindent}

to still have the line not be indented after the vertical skip. :)
OS, LaTeX-system, editor: Arch Linux 64bit, TeXlive, Kile | Windows 7 Professional 64bit, MikTeX 2.9, TeXnicCenter 2.0 beta 1 64bit


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 5 guests