-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
\dots fails if followed by commands involving primitive \if
#1448
Comments
* add extra meaning test for #1448 * forgot to add test file to git * chmod * luatex (l3build could perhaps have normalised this) * eol eof * document use of special uccodes for catcode 12 tokens * Correct a missing "%" --------- Co-authored-by: Joseph Wright <[email protected]>
The fix above was released in the 2024-11-01 release but unfortunately misses one case using An extended test file with an extra case (
It remains to be seen whether to re-adjust the |
Possibly related: #1531 (comment) |
The same error just occurred to me, when using
The cause was not immediately clear to me, as my custom commands
Apparently, there have to be some nested |
@guger there is an |
@davidcarlisle Very interesting, thank you for the explanation! |
@guger after loading
to your preamble could you confirm the problem goes (this isn't the real fix, which should be in |
@davidcarlisle Yes, this solves the issue! Thanks! |
@guger thanks for confirming. That change (adding |
I have observed a related bug -- should I open a new issue about it? The following minimal code \documentclass{article}
\usepackage{amsmath}
\begin{document}
$A=\{1,2,\dots\}$
\end{document} triggers
(Using |
@clason That looks like the same issue. Does the code @davidcarlisle posted above help? |
It does not, unfortunately. |
@clason yes sorry, that example was posted to https://tex.stackexchange.com/questions/730161/recently-added-bug-to-amsmath yesterday, it's the same issue in |
Thanks, the tex.se post is indeed exactly the same. (Cue lament on the declining usefulness of Google...) As the workaround is trivial and harmless (just add an |
Brief outline of the bug
The code added at #1424 to expand past a
\protect
definition may expose a primitive\if...
tokenthis reacts badly when nested in the testing done by
\dots
.Minimal example showing the bug
gives
I think the best solution in the end would be to f-expand before testing so that primitve
\if
s,\protect
and\protected
and\long
definitions would all be resolved in advance and the testing simplified, however it would be a disruptive change as the current\DOTSI
,\DOTSB
, .. definitions wouldn't be distinguishable (as they are all\ifx
equal to\relax
).So the suggestion here is more in the spririt of the existing code, check after the first
\meaning
if the token is a primitive\if..
(because meaning starts\if
) and if so skip the test that expands and checks for\protect
.Full .sty attached for ease of testing. (I could make a PR against the dtx source later, but possibly not this weekend)
amsmath.txt
The text was updated successfully, but these errors were encountered: