LaTeX Line Break Commands: \\, \newline, \linebreak, \vspace and \hfill
Quick answer
- New line, same paragraph:
\\or\newline. Add space with\\[6pt]. - New paragraph: a blank line in the source, or
\par. - Blank line in the output:
\vspace{\baselineskip}or\bigskip, never\\ \\. - Horizontal space:
\hspace{1cm},\quad,~, and\hfillto push text right. - New page:
\newpage, or\clearpageto also place pending figures.
\documentclass{article}
\begin{document}
First line\\
Second line, same paragraph\\[6pt]
Third line, 6pt lower.
A new paragraph starts after a blank line.
\vspace{\baselineskip} % one empty line
Left text \hfill right text
\end{document}LaTeX decides where lines end on its own, and most of the time you should let it. When you do need a break (an address, a poem, a signature block, a gap before a heading), the right command depends on what you want: a new line inside a paragraph, a new paragraph, or empty space. This reference compares the commands side by side: \\, \newline and \linebreak, paragraph breaks, vertical space with \vspace, horizontal space with \hspace and \hfill, page breaks, and the errors that come from fighting the line breaker. For a gentler introduction with a copy-and-paste cheat sheet, read the line breaks and blank spaces post on the blog. Every example compiles with pdfLaTeX.
New Line in LaTeX: \\ vs \newline vs \linebreak
Three commands end a line, and they are not the same. \\ and \newline end the line where you put them and leave the rest of it blank. \linebreak ends the line too, but justifies it first, stretching the words across the full width:
\documentclass{article}
\begin{document}
This line ends with two backslashes\\
and continues here, in the same paragraph.
This line ends with newline\newline
and continues here as well.
This line ends with linebreak, so its words are stretched\linebreak
to the full width, like every other line of a justified paragraph.
\end{document}| Command | Line before the break | Optional argument | Use it for |
|---|---|---|---|
\\ | Left ragged | [length] extra space below, e.g. \\[2mm] | Addresses, poems, title blocks, table rows |
\\* | Left ragged, no page break after it | [length] | Keeping two lines on the same page |
\newline | Left ragged | None | The same as \\ in running text; also breaks a line inside a p table cell |
\linebreak[n] | Stretched to full width | 0–4, from a hint to a demand | Nudging the line breaker, rarely |
\nolinebreak[n] | No break here | 0–4 | Discouraging a break at one spot |
Inside tabular, align and other environments with rows, \\ ends the row, which is why it is the command you will see most. Inside a section title it moves into the table of contents too; give the short form as an optional argument, as in \section[Short title]{Long\\title}.
Paragraph Break: Blank Line or \par
A blank line in the source ends the paragraph; so does \par. Several blank lines count as one, so they never add space. The new paragraph starts with the normal indent (none after a heading in English documents):
\documentclass{article}
\begin{document}
The first paragraph ends here.
The second paragraph is indented. \par
So is the third, which starts after \verb|\par|.
\noindent The fourth has no indent.
\end{document}If you want space between paragraphs instead of indents, load \usepackage{parskip} rather than ending every paragraph with \\. The paragraphs and indentation guide covers \parindent, \parskip and hanging indents.
Blank Lines and Vertical Space: \vspace, \bigskip and \vfill
To leave empty space between lines, ask for it by size. \vspace takes any length, and the skip commands give standard gaps that can stretch or shrink a little:
\documentclass{article}
\begin{document}
\vspace*{2cm} % starred: kept even at the top of a page
\begin{center}
{\LARGE Report Title}\\[1em]
A.~Author
\end{center}
Text before a gap.
\vspace{\baselineskip} % exactly one empty line
Text after one empty line.
\smallskip Small skip. \medskip Medium skip. \bigskip Big skip.
Text in the middle of the page.
\vfill % push what follows to the bottom
Signed: \rule{4cm}{0.4pt}
\end{document}| Command | Space | Note |
|---|---|---|
\vspace{1cm} | Any length; negative values pull text up | Dropped at the top or bottom of a page |
\vspace*{1cm} | Same | Kept at the top of a page (title pages) |
\smallskip, \medskip, \bigskip | About 3pt, 6pt, 12pt | Stretchable, so pages still balance |
\vspace{\baselineskip} | One line of the current font | The honest “blank line” |
\vfill | All remaining space | Several \vfill share it equally |
\vspace in the middle of a paragraph waits for the current line to end before it adds space. Line spacing (double spacing, \linespread, setspace) is a separate setting covered in the spacing guide.
Horizontal Space: \hspace, \quad, ~ and \hfill
Several spaces in the source print as one, and spaces at the start of a line are ignored. Ask for horizontal space with a command instead:
\documentclass{article}
\begin{document}
\noindent
A\hspace{1cm}B \\
A\quad B\qquad C \\
\hspace*{2em}Indented by 2em with \verb|\hspace*| \\
Name: John Smith \hfill Date: 9 November 2026 \\
Left \hfill Centre \hfill Right \\
Fig.~1 and Dr.~Smith never break at the tilde.
\end{document}| Command | Width |
|---|---|
\, / \thinspace | 1/6 em (thin space) |
\␣ (backslash space) | A normal interword space, e.g. after e.g.\␣ |
~ | A normal space that never breaks |
\quad / \qquad | 1 em / 2 em |
\hspace{len} / \hspace*{len} | Any length; the starred form survives a line start |
\hfill | All remaining space on the line |
A Horizontal Line in the Text
For a rule across the text, start a new paragraph and draw it at the text width. \hrulefill fills the rest of a line with a rule, which is handy for forms:
\documentclass{article}
\begin{document}
Text above the line.
\noindent\rule{\linewidth}{0.4pt}
Text below the line.
\noindent Name: \hrulefill \\[1em]
Signature: \hrulefill \quad Date: \rule{3cm}{0.4pt}
\end{document}Thickness, colour, dashed rules and lines in tables are covered in the horizontal lines guide.
Page Breaks: \newpage, \clearpage and \pagebreak
\newpage starts a new page (or column, in a two-column document). \clearpage does the same after placing every figure and table still waiting, and \cleardoublepage also skips to an odd page in two-sided documents. \pagebreak is the page-level \linebreak: it breaks the page, and in a \flushbottom document (the default with twoside) it stretches the vertical space so the text still reaches the bottom of the page.
Common Mistakes
| Message or symptom | Cause | Fix |
|---|---|---|
| LaTeX Error: There's no line here to end. | \\ right after a blank line or at the start of a paragraph | Delete it; use \vspace{\baselineskip} or \bigskip |
| Underfull \hbox (badness 10000) in paragraph | \\ at the end of a paragraph, \\ \\ to fake a blank line, or \linebreak on a short line | End the paragraph with a blank line only; use \vspace{\baselineskip} for an empty line; prefer \\ to \linebreak |
Every paragraph ends with \\ to get space between paragraphs | Working around the indent | \usepackage{parskip} |
\vspace at the top of a page does nothing | Space is discarded at page breaks | \vspace*{...} |
| Extra spaces in the source do not show | LaTeX collapses runs of spaces into one | \quad, \hspace{...} or ~ |
The line after \\ starts with [ and vanishes or throws Illegal unit of measure | \\ reads the [...] as its optional space argument | Write \\{}[text] or \\ \relax [text] |
Frequently Asked Questions
What is the difference between \\, \newline and \linebreak?
\\ and \newline end the line and leave the rest of it empty (ragged), and \\ also takes an optional space such as \\[6pt]. \linebreak ends the line but stretches the words to fill the full width, as in a justified paragraph, which often looks gappy and triggers an Underfull \hbox warning.
Why do I get “There's no line here to end”?
LaTeX raises it when \\ or \newline appears where no line of text has started: at the very beginning of a paragraph or right after a blank line. Delete that \\ and use \vspace or \bigskip for the space you wanted. A doubled \\ \\ in the middle of a paragraph does not raise it, but leaves an empty line and an Underfull \hbox warning.
Why does \vspace not work at the top of a page?
LaTeX discards vertical space at a page break, so \vspace at the top of a page, or right after \newpage, disappears. Use the starred form, \vspace*{2cm}, to keep it. In the middle of a paragraph, \vspace takes effect only after the current line ends.
How do I put text on the left and right of the same line in LaTeX?
Put \hfill between the two pieces: Name \hfill Date. \hfill takes all the free space on the line, so the second piece is pushed to the right margin. With two \hfill commands, the text between them is centred.
What is the difference between \newpage and \clearpage?
\newpage ends the current page, or the current column in a two-column document. \clearpage also ends the page, but first places every figure and table still waiting to be placed, on extra pages if needed. Use \clearpage before a new part of the document so floats do not drift past it.
Next Steps
- Spacing in LaTeX – Line spacing, math spaces and every length unit
- Paragraphs and Indentation – \noindent, \parindent and parskip
- Horizontal Lines – \rule, \hrule and lines in tables
- Text Alignment – Centring and flush-left or flush-right text
- Learn LaTeX: Tutorial for Beginners – The basics every document builds on
Free LaTeX Tools
- LaTeX Preview – Compile any example above and see the result instantly
- AI LaTeX Generator – Describe a layout and get the LaTeX
Related Articles
View all articlesFix spacing problems with AI
Octree compiles your document as you type and explains every warning. Ask its AI why a line will not break, or to replace a stack of \\ with proper spacing, with the PDF next to your code.