-
-
Notifications
You must be signed in to change notification settings - Fork 873
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
Single letter strings get parsed as italicized in math mode #274
Comments
I agree that it is unexpected and inconsistent. Since there is already a way to create the italic character (no quotes), it would be better to make characters inside quotes behave consistently. |
Find the same issue when I was trying |
BTW, for differential you can just use |
FYI Lines 132 to 146 in 94e052b
|
I would like to add that I was also surprised by this behavior when trying to write units that use special symbols / Greek letters:
|
If we said, ok, text in quotes is upright, text without quotes is italic (or vice versa) and text with a |
I agree with the first half, but having the non |
A more recent pointer typst/crates/typst/src/math/ctx.rs Line 193 in ffc9570
|
It looks like a bug, but curiously the current behavior does not break what the doc (https://typst.app/docs/reference/math/) says:
If we want to display quoted single letter as normal text too, as suggested in this issue (and I agree!), Typst should promise this instead:
So.. do we want this? Bringing to @laurmaedje 's attention. More on impl: Inside math i.e. One idea is that during the math eval phase, when (FYI, #1125 is a larger-scale overhauling FR that is sufficient to address this issue - but not sure if that FR is necessary if we just want to fix this issue) |
@Leedehai Forcing upright at that point would unfortunately break the $ 1 "ft" = 0.3048 "m" \
A = pi r^2 italic(a "beta") $ (Just I consider this issue a bug or at least something that's not desirable, but I'm not sure whether we can properly fix it without something like #1125. |
Agreed. Further, special-casing Barring an overhaul like #1125, it looks an appropriate limited-in-scope fix should start from the parsing phase. The knowledge of different Value types in the evaluation phase is not sufficient to implement this fix. |
Yes, I think there could even be added a new element type |
It seems strange to me that
"q"
is rendered the same asq
. Currently, this can technically be worked around with"q "
, but that adds a space (not particularly different, but still slightly)The text was updated successfully, but these errors were encountered: