Skip to content

Center-alignment of numbered headings is off for multiline headings #6834

@eltos

Description

@eltos

Description

Headings can be center-aligned with this simple show rule

#show heading: set align(center)

However, for multi-line headings with numbering enabled, only the first line is truly centred and the following lines are centre-aligned with respect to the first line excluding the numbering. This makes sense for left-aligned headings (1st case in the example below), but for centre-aligned headings it looks off (2nd case). Instead, when numbering is disabled and the number is manually added for demonstration, one gets the expected result (3rd case).

Image
#block(stroke: gray)[
  
  #set heading(numbering: "A)")
  = Left aligned\ multiline heading\ OK
  #lorem(5)
  
  #show heading: set align(center)
  = Centered\ multiline heading\ OFF
  #lorem(5)
  
  #set heading(numbering: none)
  = B) Centered\ multiline heading\ OK
  This is desired\
  #lorem(5)

]

Reproduction URL

No response

Operating system

Web app

Typst version

  • I am using the latest version of Typst

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions