- equation dual-rendering (SVG+MathML) - compile script - readme instructions - typst manifest
21 lines
648 B
Typst
21 lines
648 B
Typst
#context {
|
|
if target() == "html" {
|
|
html.elem("style")[
|
|
.math-dual { display: inline-block; position: relative; }
|
|
.math-dual [aria-hidden] { display: contents; }
|
|
.math-dual svg { display: block; }
|
|
.math-dual math { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
|
|
]
|
|
}
|
|
}
|
|
|
|
#show math.equation: it => {
|
|
if target() == "html" {
|
|
html.elem("div", attrs: (class: "math-dual"))[
|
|
#html.elem("div", attrs: ("aria-hidden": "true", style: "display: contents"))[#html.frame(it)]
|
|
#it
|
|
]
|
|
} else {
|
|
it
|
|
}
|
|
}
|