Describe the bug
Using cetz or any cetz-based packages with Typst will result in weird rectangles around texts.
To Reproduce
Steps to reproduce the behavior:
- Have a .md file with math display block
- Set LaTeX engine to typst
- View the rendered result on the browser
Expected behavior
The texts of the rendered Typst math block should be displayed normally without surrounding rectangles.
Screenshots and Source
Expected result:

Source:
$$
#import "@preview/cetz:0.4.2": canvas, draw, tree
#canvas({
import draw: *
let encircle(i) = {
std.box(baseline: 2pt, std.circle(stroke: .5pt, radius: .5em, std.move(dx: -.35em, dy: -.45em, [#i])))
}
set-style(content: (padding: 0.5em))
tree.tree(
([Expression #encircle($5$)], (
[Expression #encircle($3$)],
([Expression #encircle($1$)], `Int(1)`),
`Plus`,
([Expression #encircle($2$)], `Int(2)`),
),
`Lt`,
([Expression #encircle($4$)], `Int(4)`),
))
})
$$
Link to my own pages (which demonstrates this issue): https://nofe1248.github.io/Paper-Reading/tree-borrows
Desktop (please complete the following information):
- Quartz Version: v4.5.2
node Version: v25.9.0
npm version: v11.12.1
- OS: Arch Linux
- Browser: Microsoft Edge
Describe the bug
Using cetz or any cetz-based packages with Typst will result in weird rectangles around texts.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The texts of the rendered Typst math block should be displayed normally without surrounding rectangles.
Screenshots and Source
Expected result:
Source:
Link to my own pages (which demonstrates this issue): https://nofe1248.github.io/Paper-Reading/tree-borrows
Desktop (please complete the following information):
nodeVersion: v25.9.0npmversion: v11.12.1