2

I have an article document and I use \flushleft after equations to have the next line start on the left. It seems to then do that for all new lines after the command though, which is not what I want. Is there a command to just flush left the next line? Or any other way to circumvent the problem?

  • I think you want to avoid having an empty line after your \end{equation} or \], then the next line won't be the start of a paragraph and therefore start on the left all by itself. Or maybe I misunderstand your question. – wrtlprnft May 8 '16 at 7:55
  • @wrtlprnft i see that solves the problem. may i ask if there is a "command way" to do that? i kind of like having the empty line in the editor to visually separate equations which helps me when i write the document. – Wolpertinger May 8 '16 at 7:58
  • 1
    Well, the usual hack is to have a % (comment) sign in the otherwise empty line, that's enough for TeX not to consider it a paragraph separator. The other way is to put \noindent at the start of the paragraph, this prevents indentation of just this paragraph (but not any extra vertical whitespace caused by the paragraph, so I'd prefer to avoid the paragraph altogether). – wrtlprnft May 8 '16 at 8:03
  • 2
    blank lines in TeX are not just cosmetic formatting of the source code, they are equivalent to \par a specific instruction to end the current paragraph, they should only be used were a paragraph should end (and never before a display equation) – David Carlisle May 8 '16 at 8:50
4

The reason the next line does not start at the left is because LaTeX considers it to be the start of a new paragraph. This always happens if you have a blank line between the display equation and the following text, like so:

% incorrect example – don't do this!
We can then show that

\begin{equation}
    a = 5,
\end{equation}

where $a$ is a constant.

Internally, every empty line is converted to a \par token, which usually produces a new paragraph with various possible side effects, including indenting the next line, inserting (stretchable) vertical space, and a hint to encourage page breaks.

The proper way to fix this is to remove the empty lines or make them non-empty. The latter can be achieved by inserting an empty comment:

% improved example
We can then show that
%
\begin{equation}
    a = 5,
\end{equation}
%
where $a$ is a constant.

Also note the empty comment before the equation. It prevents a similar problem of incorrect vertical spacing and page breaks. It also makes sense semantically: an equation should never start a paragraph.

As part of the original question, it was asked how to prevent indentation of just the next line. This can be done by placing \noindent at the beginning of the paragraph that should not be indented. While it has its uses, I would strongly recommend against using this method after equations due to the other possible side effects of paragraphs.

| improve this answer | |
  • 1
    you might add that an empty line shouldn't be left before an equation. that results in incorrect spacing around the display, and also allows a page break, which isn't considered good form. – barbara beeton May 8 '16 at 12:43
  • @barbarabeeton: My example did already include this, but I guess it's a good idea to explicitly mention it in the text. – wrtlprnft May 8 '16 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.