typst / typst/typst

Table cell block height is incorrect when inside of a figure

Open
#8,526 2 comments 0 reactions 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 a table is inserted in a figure, the block containers generated by each cell incorrectly extend the height of the entire page. This can be seen by applying a color to blocks. The extended blocks do not affect the layout of other elements on the page. When a standalone table is created outside of the figure, the blocks are correctly the same size as the cells.

Code to reproduce and visualize the bug:

#set block(
  fill: rgb("#00000030"),
  stroke: rgb("#ff000060"),
)

This standalone table works as intended:

#table(
  columns: 3,
  [a], [b], [c],
  [1], [2], [3],
)

#figure(
  table(
    columns: 3,
    [a], [b], [c],
    [1], [2], [3],
  ),
  caption: [This table inside of a figure is bugged.],
)

#lorem(50)

Output:

Image
Operating system

Web app

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 with the minimal Typst reproduction in the issue and compare the standalone table with the same table inside a figure in the web app. Trace how figure layout determines each table cell's block height; done means the highlighted blocks inside the figure match their cells instead of extending across the page, without changing surrounding layout.

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
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.