Skip to content
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

Unexpected space in math between invisible element and text #4326

Closed
1 task done
EpicEricEE opened this issue Jun 3, 2024 · 0 comments · Fixed by #4348
Closed
1 task done

Unexpected space in math between invisible element and text #4326

EpicEricEE opened this issue Jun 3, 2024 · 0 comments · Fixed by #4348
Labels
bug Something isn't working math Related to math syntax, layout, etc.

Comments

@EpicEricEE
Copy link
Contributor

EpicEricEE commented Jun 3, 2024

Description

(Partially) a regression on main, using 084a061

#let size1 = context measure($ "abc" $)
#let size2 = context measure($ #metadata(none) "abc" $)
#let size3 = context measure($ #metadata(none)"abc" $) // Note missing space

In 0.11.1, size1 == size2 == size3, but on main size2 > size1 and size3 == size1. This is also visible when rendered:

image

As the metadata element isn't visible, the space between it and the text should not be kept.
The same happens for other invisible elements, such as counter or state updates. However, with those elements, the space is also there in 0.11.1.

Addendum: Another instance of this issue is the fact that the following to sizes are not equivalent. This was also already the case in 0.11.1.

#let size1 = context measure($ #metadata(none) = 0 $)
#let size2 = context measure($ = 0 $)

Maybe related to #4234

Reproduction URL

No response

Operating system

Windows

Typst version

  • I am using the latest version of Typst
@EpicEricEE EpicEricEE added the bug Something isn't working label Jun 3, 2024
@laurmaedje laurmaedje added the math Related to math syntax, layout, etc. label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working math Related to math syntax, layout, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants