Skip to content

Fractional units are broken in math #5780

Open

Description

@MDLC01

Description

Consider the following piece of code:

$ x #h(1fr) y $

#h(1fr) renders with a null width:

xy

This also does not work in inline math.

Reproduction URL

No response

Operating system

No response

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Jan 29, 2025
  2. Andrew15-5 commented on Jan 29, 2025

    @Andrew15-5
    Contributor

    What is the desirable output here?

  3. added
    math
    on Jan 29, 2025
  4. MDLC01 commented on Jan 29, 2025

    @MDLC01
    CollaboratorAuthor

    That #h(1fr) extends to fill as much available horizontal space as possible, just like if I wrote

    $x$ #h(1fr) $y$

    (in the inline case)

  5. wrzian commented on Jan 29, 2025

    @wrzian
    Contributor

    Seems related to #529 and partially related to #5472

  6. Andrew15-5 commented on Jan 29, 2025

    @Andrew15-5
    Contributor

    I don't know if lists are related.

  7. uwni commented on Feb 23, 2025

    @uwni
    Contributor

    this feature is necessary to realise the following effect:
    Image

    and, there were already some discussions about it
    https://forum.typst.app/t/how-to-add-fractional-spacing-in-equation/2063

  8. mkorje commented on Sep 26, 2026

    @mkorje
    Collaborator

    I put together some ideas for how fractional spacing could work in block equations: https://typst.app/project/rABIqxO4x98oguiHSQplgv. A2 is sort of close to how columns are sized in tables, and D1 to how h(1fr) behaves inside table cells.

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