Closed joleeee closed 8 months ago
Not sure if this really is a bug or working as intended. Math blocks have no context of where they are, so extra styling is incredibly difficult to apply. We could get more context by using a codemirror extension but I haven't found a way to completely stop Obsidian's own math blocks.
i mean the built in latex math blocks work fine in titles so i definitely think this is a bug
Not sure if this really is a bug or working as intended. Math blocks have no context of where they are, so extra styling is incredibly difficult to apply. We could get more context by using a codemirror extension but I haven't found a way to completely stop Obsidian's own math blocks.
Hi I'm doing similar thing last week(rendering typst to svg and embed them in markdown). To solve this you need to adjust the svg: by changing the unit of its height and width to em
, the svg will automatically scale itself according to the font size.
Code here: https://github.com/Myriad-Dreamin/typst.ts/blob/main/projects/rehype-typst/lib/index.js#L116
And this is how it looks like
Also I see currently the css is set to
.typst-doc {
vertical-align: bottom;
}
There can be better control of this by querying the location of text baseline in typst and set vertical-align
according to it.
I guess the optimize svg thing is no longer needed too because currently typst use a stable id to name glyphs so there is no collisions now.
I guess related is:
some vec $vec(1,2,3)$.
renders as
meawhile without the plugin this
some vec $\begin{pmatrix}1\\2\\3\end{pmatrix}$.
renders as
As of version 0.9 the output SVG's size is in em
which should scale with the font size of the line it is on including headings. This does highlight another issue of the base line but that should be discussed in a new issue.
I guess related is:
some vec $vec(1,2,3)$.
...
@joleeee This is related to #17, please discuss it there
when using typst in titles, it's not rendered as big as it should be
Text:
Rendered: