Skip to content

Multiline inline math renders outside its list item #9028

Open

Description

@IceflowRE

Description

When a multiline math expression is placed inside a numbered list item (or a normal list), all lines except the last line of the expression is rendered above the list item marker instead of being aligned with the list item's content.

1. First Item
2. $a + b \ b + c \ d + e$
3. More items
Image

The first line of the mathematical expression should appear after the 2. marker, and all other lines should appear directly below it, indented as part of the same list item.

Tested with Typst version 0.15.1 in the Typst playground and on linux with VSCode Typst extension.

Operating system

Web app

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Oct 30, 2026
  2. changed the title [-]Multiline inline math renders outside its numbered list item[/-] [+]Multiline inline math renders outside its list item[/+] on Oct 30, 2026
  3. Enivex commented on Oct 30, 2026

    @Enivex
    Collaborator

    You really aren't supposed to use multiple lines in inline equations

  4. added
    math
    and removed
    bug
    on Oct 30, 2026
  5. tianyi-smile commented on Nov 5, 2026

    @tianyi-smile

    In Typst 0.15.1, when an inline equation has multiple lines, then it has no baseline (so in default, it uses bottom). I think, this can be improved (like block equations). See the following example:

    + $vec(1,1,1) \ vec(1,1,1) a b$
    + $vec(1,1,1) a b$
    Image

    You can wrap the block equations in box to get the desired behavior:

    2. #box([$ a + b \ b + c \ d + e $])
  6. laurmaedje commented on Nov 5, 2026

    @laurmaedje
    Member

    Given how we already lift horizontal spacing in equations into the paragraph layout (and will do more of that in #6358), I think it might make sense to either forbid linebreaks or also turn them into paragraph level linebreaks. From these two options, I'm leaning towards outright forbidding them (and alignment points too).

    Are there any real use cases for multi-line inline equations that are not better served by a (potentially boxed) block equation? The name inline already kind of says that it shouldn't be multiple lines.

  7. IceflowRE commented on Nov 5, 2026

    @IceflowRE
    Author

    Are there any real use cases for multi-line inline equations that are not better served by a (potentially boxed) block equation? The name inline already kind of says that it shouldn't be multiple lines.

    I am miss using it for a fast way to have left aligned small math formulas. But as i said, this might be the not intended way and or other ways available.

  8. laurmaedje commented on Nov 6, 2026

    @laurmaedje
    Member

    I opened #9046

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

    math

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions