Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behavior change with empty lines in math mode #794

Open
alexanderperlis opened this issue Feb 4, 2025 · 0 comments
Open

Behavior change with empty lines in math mode #794

alexanderperlis opened this issue Feb 4, 2025 · 0 comments

Comments

@alexanderperlis
Copy link

Here are two examples of empty lines at a nested level inside display math that were previously allowed (no warning or error, output as expected):

\[
f(x) = \begin{cases}

1&\text{when $x>0$;}\\
0&\text{otherwise.}\\

\end{cases}
\]
\[
m= 
\begin{bmatrix}

1&2\\
3&4\\

\end{bmatrix}
\]

With testphase=latest, the error Paragraph ended before \environment equation* was complete is reported on the \] line. I came across this while experimenting with tagging on someone's large legacy document that compiled fine without testphase=latest. Of course the fix is easy (remove the empty line, or at least start it with % to turn it into a comment line), but I'm reporting in case there is interest in the possibility of maintaining the prior behavior.

While reducing to the MWEs above, I also re-discovered something I had forgotten: empty lines at the outer level of display math were never allowed:

\[

x=y
\]

They used to cause the error Missing $ inserted to be reported directly at the location of the empty line. The error message itself was rather confusing (this message usually occurs when you use math notation outside of math mode) but at least the location was correct and thus a user might guess that the empty line should be removed. With testphase=latest, there's no longer an error reported on the offending line; instead, the error has moved to the \] line (which could be far away). At least the error message itself has changed to Paragraph ended before \environment equation* was complete, which provides a decent clue. I'm reporting in case there is interest in the possibility of emitting the error at the location of the offending line. Or, if it ends up being a possibility to again allow empty lines inside nested constructs (top of this report), perhaps a similar technique can be used to allow empty lines at the outer level of equation environments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant