Site icon texblog

Correctly typesetting paragraphs in LaTeX

In LaTeX, paragraphs are ended by leaving a blank line between the end of the previous and the beginning of the next paragraph, never through a combination of end-line (\\) and new-line (\newline) commands.

 

A standard paragraph
\documentclass[11pt]{article}
\begin{document}
\section{Ending a paragraph}
... end of previous paragraph.

Beginning of next paragraph ...
\end{document}

 

Changing the standard behavior

The new paragraph automatically gets indented a little with no extra vertical space between. Should you require to change this behavior, use the setlength command on parindent to change the indentation and on parskip for adjusting vertical space between paragraphs. For example, adding the following two lines of code to the preamble reduces the indentation to zero and adds some vertical space between paragraphs:

\setlength\parindent{0pt} % sets indent to zero
\setlength{\parskip}{10pt} % changes vertical space between paragraphs

For exactly one empty line between two paragraphs, use baselineskip:

\setlength{\parskip}{\baselineskip}

A similar behavior is provided by the parskip package, zero parindent and non-zero parskip. In addition, it adjusts the space between list items. It is sufficient to load the package in the preamble.

\usepackage{parskip}

 

Adding more flexibility

For documents with figures and other elements, where the number of lines differs on different pages, it may be useful to add some flexibility to space between paragraphs (“rubber” length). You define how much more or less space is allowed between paragraphs and LaTeX will find the optimal page break position.

\setlength{\parskip}{0.5\baselineskip plus2pt minus2pt}

The parskip package mentioned above uses “rubber” length.

Exit mobile version