Is it possible to render typst formula in html? #14572
-
DescriptionI am using katex as the rendering engine for formula in my quarto website project, and want to change to typst for better source code readability. However, as what I have read in the documents, it seems to be only possible to use typst when the output file is .typ/.pdf . Is there a way to integrate typst rendering engine into a website project, something like html-math-method:
method: typst? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
|
No there isn't a native approach that will get you to have similar output as actual HTML JavaScript plugins such as MathJax and KaTeX. This being said, there is a Quarto extension to render any Typst content to any formats as images: |
Beta Was this translation helpful? Give feedback.
-
|
@Guest-1013 I am curious of your suggestion. How do you envision being able to use typst for equation ? You would like to write typst syntax (https://typst.app/docs/reference/math/) because KaTeX syntax is not enough ? I don't know the full difference. If your output in HTML then you need in all case a render to HTML. KaTeX and Mathjax are such tool. Maybe something could become possible considering Typst experimental HTML export (https://typst.app/docs/reference/html/) but they do not yet handle Math element (typst/typst#5512) So using a tool like quarto-typst-render above seems to be the best solution today. It uses images like some other html math method like webtex. Also for context, all html math method in quarto as of today are inherited from pandoc supports: https://pandoc.org/MANUAL.html#math-rendering-in-html Thanks. |
Beta Was this translation helpful? Give feedback.
No there isn't a native approach that will get you to have similar output as actual HTML JavaScript plugins such as MathJax and KaTeX.
This being said, there is a Quarto extension to render any Typst content to any formats as images: