-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typst Writer: Proper captions for tables #9194
Comments
Note that Quarto also rewrites Pandoc's output to emit tables wrapped in figures, perhaps @cscheid from the Quarto team has more details to share: #figure([
#align(center)[#table(
columns: 5,
align: (col, row) => (auto,right,right,right,right,).at(col),
inset: 6pt,
[], [Lion], [Rabbit], [Tiger], [Horse],
[Ratio],
[0.89],
[0.93],
[1.11],
[0.9],
)
]
], caption: figure.caption(
position: top,
[
Caption.
]),
kind: "quarto-float-tbl",
supplement: "Table",
numbering: "1",
) |
Pandoc probably doesn't want to do anything special for Quarto here, since our crossref system is significantly more opinionated. I'll just note here that Typst will also automatically use a Table counter for "floats" with Table elements, so the fix from jgm in 3591733 is precisely what I'd do in Pandoc. |
At present, the Typst writer exports a markdown table like this:
The caption is treated as text and just placed below the table. However, the "official" method is to wrap the table in a figure:
#figure( table( columns: 4, [t], [1], [2], [3], [y], [0.3s], [0.4s], [0.8s], ), caption: [Timing results], )
https://typst.app/docs/reference/meta/figure/
This allows labels with counters and can then also be cross-referenced elsewhere...
Looking at https://github.com/jgm/pandoc/blob/main/src/Text/Pandoc/Writers/Typst.hs#L158 I could make a pull request though I know no haskell, so would just guesstimate which bits to change…
Pandoc version?
3.1.9 macOS
The text was updated successfully, but these errors were encountered: