Repository navigation
Description
Description
Description
Exporting to PDF fails with an internal error when a floating table and a footnote happen to fall around a page break inside a two-column block:
error: internal error: tags weren't properly closed
(occurred at crates/typst-pdf/src/tags/tree/build.rs:187:9)
= hint: please report this as a bug
The error is positional, not syntactic. The same content compiles fine when anything shifts the pagination. In the attached reproduction, #set page(height: 12cm) fails, while several other heights compile without error. In the real document this came from, the exact same source compiles with one font and fails with another — the only difference being the resulting line breaks and page breaks.
A closely related variant of the same code path fails with a different internal error:
error: internal error: parent group
(occurred at crates/typst-pdf/src/tags/tree/build.rs:202:14)
That one appears when adding #show enum.item: it => block(breakable: false, it) to the same document — an attempt on my side to work around the first error.
Reproduction
Self-contained, 52 lines. No external fonts, no packages. Save as repro.typ:
repro.typ
#set page(height: 12cm)
#set text(lang: "eu")
#let xref-sec(n) = [§#n]
#show figure.where(kind: table): set figure(placement: top, scope: "parent")
#columns(2)[
diogu? Hasteko, ikusiko dugu nola jasotzen duen Aro Modernoak Erdi Aroko
erantzuna (boterea Jainkoarengandik jaitsarazten zuena) eta nola hausten
duen harekin (#xref-sec("41")). Gero, lehen haustura handian geldituko
aurretik imajinatzen dituzte, hortik ondorioztatzeko zer Estatu eraiki
behar dugun eta zer mugaren barruan. Eta liberalismo politikoarekin
itxiko dugu: Lockeren eta ekonomia berriaren eskutik, gizarte
Politikaren grabitate-zentroa zerutik lurrera lekualdatu da.
zehar pentsamendu kristauaren azpian ehortzia, indar berri batez
berragertzen da Aro Modernoan: ordena politikoa giza kontua bada, orduan
gizakiok galde diezaiokegu geure buruari (eta galdetu behar diogu)
nolakoa izan beharko lukeen.
#strong[Ordena naturaletik artifiziora: kontratuaren
pentsamendu-esperimentua.] Nola erantzuten dio modernitateak boterearen
jatorriari buruzko galderari? Batez ere emankortasun izugarriko
trukean beste ordena bateko askatasun bat irabazten dut, berdinen artean
#strong[Subiranoa, gobernua eta legegilea.] Doktrina honetatik hainbat
tesi instituzional ondorioztatzen dira. #emph[Subiranotasuna] beti
herrian datza: #emph[subiranoa] hiritar guztien multzoa da, eta ezin da
besterendu, ez zatitu. Subiranoaz bestelakoa da #emph[gobernua],
borondate orokorraren betearazle hutsa: subiranoak erabakitzen duena
aplikatzeaz arduratzen den pertsona-taldea, eta hark kargutik ken
borondatearekin) bat ez badator, nork erabakitzen du zein den benetako
guztion ona, eta zer aginterekin?
#strong[Hiru erantzun galdera berari.] Rousseaurekin ixten da
kontraktualista handien hirukotea. Hirurak keinu beretik abiatzen dira
(gizakiak gizartearen aurretik imajinatzea, boterea itun batean
oinarritzeko), baina hartatik ia kontrako Estatuak ateratzen dituzte:
Hobbesen absolutismotik Lockeren gobernu mugatura eta Rousseauren
herri-subiranotasunera. Gaiaren amaiera liberalera igaro aurretik,
#figure(
align(center)[#table(
table.header([Ardatza], [Hobbes (#xref-sec("43"))], [Locke
(#xref-sec("44"))], [Rousseau (#xref-sec("45"))],),
[Erresistentzia-eskubidea], [Ez], [Bai, tiraniaren aurrean], [Herria
beti da subirano],
[Ondarea], [Estatu modernoa; itunean oinarritutako
Konstituzioa], [Herri-subiranotasuna; Frantziako Iraultza],
)]
, caption: [Hiru kontraktualistak aurrez aurre: natura-egoeratik
gobernu-formara.]
)
jaiotza-agiria da#footnote[Komeni da Smith berekoikeriaren apostolu gisa
baten lelo bihurtu dute.]. Smithek ikusten du ezen, indibiduo bakoitzak
]typst compile repro.typ
- Fails with
page(height: 12cm), and also at 10, 10.5, 11, 11.5 and 12.5 cm. - Compiles at most other heights.
- Compiles with
--no-pdf-tags, which is what points at the tag tree.
The ingredients that all seem to be needed: a #columns(2) block, a #figure containing a #table promoted to a parent-scope float, a #footnote further down, and enough text that the whole thing spans a page break. Removing any single one of them makes the error disappear — but so does changing the page height, so I would not read that as any of them being the culprit on its own.
How this was reduced
Reduced by delta debugging from a 164-page book, from 709 lines down to 52. Text is in Basque and is irrelevant to the bug; what matters is where the lines break.
Version
Reproduced on the latest release, 0.15.1, and also on 0.15.0 — same error, same
location, so this is not a recent regression:
typst 0.15.1
typst 0.15.0 (3ae52774)
macOS 26, Apple Silicon.
Expected behaviour
Either a successful export, or a proper diagnostic. The internal error gives no way to know which construct to change, and since it depends on pagination it can appear or disappear on any unrelated edit.
Operating system
macOS
Typst version
- I am using the latest version of Typst
Activity
saecki commentedon Aug 25, 2026
Possibly related to #8487
eukeni-acebal commentedon Aug 25, 2026