Paragraphs and new lines
Master paragraph formatting and line breaks in LaTeX. Learn how to control spacing, indentation, and text flow in your documents.
Understanding how LaTeX handles paragraphs and line breaks is essential for controlling your document’s appearance. LaTeX has its own rules for formatting text, which might surprise you if you’re coming from word processors.
Key concept: LaTeX decides line breaks for you to create optimal text flow. You control paragraph breaks, and LaTeX handles the rest.
How LaTeX Handles Paragraphs
Creating Paragraphs
In LaTeX, a blank line creates a new paragraph:
Multiple Spaces and Line Breaks
LaTeX treats multiple spaces as one and ignores single line breaks:
LaTeX ignores extra whitespace to give you flexibility in formatting your source code without affecting the output.
Manual Line Breaks
Using Double Backslash
Force a line break within a paragraph using \\
:
Line Break with Extra Space
Add vertical space after a line break:
The \newline Command
Alternative to \\
:
Preventing Line Breaks
Non-breaking Space
Use ~
to prevent line breaks between words:
\mbox Command
Keep text together on one line:
Paragraph Formatting
Paragraph Indentation
Control first-line indentation:
Paragraph Spacing
Control space between paragraphs:
Special Paragraph Commands
\par Command
Explicitly end a paragraph:
Centered Text
Flush Left and Right
Advanced Line Breaking
Preventing Hyphenation
Line Breaking Commands
Command | Effect | Usage |
---|---|---|
\\ | Line break | Most common |
\\* | Line break (no page break) | Keeps lines together |
\newline | Line break | Alternative to \\ |
\linebreak | Suggests line break | LaTeX decides |
\nolinebreak | Prevents line break | Keeps on same line |
Page Breaking
Control where pages break:
Common Patterns
Address Format
Poetry or Verses
Quotations
Best Practices
Paragraph and line break tips:
- Let LaTeX decide - Don’t force line breaks unless necessary
- Use blank lines - Clear paragraph separation in source
- Be consistent - Choose either indentation or spacing
- Use non-breaking spaces - Keep related items together
- Avoid
\\
at paragraph ends - Use blank lines instead
Common Mistakes
Avoid these errors:
- Using
\\
for paragraph breaks - Use blank lines - Multiple
\\
in a row - Use\\[space]
instead - Ending paragraphs with
\\
- Creates underfull hbox warnings - Too many manual breaks - Trust LaTeX’s algorithm
Troubleshooting
Underfull/Overfull hbox
If you get these warnings:
- Let LaTeX handle line breaking
- Use
\sloppy
for problematic paragraphs - Rewrite sentences if needed
Unwanted Page Breaks
Inconsistent Spacing
Check these settings:
Quick Reference
What you want | How to do it | Example |
---|---|---|
New paragraph | Blank line | text\n\ntext |
Line break | \\ | line\\line |
No indentation | \noindent | \noindent Text |
Keep together | ~ | Fig.~1 |
Center text | \begin{center} | Centered |
Extra space | \\[1cm] | With gap |
Next: Learn about Bold, italics and underlining to add emphasis to your text.