2

When writing equations, I often inadvertently add a empty line. Then latex refuses to compile my tex file until I fill in the empty line. The problem occurs when I mouse in a long formula and the blank line lies below the lines that I can see on my screen without scrolling. This happens to me several times during every latex session.

If latex ignored blank lines (as it ignores blank spaces), this annoying problem would go away.

1 Answers1

6

In LuaTeX

\suppressmathparerror = 1

Will disable this check at the engine level.

In other engines you could (although it may conflict with other uses) use

\everydisplay{\let\par\relax}
\everymath{\let\par\relax}

To make end of paragraph (\par) be ignored in math mode.

Note as these constructs show, they are not "allowing blank lines in math". Blank lines are never to be regarded as cosmetic source level pretty-printing as they are in some programming laguages. A blank line is reported to the macro layer as \par: an explicit instruction to end a paragraph.

Ending a paragraph mid-display is almost never the semantic intention, so (unlike the similar but completely useless \outer error) there is some logic to making this an error, however ignoring it is a possibility (especially in luatex which has engine level support for disabling this check).

David Carlisle
  • 757,742
  • I've heard that the "useless \outer error" can be gotten rid off by \suppressoutererror=1. There is also \suppresslongerror and maybe more. – mickep Aug 30 '22 at 19:19
  • @mickep my own policy of course is never to make errors then these settings have no effect – David Carlisle Aug 30 '22 at 20:37