Skip to content
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

Font family and size can spill out of Typst raw html blocks #11093

Open
1 of 4 tasks
gordonwoodhull opened this issue Oct 17, 2024 · 1 comment · Fixed by #11113
Open
1 of 4 tasks

Font family and size can spill out of Typst raw html blocks #11093

gordonwoodhull opened this issue Oct 17, 2024 · 1 comment · Fixed by #11113
Assignees
Labels
bug Something isn't working typst
Milestone

Comments

@gordonwoodhull
Copy link
Contributor

gordonwoodhull commented Oct 17, 2024

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:fontor 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.

Image

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:

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
@gordonwoodhull
Copy link
Contributor Author

gordonwoodhull commented Oct 23, 2024

Reopening because we have our temporary fix for 1.6 there is still work to clean this up in 1.7.

@gordonwoodhull gordonwoodhull modified the milestones: v1.6, v1.7 Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working typst
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants