Skip to content

layout() in the two columns of columns() reports different heights on the page the columns start #9105

Open

Description

@TylerVigario

Description

When columns() starts partway down a page, layout() in the left column gets the full height of the page's body, but layout() in the right column gets only the space left below whatever comes before the columns. The two columns sit side by side and are the same height, so I expected them to report the same thing.

#set page(width: 200pt, height: 300pt, margin: 20pt)
#block(height: 100pt, width: 100%, fill: luma(220))
#columns(2)[
  #layout(size => [left: #size.height])
  #colbreak()
  #layout(size => [right: #size.height])
]

This prints left: 260pt and right: 146.8pt. The page body is 260pt and the block takes 100pt of it plus the paragraph spacing, so 146.8pt is what the columns actually have.

It only happens on the page where the columns start. When they run onto a second page, both columns there report 260pt.

I'm not sure which number is the intended one. The docs say layout() gives the outer container's (or page's) dimensions, and a layout() placed right after the block, outside the columns, also reports 260pt. Either way I'd expect the two columns to agree. I ran into this measuring how much fits in each column of a two-column layout, where the left column's number says it has more room than it does.

Same result on 0.14.0 and 0.15.1.

Operating system

Linux

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    layout
    on Nov 24, 2026
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

    buglayout

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions