Skip to content

Extra space after question mark in math mode #4133

Closed

Description

@sijow

Description

There's an extra space after ? in math mode:

$(1, 1, ?)$

$(1, 1, !)$

$(1, 1, :)$

$(1, 1, #box("?"))$

It also looks like there's some space missing on the left. Compare with other punctuation characters and with a ? in a box:

image

Reproduction URL

No response

Operating system

Web app, Linux

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on May 14, 2024
  2. added
    math
    on May 14, 2024
  3. Enivex commented on May 14, 2024

    @Enivex
    Collaborator

    "!" is actually class Normal, not Punctuation. Though both ":" and "?" have class Punctuation, so I'm not entirely sure why their behaviors are different.

    https://www.unicode.org/Public/math/revision-15/MathClass-15.txt

  4. EpicEricEE commented on May 15, 2024

    @EpicEricEE
    Contributor

    I'm not entirely sure why their behaviors are different.

    The default class of ":" is overridden by Typst to a relation, probably to match the behavior of LaTeX:

    ':' => Some(MathClass::Relation),

  5. sijow commented on May 15, 2024

    @sijow
    ContributorAuthor

    OK that explains it. For example "¡" has punctuation class like "?" and is shown the same way, and I get the desired output when I set the class to "normal":

    $(1, 1, ?)$
    
    $(1, 1, ¡)$
    
    $(1, 1, !)$
    
    $(1, 1, class("normal", ?))$
    

    image

    Maybe what's missing is a clean way to configure the class to only affect the symbol in math...

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