2

I'm just starting to learn LaTeX. I tried typing

\begin{equation*}

(sample of different operators and symbols separated with \,)

\end{equation*}

and I got a whole bunch of errors. It seems LaTeX interpreted the empty line as the equation: when it saw nothing there, I guess it just ended math mode? It then said my other commands needed $'s so I assume that's what happened. When I typed

\begin{equation*}
(sample of different operators and symbols separated with \,)
\end{equation*}

everything was fine. So I'm confused. If LaTeX sees an empty line in an environment, does it just interpret this as me changing my mind, and deciding not to use the declared environment?

  • 2
    Blank lines are disallowed in math mode. – egreg Feb 26 '15 at 21:27
  • 2
    a blank line is understood by tex as indicating a paragraph break. and math mode isn't allowed to continue across multiple paragraphs. hence a blank line within a math environment is reported as an error. – barbara beeton Feb 26 '15 at 21:27
  • Related: When should we use a blank line? – Werner Feb 26 '15 at 21:50
  • Possible duplicate: Blank lines in align environment – Werner Feb 26 '15 at 21:51
11

An empty line in TeX should never be used just to arrange the source. It is an instruction exactly the same as the command \par which ends a paragraph and starts TeX's line breaking algorithm to split a paragraph into lines.

So it is not allowed in display math and it should never be used on the line before display math either, in that position it does not generate an error but forces TeX to take recovery action that produces a spurious white paragraph on the line above the display.

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.