Repository navigation
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
Thanks for the PR. I lean towards not adding this to Quarto, but I will leave the decision to the maintainers. Users can already get this with one line, in #show figure.where(kind: "quarto-float-tbl"): set block(breakable: true)That is the workaround a maintainer gave in #14385, where the same rule was also mentioned as something that might go in the template (rather than injected from Lua as done here). The way the rule is added also matters. If the maintainers do want it as a default, I would put it in |
dee2eca to
231fb33
Compare
|
Thanks for checking the include order, you're right: injecting the rule from the float filter put it after I've moved the rule to #show figure.where(kind: "quarto-float-tbl"): set block(breakable: false)I also added Whether tables should be breakable by default is up to the maintainers. If they'd rather keep the current behaviour, the PR can be closed. |
Typst figures do not break across pages, so a captioned table taller
than the page ran past the page bottom and its last rows were lost.
definitions.typ now makes table figures breakable. Because the rule
comes before include-in-header in the template, a document can still
keep its tables whole with one line in its header:
#show figure.where(kind: "quarto-float-tbl"): set block(breakable: false)
231fb33 to
45cddd5
Compare
Description
Typst figures do not break across pages, so a captioned table taller than the page is not split. The whole figure moves to the next page and its last rows run past the page bottom. Several test documents work around this with a hand-written
#show figure: set block(breakable: true), for exampletests/docs/smoke-all/typst/juice/gt-table-images.qmd.Before this change the PDF has one page with 32 of the 120 rows. After it, the table spans four pages with every row.
definitions.typnow has this show rule, next to the non-breaking rule for definition items (#13978):It applies only to Quarto table floats, so image figures and listings keep their current behavior. The rule comes before
include-in-headerintemplate.typ, so a document that wants whole tables can still turn it off with one line in its header:Tests
tests/docs/smoke-all/typst/table-figure-breakable.qmdrenders a 70-row captioned table and checks that its first row is on page 1. Without the rule, the unbreakable figure moves whole to page 2 and the check fails.tests/docs/smoke-all/typst/table-figure-unbreakable-override.qmdsetsbreakable: falseininclude-in-headerand checks that the table moves whole to page 2. It fails if the rule is placed after the header, as an earlier version of this PR did by injecting it from the float filter.The other Typst smoke-all documents still pass, apart from those with R or Python cells, which I could not run locally.
Checklist
I have (if applicable):