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
feat: \nonumber/\notag support, \tag per row of {align} #2952
Conversation
Support `\nonumber` (and equivalent `\notag`) using a global macro `\@eqnsw` to track whether one occurs in each row, similar to how amsmath uses global `\@eqnswtrue`/`\@eqnswfalse`. Fix #2950
Codecov Report
@@ Coverage Diff @@
## main #2952 +/- ##
==========================================
+ Coverage 93.46% 93.50% +0.03%
==========================================
Files 89 89
Lines 6577 6616 +39
Branches 1524 1537 +13
==========================================
+ Hits 6147 6186 +39
Misses 399 399
Partials 31 31
Continue to review full report at Codecov.
|
Hmm, perhaps I should try to implement |
OK, I've added support for |
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.
LGTM. Sorry for the delayed review. I think subparse
logic can be improved later.
Co-authored-by: ylemkimon <y@ylem.kim>
Co-authored-by: ylemkimon <y@ylem.kim>
@ylemkimon Thanks for the nice improvements! Should be ready to look at again. |
🎉 This PR is included in version 0.15.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Support
\nonumber
(and equivalent\notag
) using a global macro\@eqnsw
to track whether one occurs in each row, similar to how amsmath uses global\@eqnswtrue
/\@eqnswfalse
. Fix #2950.I also added support for
\tag
on each row of an{align}
or{align*}
or similar environment, so each row is either automatically numbered (represented bytrue
), not automatically numbered (represented byfalse
), or has an explicit tag (represented by an array of parse nodes). Fix #2379.This required a more general mechanism for expanding a macro (
\df@tag
) that doesn't actually appear in the source code. We previously did this inparseTree.js
only after parsing everything, but now we need it mid-parse too. The newParser.subparse
does the job.I also had to add a mechanism for undefining a macro value. TeX represents this as setting a macro to
\relax
, butundefined
was already used in some places inNamespace.js
so I used that.I added basic documentation and tests.
Example:
The tags are center-justified instead of the correct right-justified, but that was an existing bug that we can look at in another PR.