Skip to content

math.class is not taken into account within a context expression #3727

Closed

Description

@loutr

Description

I maintain the tiny xarrow package and the latest version 0.11 of the compiler seems to have brought a regression, which impacts the package. A minimal example is the following:

#let test = math.class("relation", "--")
$ a test b $

displays correctly, with an appropriate spacing around --, but

#let test = style(_ => math.class("relation", "--"))
// or the new #let test = context math.class("relation", "--")
$ a test b $

doesn't (it has an extra space between -- and b).

This is easily fixable in the case of xarrow for instance, where it boils down to swapping operations as in:

// where expr depends on context of course
#let test = math.class("relation", context expr)

but I figured it would be best to signal it anyway. Sorry if this is a duplicate or my mistake or anything. Thanks for your amazing work as always!

Reproduction URL

No response

Operating system

Linux

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Mar 19, 2024
  2. added
    math
    on Mar 22, 2024
  3. wrzian commented on Apr 28, 2024

    @wrzian
    Contributor

    This seems like it might be related to the issue with the math-call-pass-to-box test I added? See here: #3786 (comment) If so, it would be fixed by whatever happens with #1125 and #1779 .

  4. mkorje commented on Nov 24, 2024

    @mkorje
    Collaborator

    On main, all three examples look identical. Bisect says #4348 fixed this.

    Is there still an issue here? @EpicEricEE you mentioned in #4348 that the "--" is not being measured correctly.

  5. EpicEricEE commented on Nov 24, 2024

    @EpicEricEE
    Contributor

    I did, but that is an unrelated issue, which I just found out to be another case of #702

    $ #box("--", stroke: red + 0.4pt) $

    image

  6. mkorje commented on Nov 25, 2024

    @mkorje
    Collaborator

    I think this issue can be closed then.

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