In VS Code, I use Tinymist to export a .typ document to an HTML file. I noticed that the MathML formulas in the exported HTML use special Unicode characters, such as βπΆ, π, π₯β, instead of the regular βC, X, xβ.
What causes this, and how can I fix it?
When Tinymist exports a .typ document to HTML, does it support exporting math formulas directly to LaTeX codes as Ascii math format or tex format?
backo
August 24, 2026, 5:40pm
2
Typst uses MathML for equations. I have experienced this issue too. Itβs weird because replacing the characters manually doesnβt change anything in the rendered result.
This made me think of KaTeX. They use MathML for accessibility and HTML/CSS for visual rendering . Typst HTML export would be a great alternative to KaTeX.
backo
August 26, 2026, 12:42am
3
Iβve just created an issue:
opened 12:39AM - 26 Aug 26 UTC
bug
### Summary
When exporting a Typst document to HTML, the resulting MathML for e⦠quations use the special Mathematical Alphanumeric Symbols block of Unicode for **math variables** instead of normal ASCII characters, but this is unnecessary.
### Description
For example, compile the following Typst document to HTML:
```typ
$
f(x) = A + B + C
$
```
The resulting HTML is the following
```html
<math display="block">
<mi>π</mi>
<mrow>
<mo>(</mo>
<mi>π₯</mi>
<mo>)</mo>
</mrow>
<mo>=</mo>
<mi>π΄</mi>
<mo>+</mo>
<mi>π΅</mi>
<mo>+</mo>
<mi>πΆ</mi>
</math>
```
Notice how we got π, π₯, π΄, π΅ and πΆ instead of `f`, `x`, `a`, `b` and `c`.
<img width="696" height="155" alt="Image" src="https://github.com/user-attachments/assets/6006290c-d578-4158-8257-da071ef440e5" />
If one selects the equation and copies the text, those math characters are copied instead of the normal ASCII characters, which is a bit ugly.
This conversion is unnecessary, as using normal ASCII characters produces the same result:
> By default <mi> elements that contain multiple characters are a rendered as normal text, while single character characters are rendered as italic
https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mi
For comparison, this doesn't happen with [KaTeX](https://katex.org/).
### Solution
If I'm not mistaken, this is because Typst internally does this conversion for all exports, not just HTML. Either an exception should be made for HTML or the Unicode characters should be converted back.
### Forum
This issue was brought up in the forum: https://forum.typst.app/t/can-i-avoid-special-unicode-characters-such-as-instead-of-the-regular-c-x-x-in-mathml-when-exporting-to-html/9735/2
### Operating system
Linux
### Typst version
- [x] I am using the latest version of Typst
Letβs see if itβs fixed!