Text FormattingCommand to start paragraph with more spacing and no indent?

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

Command to start paragraph with more spacing and no indent?

Post by Bozack »

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:

Code: Select all

bla blah top paragraph.
\\ \\
\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:
Example of a new paragraph with a line skip and no indent.
Example of a new paragraph with a line skip and no indent.
examplepicture1.png (55.12 KiB) Viewed 27778 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

Code: Select all

bla blah top paragraph.

\begin{figure}[htbp]
  I'm a figure!
\end{figure}

\skippingparagraph
Blah blah new paragraph
instead of

Code: Select all

bla blah top paragraph.
%
\begin{figure}[htbp]
  I'm a figure!
\end{figure}
%
\\ \\
\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 10 Professional 64bit, MikTeX 4.9, TeXnicCenter 2.02 64bit

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Command to start paragraph with more spacing and no indent?

Post by Stefan Kottwitz »

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:

Code: Select all

\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
LaTeX.org admin
User avatar
Bozack
Posts: 117
Joined: Wed Feb 06, 2008 4:21 pm

Command to start paragraph with more spacing and no indent?

Post by Bozack »

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

I ended up using

Code: Select all

\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 10 Professional 64bit, MikTeX 4.9, TeXnicCenter 2.02 64bit
Post Reply