Introduction to Paragraphs in LaTeX
In traditional word processors, you might be used to pressing "Enter" multiple times to create space or using the spacebar to indent a line. In LaTeX, paragraph formatting is handled through a set of logical rules designed to produce professional, book-quality typesetting.
LaTeX distinguishes between "breaking a line" and "starting a new paragraph." Understanding this distinction is the first step toward mastering document layout. By default, LaTeX follows standard publishing conventions: it justifies text on both sides and indents the first line of every paragraph (except the very first one in a section).
Creating and Breaking Paragraphs
The most fundamental rule in LaTeX is how to tell the compiler that one paragraph has ended and another has begun.
The Blank Line Method
To start a new paragraph, simply leave at least one empty line in your source code.
This is my first paragraph. I am writing some content here to
demonstrate how LaTeX handles text blocks.
This is my second paragraph. Because there is a blank line
above it in the editor, LaTeX will automatically start a
new paragraph and apply the default indentation.The \par Command
Alternatively, you can use the \par command. This is equivalent to a blank line and is often used inside custom commands or macros.
This is a sentence.\par This sentence starts a new paragraph.Note: Avoid using the double backslash
\\to end paragraphs. In LaTeX,\\signifies a forced line break within the same paragraph, which can lead to "underfull hbox" warnings and poor typesetting.
Controlling Indentation
By default, LaTeX indents the first line of every paragraph except the first one following a heading (like \section). You can customize this behavior globally or locally.
Local Control: \indent and \noindent
If you want to force an indentation or prevent one for a specific paragraph, use these commands at the very beginning of the paragraph:
\noindent: Removes the indentation from the current paragraph.\indent: Forces an indentation (useful if you want the first paragraph of a section to be indented).
Global Control: Setting the Indentation Length
If you want to change the width of the indentation for the entire document, you can adjust the \parindent length in your preamble.
\documentclass{article}
% Set paragraph indentation to 20 points
\setlength{\parindent}{20pt}
% Or set it to 0 to remove indentation globally
% \setlength{\parindent}{0pt}
\begin{document}
Your text goes here...
\end{document}Adjusting Paragraph Spacing
While academic papers often use indentations to mark new paragraphs, many modern documents (like reports or web-style guides) use a "block style" where paragraphs are not indented but are separated by vertical space.
The \parskip Command
The distance between paragraphs is controlled by the \parskip length. You can modify it in your preamble:
% Adds 10 points of space between paragraphs
\setlength{\parskip}{10pt}The parskip Package
Instead of manually adjusting lengths, the best practice for creating block-style documents is to use the parskip package. This package automatically sets \parindent to zero and adds appropriate vertical space between paragraphs.
\documentclass{article}
\usepackage{parskip} % Simplifies block-style formatting
\begin{document}
This paragraph will not be indented.
The space between this paragraph and the previous one
is automatically managed by the parskip package.
\end{document}Text Alignment and Justification
By default, LaTeX uses full justification, meaning it stretches the spaces between words so that both the left and right margins are straight. However, you may sometimes need different alignments.
Using Environments
For larger blocks of text, use environments:
center: Centers the text.flushleft: Aligns text to the left (ragged right).flushright: Aligns text to the right (ragged left).
\begin{center}
This text is centered.\\
It is useful for titles or quotes.
\end{center}
\begin{flushleft}
This text is left-aligned. The right edge will remain
"ragged," which is often easier to read in narrow columns.
\end{flushleft}Using Switches
If you want to change the alignment for the remainder of a scope (like inside a { } group or a table cell), use these commands:
\centering: Centers the text.\raggedright: Left-aligns the text.\raggedleft: Right-aligns the text.
Note: When using these switches, use
\paror a blank line before the closing brace to ensure the formatting applies to the entire paragraph.
Line Spacing
Standard LaTeX uses single spacing. If you are writing a thesis or a draft that requires double spacing or 1.5 spacing, the most reliable way to achieve this is the setspace package.
Using the setspace Package
Add \usepackage{setspace} to your preamble, then use the following commands:
\documentclass{article}
\usepackage{setspace}
% Global setting
\onehalfspacing
% \doublespacing
% \singlespacing
\begin{document}
This text will be spaced at 1.5 lines. This is a common
requirement for academic submissions to allow room for
handwritten editor notes.
\begin{singlespace}
This specific paragraph will return to single spacing
regardless of the global setting.
\end{singlespace}
\end{document}Best Practices and Common Pitfalls
- Don't use
\\for vertical space: If you want more space between paragraphs, do not use\\ \\ \\. Instead, use\vspace{length}(e.g.,\vspace{1cm}) or adjust\parskip. - Avoid Manual Hyphenation: LaTeX is excellent at hyphenating words to keep margins even. If it fails on a specific word, you can help it by using
\-(e.g.,hy\-phen\-at\-ed) rather than typing a hard hyphen. - The "First Paragraph" Rule: Remember that in the
articleandbookclasses, the first paragraph after a chapter or section title is never indented. This is a standard typesetting rule. If you must change this, use theindentfirstpackage. - Consistency is Key: Avoid mixing
\parskipand\parindentunless you have a specific design reason. Usually, you should use either indentation OR paragraph spacing to signify a new paragraph, but rarely both.
By mastering these paragraph controls, you move from simply "typing text" to truly "typesetting documents," ensuring your work looks professional and remains easy to read.
