When does LaTex add indentation at the start of a paragraph?

Sometimes a paragraph starts with an indentation (which could be turned off with \noindent) but sometimes it does not.

For example, I have currently an article where the section content is not indented, the text after \\ and \newline is not indented, but the text after a blank line is indented.

I'd like to understand when an indent is added to the start of a paragraph by default (and perhaps also what commonly used things might inadvertently change that behaviour)

I found: The first paragraph of the section content is not indented by default but the others are.

• I guess that you are not meant to use \\ , nor \newline, to end a paragraph, so the answer is "always". – marmot Sep 27 '18 at 7:11

The short answer is that TeX always indents a new paragraph.

However, in some cases the indentation box is removed:

1. just after a sectional title (from \chapter, \section, \subsection and so on)
2. after a list, if there is no blank line between \end{<list>} and the following text

The exception in 1 is lifted if the indentfirst package is used or the main babel language is one where the “indent also after sectional titles” behavior is set.

Here by <list> I mean every environment built around the generic list-making environments: a partial inventory is

itemize
enumerate
description
center
flushleft
flushright
quotation
quote
list
trivlist


(the last two are the most generic).

Display math environments behave similarly: if a blank line follows the display, the ensuing text is taken to be a new paragraph and so the indentation box is added. If no blank line follows, then the indentation box is not inserted in the first place (and not removed as in the previous cases).

What's a new paragraph, for the purpose of this answer?

A blank line (or a \par command) tells TeX that a paragraph must end and so it should be broken into lines. The following text is then taken as a new paragraph, hence indented as said before (but the indentation box is possibly removed).

Note that \\ does not generally end a paragraph, so no indentation box is added after it (or its sibling \newline). However \\ should only be used in an environment where manually ending lines is sensible (flushleft, center, flushright). It's also used in tabular material where it denotes the end of a row.

The indentation box has width \parindent, whose value is determined by the document class or overridden by the user, maybe through some loaded package. Exception: inside lists, the indentation box has width \listparindent (whose value depends on the current list).

Exhortations

• Never use \\ to “end paragraphs”. It's not meant for that.
• Leave TeX the job of indenting lines. This typographical device has been in use for centuries and helps the reader in better understanding how the text is laid out.

TeXnical details

Strictly speaking, also sectional titles and list items are paragraphs; however, LaTeX treats them in a special way, so they can be excluded from the considerations above. Similarly, \\ in center, flushleft and flushright actually issues \par, so in those environments it behaves the same as a blank line; however the \parindent value is set to zero in such environments.

The "standard" LaTeX document classes article, report, and book implement a set of conventions that are common in U.S. typography. Among these conventions -- and let me stress that they're conventions, not immutable laws of nature -- are

• non-zero indent at the start of a paragraph,

• except if the paragraph follows a sectioning header produced by \chapter, \section, \subsection, etc.

What to do if you don't like these conventions and can't switch to a document class that doesn't adhere to these conventions?

• If you would like to suppress the second convention mentioned above, i.e., if you would like paragraphs to start with an indent even if they follow immediately after a sectioning header, load the indentfirst package.

• Conversely, if you want to suppress paragraph indentation globally, load the parskip package. This package sets the \parindent length parameter to zero and sets the \parskip length parameter (which governs the amount of vertical whitespace between paragraphs) to a positive value.

Addendum to clarify what the term paragraph means in TeX and LaTeX documents. For TeX and LaTeX, a paragraph is first and foremost a very important logical unit within a document. TeX's paragraph-building algorithm works on whole paragraphs at a time, not line by line. Paragraphs can contain page breaks. I.e., a paragraph can start toward the bottom of the first page, experience a page break, and continue on the second page; the mere presence of a page break does not mean that TeX has started a new paragraph at the top of the second page. Likewise, forcing a line break (via either \newline or \\) does not introduce a paragraph break as far as TeX is concerned. All the forced line break accomplishes is to create a line break within the logical unit called "paragraph" (and, in the process, seriously mess up the appearance of the entire paragraph).

In short, to create a (logical) paragraph break, either leave one or more blank lines or insert a \par instruction.

• Regardless of conventions and the desired output, one should never use \\ or \newline to end a paragraph. Paragraphs should be marked with a blank line or with \par. In normal text one should usually not have to use \\ or \newline at all (of course tables and align are a different matter). Some document classes (certainly the KOMA classes) have options to set the parskip in that case the eponymous package should not be used to avoid clashes. – moewe Sep 27 '18 at 7:32
• @lucidbrot I'm not sure if I agree with the linked answer with respect to \\. I would not even use it within paragraphs. I don't think one should add explicit new lines in paragraphs (I would allow exceptions to avoid bad line breaks, say, but there are better ways to deal with that): Paragraphs are the smallest block unit of text already. Take any journal or book from your library and have a look whether or not they have explicit line breaks within paragraphs. – moewe Sep 27 '18 at 7:44
• @lucidbrot ... I mainly added the comment because you mentioned \\ in your question and I did not want people to interpret it as "\par or blank line starts a new paragraph with indentation, \\ starts one without". Sometimes that leads people to use \\ which is usually a bad idea. – moewe Sep 27 '18 at 7:45
• @lucidbrot Yes and yes, it is a judgment call whether or not to start a new paragraph (how different/related is the new thing? is it a new though? how long is the current paragraph?). But I would never subdivide a paragraph with newlines, that just destroys the justification. – moewe Sep 27 '18 at 7:49
• @lucidbrot - I posted an addendum, to clarify what the term "paragraph" means for a TeX document. Do note that forcing a line break without initiating a proper paragraph break is extremely poor-- inexcusable, really -- practice. If one sets \parindent to zero without simultaneously setting \parskip to a non-zero value, one is needlessly inviting confusion whenever the final line of a paragraph is completely full. That's why I recommended using the parskip package instead of just setting \parindent to zero if paragraph indentation is to be suppressed globally. – Mico Sep 27 '18 at 8:17