-
Notifications
You must be signed in to change notification settings - Fork 372
Description
Since we use typst:no-figure
on our tables (implemented in jgm/pandoc#9778), Pandoc may not enclose tables in blocks.
Unfortunately, when the Pandoc Typst writer encounters typst:text:font
or typst:text:size
on a table, it emits #set text(...)
before the table, which will affect the entire scope.
E.g.
---
format: typst
---
Normal paragraph text.
```{=html}
<table style="font-size: 8px;">
<tr><td>A</td><td>B</td></tr>
</table>
```
Normal paragraph text.
produces
Normal paragraph text.
#set text(size: 6pt); #table(
columns: 2,
align: (auto,auto,),
[A], [B],
)
Normal paragraph text.
Oops!
One way to correct the Typst output is to wrap the set text
+ table in #[...]
:
Normal paragraph text.
#[#set text(size: 6pt); #table(
columns: 2,
align: (auto,auto,),
[A], [B],
)]
Normal paragraph text.
Plan:
- Add temporary patch, wrapping in
#[]
block, to our Typst post-processing filter here:
quarto-cli/src/resources/filters/quarto-post/typst.lua
Lines 122 to 126 in 412ea63
Table = function(tbl) | |
-- https://github.com/quarto-dev/quarto-cli/issues/10438 | |
tbl.classes:insert("typst:no-figure") | |
return tbl | |
end, |
- File bug on Pandoc illustrating the bug in pure Pandoc
- Submit fix upstream to Pandoc, using brackets only when the Typst output properties are used here.
- Remove temporary patch after fix is merged upstream and we are using that version of Pandoc.
cscheid