Skip to content

Unexpected space in math between invisible element and text #4326

Closed

Description

@EpicEricEE

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

Activity

  1. added
    bug
    on Jun 3, 2024
  2. added
    math
    on Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmath

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions