Indentation in LaTeX: \indent, \noindent, parindent and Tabs

Quick answer

  • Default: a blank line starts a new paragraph, and its first line is indented by \parindent (except right after a heading).
  • No indent for one paragraph: start it with \noindent.
  • No indent anywhere: \setlength{\parindent}{0pt}, or \usepackage{parskip} for space between paragraphs instead.
  • Force an indent: \indent at the start of a paragraph; \usepackage{indentfirst} to indent first paragraphs too.
  • Hanging indent: \hangindent=2em \hangafter=1 before the text.
  • Indent a block: quote, or \begin{adjustwidth}{2em}{0pt} from changepage.
  • A “tab”: the Tab key does nothing; use \hspace*{2em}, \quad, or the tabbing environment.
\documentclass{article}
\setlength{\parindent}{2em}   % size of the first-line indent

\begin{document}
This first paragraph is indented by 2em.

\noindent This paragraph starts at the margin.

\noindent\hspace*{4em}A manual gap of exactly 4em.

\noindent\hangindent=2em \hangafter=1
A hanging indent: the first line is flush left and every following line
is indented by 2em, as in a reference list or a glossary entry.
\end{document}

LaTeX handles paragraph indentation on its own: every new paragraph gets a first-line indent, sized to the font, and the paragraph right after a heading gets none. Indentation in LaTeX therefore comes down to a few switches: turn the indent off for one paragraph or the whole document, change its size, force it where LaTeX leaves it out, and indent things that are not first lines, such as hanging indents, quoted blocks and tab-like gaps. This guide covers each one and the errors they cause.

How Paragraph Indentation Works in LaTeX

A blank line (or \par) ends a paragraph. The next paragraph starts with a horizontal gap of width \parindent. Pressing Enter once does not start a paragraph, and neither does \\: it breaks the line inside the same paragraph, so the next line is not indented.

\documentclass{article}
\begin{document}
\section{Introduction}
This first paragraph after the heading is not indented.
Pressing Enter once keeps the text in the same paragraph.

A blank line starts a new paragraph, which is indented.\\
A line after \textbackslash\textbackslash{} is a new line,
not a new paragraph, so it is not indented.
\end{document}

The default indent depends on the class and the size option. In the standard classes (article, report, book):

Class optionDefault \parindent
10pt (default)15pt
11pt17pt
12pt1.5em (18pt)
twocolumn1em

Change it in the preamble with \setlength{\parindent}{2em}. Using em keeps the indent in proportion to the font size; see font size for the size options.

Removing Indentation: \noindent and parindent

\noindent at the very start of a paragraph suppresses its indent. To remove indentation from the whole document, set \parindent to zero. Without an indent, paragraphs only differ by the short last line, so add space between them; the parskip package does both and keeps lists and the table of contents tidy:

\documentclass{article}
\usepackage{parskip}   % parindent = 0, about half a line between paragraphs
% or by hand:
% \setlength{\parindent}{0pt}
% \setlength{\parskip}{0.5\baselineskip}

\begin{document}
First paragraph. Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Second paragraph, set off by space instead of an indent.
\end{document}

The spacing guide covers \parskip and line spacing in more detail.

Forcing an Indent: \indent and indentfirst

\indent at the start of a paragraph adds the normal indent; in the middle of a line it adds a gap of the same width. It does not work for the first paragraph after a heading, because the heading code removes the indent box. To indent those paragraphs too, load indentfirst, or use \hspace*{\parindent} for a single one:

\documentclass{article}
\usepackage{indentfirst}   % indent the first paragraph after headings

\begin{document}
\section{Method}
With indentfirst, this first paragraph is indented like the others.

\noindent\textbf{Note.} \indent The \textbackslash indent here,
inside the line, adds a gap of width \textbackslash parindent.
\end{document}

Hanging Indent in LaTeX

A hanging indent keeps the first line at the margin and indents the rest, as in reference lists and glossaries. \hangindent sets the amount and \hangafter the number of lines left unindented. Both apply to the current paragraph only and are reset afterwards, so a small macro saves repetition:

\documentclass{article}
\setlength{\parindent}{0pt}
\newcommand{\hangpara}{\hangindent=2em \hangafter=1 }

\begin{document}
\hangpara
Knuth, D. E. (1984). \textit{The TeXbook}. Addison-Wesley. A hanging indent
keeps the author at the margin and indents the following lines.

\hangpara
Lamport, L. (1994). \textit{LaTeX: A Document Preparation System},
second edition. Addison-Wesley, Reading, Massachusetts.

\hangindent=3em \hangafter=2
With \textbackslash hangafter=2 the first two lines stay at the margin and the
indent starts on the third line, which shows how the two settings combine in
a longer paragraph like this one.
\end{document}

For a real bibliography, let the reference style do it: biblatex and BibTeX styles such as APA already format entries with hanging indents (see bibliography examples).

Indenting a Whole Paragraph or Block

To indent every line of a passage, use an environment that changes the margins instead of a first-line command:

MethodEffect
quoteIndents both margins; paragraphs inside are not indented
quotationIndents both margins and keeps first-line indents
\begin{adjustwidth}{2em}{0pt}Exact left and right indents (changepage package)
{\leftskip=2em ... \par}Plain TeX: left margin for the paragraphs in the group
itemize / enumerateIndented items; see lists
\documentclass{article}
\usepackage{changepage}

\begin{document}
Normal paragraph at the full text width.

\begin{quote}
A quote environment indents both margins, the usual way to set off
a long quotation.
\end{quote}

\begin{adjustwidth}{3em}{0pt}
\noindent adjustwidth indents only the left margin by 3em here, and the
right margin stays where it is. Every line of the block is indented.
\end{adjustwidth}

{\leftskip=2em
A group with \textbackslash leftskip also indents every line by 2em.
The \textbackslash par before the closing brace is required.\par}
\end{document}

For the formatting of quotations themselves, see quotes in LaTeX.

Tab in LaTeX: \hspace and the tabbing Environment

Pressing Tab in the editor does nothing in the output: LaTeX treats a tab character as a space, collapses runs of spaces into one, and ignores spaces at the start of a line. For a tab-like gap, insert explicit space:

  • \hspace*{2em} – a fixed gap; the star keeps it at the start of a line, where plain \hspace is dropped.
  • \quad and \qquad – 1em and 2em gaps inside a line.
  • \hfill – pushes what follows to the right margin.

For text aligned at tab stops, like a typewriter, use tabbing: \= sets a stop, \> jumps to the next one, and \\ ends the line.

\documentclass{article}
\begin{document}
\noindent\hspace*{2em}Indented by 2em, like a tab at the start of a line.

Name:\quad Ada \qquad Year:\quad 1843 \hfill right margin

\begin{tabbing}
Mon \hspace{2cm} \= 9:00 \hspace{1cm} \= Lecture \\
Tue \> 11:00 \> Seminar \\
Wed \> 14:00 \> Lab \\
\> \> indented to the second tab stop
\end{tabbing}
\end{document}

tabbing does not wrap long text inside a column and draws no rules; for real columns, a table is usually the better choice.

Common Errors and Fixes

Message or symptomCauseFix
Illegal unit of measure (pt inserted)\setlength{\parindent}{0}: a length without a unit\setlength{\parindent}{0pt}
\indent after \section has no effectThe heading code removes the indent of the first paragraph\usepackage{indentfirst}, or \hspace*{\parindent}
\noindent has no effectIt is not at the start of a paragraph (there is no blank line before it), or it is placed after the text has begunPut it first in the paragraph, right after a blank line
Text after an equation, figure or list is indentedA blank line after \end{equation} starts a new paragraphRemove the blank line if the sentence continues, or use \noindent
New lines are not indented\\ breaks the line but does not start a paragraphSeparate paragraphs with a blank line
Spaces or tabs at the start of a line disappearLaTeX ignores leading whitespace; \hspace is dropped at a line start\hspace*{2em}
Paragraphs run together after parindent = 0No indent and no space between paragraphs\usepackage{parskip}
Undefined control sequence on adjustwidthThe changepage package is not loaded\usepackage{changepage}

The blank-line case after display math is the most common surprise:

\documentclass{article}
\begin{document}
The energy is
\begin{equation}
  E = mc^2
\end{equation}
where $m$ is the mass.     % no blank line above: same paragraph, no indent

\begin{equation}
  F = ma
\end{equation}

This starts a new, indented paragraph because of the blank line above.
\end{document}

Frequently Asked Questions

How do I indent in LaTeX?

LaTeX indents the first line of every paragraph automatically; a blank line in the source starts a new paragraph. To indent a line by hand, use \indent at the start of a paragraph or \hspace*{2em} anywhere. To indent a whole block, use the quote environment or \begin{adjustwidth}{2em}{0pt} from the changepage package.

How do I remove paragraph indentation in LaTeX?

For one paragraph, start it with \noindent. For the whole document, put \setlength{\parindent}{0pt} in the preamble, or better \usepackage{parskip}, which also adds space between paragraphs so they stay distinguishable. Remember the unit: \setlength{\parindent}{0} gives the error “Illegal unit of measure”.

Why is the first paragraph after a section not indented?

That is the English typographic convention, and the standard classes follow it: the first paragraph after \section, \chapter or similar headings has no indent. \indent does not override it. Load \usepackage{indentfirst} to indent every first paragraph, as French and some other styles require.

How do I make a tab in LaTeX?

The Tab key does nothing: LaTeX treats a tab character like a space, and runs of spaces collapse into one. Use \hspace*{2em} for a fixed gap (the star keeps it at the start of a line), \quad or \qquad for 1em or 2em, and the tabbing environment with \= and \> for real tab stops. For aligned columns, a tabular is usually better.

How do I create a hanging indent in LaTeX?

Start the paragraph with \hangindent=2em \hangafter=1 and then the text: every line after the first is indented by 2em. The settings apply to that paragraph only, so repeat them for each paragraph or define a macro. For a reference list, the bibliography styles and biblatex already produce hanging indents.

How do I change the size of the paragraph indent?

Set \setlength{\parindent}{2em} in the preamble (any length works, such as 1cm or 20pt). The default depends on the font size option: 15pt for 10pt documents, 17pt for 11pt and 1.5em for 12pt in the standard classes. Using em keeps the indent proportional to the font.

Next Steps

Free LaTeX Tools

Fix paragraph formatting faster with AI

Octree's AI editor removes or restores indentation across a document, sets up parskip and hanging indents for you, and compiles your document in seconds.

Try Octree Free →