Add support for Typst math syntax
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.9k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Is your feature request related to a problem? Please describe.
Typst is an emerging typesetting system with a clean and intuitive math syntax, designed to be easier to learn and use than LaTeX—especially effective in educational and note-taking scenarios (e.g. I personally use Typst to organize my college course notes).
However, MathJax currently only supports LaTeX, MathML, and AsciiMath, and cannot directly render mathematical formulas written in Typst syntax. This prevents Typst users from seamlessly integrating MathJax’s high-quality rendering capabilities.
Describe the solution you'd like
We hope MathJax could:
1. Provide native support for Typst math syntax by adding it to the default suite of supported input formats;
2. Or offer a pluggable Typst input parser plugin that users can load via configuration, without modifying core code.
Describe alternatives you've considered
-
Currently, third-party tools (e.g. xmmath) are used to convert Typst syntax to LaTeX or MathML before rendering with MathJax, but this introduces extra conversion steps and compatibility issues;
-
Using Typst’s built-in rendering engine lacks MathJax’s advantages in cross-browser compatibility, accessibility features (e.g., screen reader support), etc.
Additional context
1. Typst math syntax documentation:
https://typst.app/docs/reference/math/
Its syntax emphasizes readability (e.g. alignment syntax \align , piecewise function \cases , etc.). While advanced features like variable definitions and expression interpolation may exceed MathJax’s core scope, the need for rendering basic mathematical symbols is clear.
2. Potential technical references:
- The xmmath repository attempts to implement Typst-to-MathML conversion (though the code readability is limited), which could serve as a starting point for developing an input parser;
- Code related to math parsing in Typst’s official repository may offer design insights (though its rendering pipeline differs significantly from browser environments).
3. Community value:
Typst’s user base is growing rapidly, driven by its clean syntax and modern design—particularly in academic and educational fields. Supporting Typst would expand MathJax’s use cases and attract more users to adopt web-native math rendering solutions.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Typst math syntax documentation and compare its basic constructs with MathJax’s existing input formats. Review xmmath and Typst’s official math-parsing code for implementation approaches. Done means a defined basic Typst syntax scope is rendered accessibly in MathJax, either through core support or a configurable plugin.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, latex
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100