I asked a question earlier today, where I learned that the subequations environment provided by amsmath does not enter math mode: Missing $ inserted error when using \frac inside subequations environment?

According to the documentation however, align should enter math mode (see pg. 10). Then, why does the following MNWE (minimum not working example) not work?




\section{Hello World}
            \frac{a}{b} &= 0 \\

            x + y &= \frac{a}{b} \\


The errors being produced seemingly suggesting once again that align is not a math mode environment?

line 14: Missing $ inserted I've inserted a begin-math/end-math symbol since I think
line 15: Missing \endgroup inserted x + y &
line 15: Missing $ inserted x + y &= \frac{a}{b}
line 15: Extra }, or forgotten $ x + y &= \frac{a}{b}
line 16: Misplaced \cr \end{align}
line 16: Missing $ inserted \end{align}
line 16: Missing } inserted \end{align}
line 16: Misplaced \noalign \end{align}
line 16: Extra }, or forgotten \endgroup \end{align}
line 16: Missing $ inserted \end{align}
line 0: Display math should end with $$

In particular, note the error for line 14: "I think therefore I insert $?". Okay, all jokes aside, what's up here? Am I not understanding the documentation correctly?

  • 5
    Don't leave a blank line inside align...
    – Werner
    Dec 21 '14 at 1:35
  • 2
    In addition to what Werner suggests, remove the \\ from the final row of the align, or else you get a blank line labeled (1c). Dec 21 '14 at 1:43
  • @StevenB.Segletes Ah! So it's not the `\` marks that define a "new equation line"?
    – user89
    Dec 21 '14 at 1:48
  • align does not like empty lines inside of it. Removing all empty lines makes everything work okay. Thanks to Werner for pointing this out in the comments above.
    – user89
    Dec 21 '14 at 1:50
  • 1
    Yes, \\ for sure finishes the current line. In environments like tabular, placing it on the last line is ignored. But in align type environments, placing \\ on the final line actually creates a blank following line. Dec 21 '14 at 1:51

This is even more than in your answer (now comment). In any form of math mode, \par and equivalent forms, like an empty line, causes an error. The reason is in the Chapter 16, p. 135 of The TeXbook

Conversely, a blank line or \par is not permitted in math mode. This gives TeX another way to recover from a missing $; such errors will be confined to the paragraph in which they occur.

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.