-
Notifications
You must be signed in to change notification settings - Fork 101
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
Everymath #2461
Everymath #2461
Conversation
Well, it is certainly more correct than before. But there are likely further hidden inaccuracies for more custom math environments. As an example test of a subtlety, the left-arrow here surprised me in the PDF (and neither arrow shows up via this PR): {
\everymath={\leftarrow}
\everydisplay={\rightarrow}
\begin{equation}
a+b
\end{equation}
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to merge, just flagging that there are more icebergs out there...
Ah, yes. Painfully obvious, now that you point it out. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to merge, nice upgrade.
return; }, | ||
properties => sub { RefStepID('equation') }, | ||
captureBody => 1); | ||
beforeDigest => sub { $_[0]->beginMode('display_math'); }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice simplification. The cherry on the cake would be to switch the few cases of
beforeDigest => sub { $_[0]->beginMode('display_math'); }
to the abbreviated form of
mode => 'display_math'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha! I fell into that trap! (& wasted time). It's subtly different. That short form simply switches the mode (typically within an environment which establishes a grouping), whereas the commands in question like \lx@begin@displaymath
come in pairs which will do beginMode
and endMode
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! mode
also ends the mode at the end, indeed that slipped my mind. Apologies.
Use
\everymath, \everydisplay
correctly. The latter is used (alone) for displayed math, the former for inline math. Add some tests.