-
Notifications
You must be signed in to change notification settings - Fork 6
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
Another precedence issue in math parsing #55
Comments
Yes, this is definitely quite puzzling:
I can't currently see why these two cells would be parsed differently. |
Pandoc yields
And neither is correct. It should be |
Related case
Here pandoc treats the |
I think what's happening here is that code intended to get the right grouping for
is doing the wrong this for
and
|
It's hard to guess the exact rule typst is using. Note that
has f(x) in the numerator, while
does not have f_1(x) in the numerator. |
Ah, but
does have f_a(x) in the numerator. So I guess the rule has something to do with being followed by a letter? |
In my opinion there's a bit too much "magic" in typst's parser. It makes it hard to predict. |
Interestingly |
This is actually an issue with the parsing of subscripts. I think the current behavior was introduced in Typst 0.5 to allow typesetting function calls in subscripts/superscripts without extra parentheses. So Meanwhile I don't think the exact rules are documented anywhere. I guess you can get close enough by treating as a subscript function call anything that looks like a variable name or (Many people are unhappy with the current rules and there's been a lot of discussions about a redesign but no decision yet as far as I know.) |
If you could link to some of those discussions, it would be useful. |
There's some discussion on GitHub in typst/typst#985 and typst/typst#2086 but most of it was on Discord, in particular: https://discord.com/channels/1054443721975922748/1176475099940007976 https://discord.com/channels/1054443721975922748/1176478139757629563/1297121034209722371 https://discord.com/channels/1054443721975922748/1176478139757629563/1249499031873388616 https://discord.com/channels/1054443721975922748/1262525590175617085/1283107875144601715 |
Reopening because we still don't get the original case quite right:
We have |
OK I think I've got it now. |
Thanks for fixing my last bug report so quickly, this one is quite similar.
typst:
typst output:
pandoc latex output, identical for newest nightly build and newest release:
Only the first two cases are wrong, but I find it weird that the second and third one differ.
The text was updated successfully, but these errors were encountered: