LaTeX new line, page break and spacing
A new line is \\ or \newline. A new paragraph is a blank line in the source. A new page is \newpage. All are core LaTeX.
First line\\
Second line, same paragraph.
A blank line above starts a new paragraph.
Break with an extra gap:\\[1em]
Next line.
\noindent No indent here, \newline and a line break.\par
Another paragraph, started with \verb|\par|.A single line break in your source file does nothing: LaTeX joins the lines into one paragraph. The first line above breaks only because of the\\.
New line versus new paragraph
\\and\newlineend the current line and stay in the same paragraph.\\[1em]adds extra space after the break.- A blank line, or
\par, ends the paragraph. The next one gets the usual indent and paragraph spacing. \noindentsuppresses the indent on the paragraph it starts.\linebreak[n]breaks the line and stretches it to the margin.nfrom 0 to 4 sets how strongly: 4 forces the break, lower values only suggest it.
Use \\ for addresses, poems and table rows, where the line structure is the content. Do not use it to separate paragraphs; that leaves no paragraph spacing and no indent, and stacking\\ \\ \\ to make gaps is the usual sign of a layout problem. Use a blank line, or set spacing once (see below).
The "no line here to end" error
Some text.
\\
More text.This fails with LaTeX Error: There's no line here to end.\\ ends a line, and after a blank line there is no line yet: LaTeX is between paragraphs. Delete the \\ and use a blank line, or \vspace if you want a gap. A blank line is the same as \par, so \\ straight after either one fails the same way.
Page breaks
Page one.
\newpage
Page two.
\clearpage
Page three.
\pagebreak[3]
Page three continues, or breaks here.\newpageends the page and starts another.\clearpagedoes the same, and first outputs any figures and tables still waiting to be placed. Use it before a new chapter or when floats pile up.\pagebreak[n]is a suggestion, from 0 (weak) to 4 (forced). Unlike\newpage, it stretches the page's spacing to fill it.
Vertical and horizontal space
Text before.
\vspace{2cm}
Text after a 2\,cm gap.
Left\hspace{1.5cm}Right
Left\hfill Right
Para A.
\smallskip
Para B.
\medskip
Para C.
\bigskip
Para D.| Command | Effect |
|---|---|
| \vspace{len} | Vertical gap. Dropped at the top of a page. |
| \vspace*{len} | Vertical gap that is kept at the top of a page. |
| \hspace{len} | Horizontal gap. |
| \hfill | Stretchable gap that pushes text apart. |
| \smallskip \medskip \bigskip | Preset vertical gaps; sizes follow the class and font size. |
Set spacing once
For paragraph spacing across the document, set the length in the preamble. For line spacing, load setspace.
\usepackage{setspace}
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt}
% in the body
\begin{spacing}{1.5}
Text with one and a half line spacing.
\end{spacing}Templates that use this
Line breaks matter most in addresses and signature blocks. See thecover letter andformal letter templates, ortitle pages.
Related
Spacing around lists is covered inLaTeX lists; sizes of text and baselines inLaTeX font size. If you are new to the compile loop, start withLaTeX for beginners. Templates set paragraph and page spacing for you; see thethesis templates.