typst / typst/typst

Overlarge nested table with repeat: false header causes empty first page

Open
#8,050 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug layout
Dominant language
Rust
Stars
56.1k
Forks
1.7k
Avg merge
3d 10h
Merged PRs (30d)
22

Description

Description

When nesting an overlarge table inside another table, with the inner table's header having repeat: false on it. Typst will render the first page without any content despite there being no benefit to the contents being moved to the second page.

#set page(
  height: 50mm,
  width: 50mm,
  margin: 5mm,
)

#table(
  columns: 1fr, 
  inset: 0mm,
  stroke: 0.5pt + black,
  
  table.cell(breakable: true, fill: silver,
    table(columns: 1fr, inset: 2mm,
      table.header(repeat: false, box(height: 5mm, [Nested Table Header])),
      table.cell(box(fill: green, height: 50mm, width: 36mm, [Nested Table Contents]))
    )
  ), 
)
Image

This issue stops occurring if the header's set to repeat: true instead. I assume this is caused by some misbehavior with layouting due to headers being sticky to their first row but some calculation not keeping this into account when the header is set to not repeat.

Operating system

Linux, Web app, Windows

Typst version
  • I am using the latest version of Typst

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied nested-table Typst snippet and compare the pagination behavior with the inner header set to repeat: true. Trace the table layout and pagination handling for repeat: false; done means the overlarge nested table no longer produces an empty first page.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.