Open aarnphm opened 2 days ago
I managed to track the bug to the upstream rehype-typst
package. Its inline math template (found in node_modules/.../rehype-typst/lib/index.js
)
#set page(height: auto, width: auto, margin: 0pt)
#let s = state("t", (:))
#let pin(t) = locate(loc => {
style(styles => s.update(it => it.insert(t, measure(line(length: loc.position().y + 0.25em), styles).width) + it))
})
#show math.equation: it => {
box(it, inset: (top: 0.5em, bottom: 0.5em))
}
$pin("l1")x$
#locate(loc => [
#metadata(s.final(loc).at("l1")) <label>
])
generates an error upon compilation with typst
directly, as it needs to be wrapped in "context expression" (see https://typst.app/docs/reference/context/). I haven't figured that out yet but I assume that is all that needs to be done.
Created an upstream PR here: https://github.com/Myriad-Dreamin/typst.ts/pull/604 As far as I can tell, it doesn't require any changes to the quartz project apart from updating the dependency once it gets merged.
Yeah we can let dependabot to do it so no worries. Thanks for leading the work.
see https://github.com/jackyzha0/quartz/pull/1569