Compiling the following document will raise the errors
Paragraph ended before \align was complete
and
Displaymath should end with $$
because par-breaks are not allowed in math environments/displaymath.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
Empty
are not allowed.
\end{align}
$$
Empty lines
are not allowed
$$
\end{document}
While editing however, I frequently accidentially compile after hitting enter (creating a new line) and before adding any content, hence I am searching for a method to allow paragraph breaks in math mode, ideally ignoring them.
Just for comparison, if I needed only display-math without AMS environments, a viable solution would be
\documentclass{article}
\usepackage{amsmath}
\usepackage{xcolor}
\begin{document}
\everydisplay{\def\par{\mathbf{\color{red}-forgotten-par-}}}
$$
Empty\,lines
are\,now\,allowed
but\,you\,get\,a\,reminder
$$
\end{document}
Is there some solution that works across all common math environments?
$$in LaTeX to begin with. See Why is\[ … \]preferable to$$? – egreg Jul 01 '16 at 15:31$$only to demonstrate, that the "problem" occurs across multiple macros. Thanks for the link though; Using almost exclusively AMS environments, I never heard of that. – kdb Jul 04 '16 at 08:55