I'm trying to understand the error messages when using latex without having to google them all. The following example produces 10 errors when using TexpadTeX (based on TeX Version 3.14159265 with e-TeX extensions) running in extended mode embedded in Texpad 760 (preloaded format=latex 2021.3.29):
\documentclass[11pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{gather}
1=1
\end{gather}
\end{document}
The problem with the code above (from a user perspective) is that there is a blank line within the gather environment, which isn't allowed. The generated error messages however are the following:
! Paragraph ended before \gather was complete. <to be read again> \par l.6! Missing $ inserted. <inserted text> $ l.6! Missing \endgroup inserted. <inserted text> \endgroup l.6! Display math should end with $$. <to be read again> \par l.6! Misplaced \cr. \math@cr@@@ ->\cr l.7 \end{gather}! Misplaced \noalign. \math@cr@@ ... \iffalse }\fi \math@cr@@@ \noalign {\vskip #1\relax } l.7 \end{gather}! Misplaced \noalign. \black@ #1->\noalign {\ifdim #1>\displaywidth \dimen@ \prevdepth \nointerlin... l.7 \end{gather}! Extra }, or forgotten \endgroup. \endgather ->\math@cr \black@ \totwidth@ \egroup $$\ignorespacesafterend l.7 \end{gather}! Missing $ inserted. <inserted text> $ l.7 \end{gather}! Display math should end with $$. <to be read again> \endgroup l.7 \end{gather}
I don't quite understand how someone could deduce the action "remove the empty line inside the gather environment" from these error messages. Which of these error messages points me in that direction?
Thanks in advance!
amsmath. Empty lines would (as usual) result in an end of paragraph (aka\par), which is not supported and therefore results in the first error message. This is the only real error in your code. All others are aftereffects. Note: If you need such an empty line for source structuring use an empty comment instead (by adding a%at the beginning of the empty line). – cabohah Jun 15 '23 at 11:34\parcontrol sequence. And that a scanner of macro parameters dislike\parcontrol sequence unless the macro is declared as\long– wipet Jun 15 '23 at 14:09