17

My question is similar to this one but I understand the behavior described there and am interested in best practices in cases like the following.

Typically, when ending an environment like quote in the body of my documents, I've always left a blank line after the environment (it improves code readability for me to separate environments from the main text in this way) and suppressed the paragraph indentation with \noindent. Like so:

\documentclass{article}

\begin{document}

Some body text. Let's introduce a quote:%
%
\begin{quote}
Some quote text.
\end{quote}

\noindent Some text following the quote.

\end{document}

Now, I recently realized (no idea why it took me so long) that I could simply comment out the empty line and save myself from littering a bunch of \noindents all over my document. So now I do this:

\documentclass{article}

\begin{document}

Some body text. Let's introduce a quote:%
%
\begin{quote}
Some quote text.
\end{quote}
%
Some text following the quote.

\end{document}

What I am interested in now is whether there are any substantive differences between the two approaches given above that might lead me to prefer one over the other (this is in the spirit of some of my recent questions like inline math or \textit for author defined math constants). Are there?

Dennis
  • 3,855

2 Answers2

20

Yes there is a lot of difference, and use of \noindent is usually a sign that something is wrong:-)

A blank line denotes the start of a paragraph.

So if you want the text after the display environment (quote enumerate center displaymath all work the same) to be part of the same paragraph then you should not have a blank line, if you do want a new paragraph then you should have a blank line.

Practically speaking a new paragraph is marked by several things: extra vertical space, and indentation and \noindent only hides some of the things, the indent, but even if it hid everything (and if \parskip is zero it does hide most) it would still be the wrong thing to do and complicate conversion to other formats that may want paragraphs fully marked up.

David Carlisle
  • 757,742
  • Apparently I should just ping you whenever I wonder about these sorts of things :-) – Dennis Mar 17 '14 at 21:32
  • 1
    I think you mean "if you do want a new paragraph then you should have a blank line." – Nick Matteo Mar 17 '14 at 23:57
  • Sorry I still do not understand: what is the quickest and most correct way to start a new paragraph without indentation? – მამუკა ჯიბლაძე Mar 18 '14 at 12:12
  • @მამუკაჯიბლაძე There should be very few times that you want to do that. After a section head indentation is suppressed, and in other places where you do not want indentation (for example after a list or math display) it is not that you do not want indentation: you do not want a new paragraph, so do not insert a blank line. If you really want to start a new paragraph without indentation in a document that is using indented paragraphs then you can use \noindent but this should be a very rare thing to need to do. – David Carlisle Mar 18 '14 at 12:26
  • @DavidCarlisle Well sometimes I need it to imitate a theorem-like environment without actually introducing one - say if I have a single remark, a single claim, a single sublemma, etc., which I never need to \ref to, it is too much hassle introducing each with a \newtheorem and \begin-\ending all of them... – მამუკა ჯიბლაძე Mar 18 '14 at 12:34
  • @მამუკაჯიბლაძე well OK if you want to use \noindent then it's available for that use. But it's like using \textbf{\large my title} instead of a proper sectioning command it sort of half works and it's legal latex, but by the time you take care of indentation and disallowing page break after the head, and getting consistent spacing, in 999 times out of 1000 it's simpler to use the standard command. – David Carlisle Mar 18 '14 at 12:40
5

I my eyes the difference is that a blank line ends a (logical) paragraph of your text, which should be represented in the source code as well. I try to prevent using \noindent but I use out commented empty lines to make the source more readable – as in your second example.

Furthermore if you sometimes decide to switch from indenting paragraphs to separating them, the \noindent approach will fail … so uncommenting is more robust …

Tobi
  • 56,353