Skip to content

Add support for Typst math syntax #3371

Open
@MysteryMulberry

Description

@MysteryMulberry

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions