# Why Is empty line not allowed in mathematics mode?

MWE:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$$let p^k be the statement that, for some value n=k, A^k=\begin{pmatrix}1&0 \\ k&0 \end{pmatrix}$$
\end{document}


It seems that Latex does not allow empty line in mathmode. The above code is perfectly compilable if I get rid of the last empty line. But it results in an error with the empty line. Is there a deeper reason why Latex doesn't just ignore the empty line?

1. It makes error recovery technically easier and the error message (hopefully) clearer, because when TeX encounters a missing $ you can be sure that it was at least in the paragraph at whose end the error was thrown. Knuth gives this reason in the TeXbook on page 135: \danger Conversely, a blank line or ^|\par| is not permitted in math mode. This gives \TeX\ another way to recover from a missing~|$|; such

2. The other reason is for consistency (at least in my opinion). If a blank line (which is an implicit \par) were ignored in math mode this would be in contradiction to what happens in text mode where it starts a new paragraph. To prevent this confusion it is sensible to throw an error rather than producing some inconsistent behaviour.
If you are using LuaTeX instead of pdfTeX or XeTeX, you can make the engine ignore this error. Simply add \suppressmathparerror=1 to the preamble.