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.
CharlieMAC
The post is great, but when should I use the
\\
or the\newline
command?tom
A good question, thanks!
The
\\
command is often used intabular
andarray
, to end the line. Also, I use it in none-paragraphed text. For example to end a line in a numbered list (multiline item).I’m sure there are other applications, just can think of anything right now…
theliberalengineer
Just for the sake of adding a comment: I occasionally use the “\noindent” command during paragraph breaks if I don’t want to change the global setting through the “\setlength\parindent{0pt}” in the preamble.
tom
Thanks for the comment and linking to my blog!