Skip to content

Added Typst equivalents of TeX and TexText files.#2421

Open
Varniex wants to merge 9 commits into3b1b:masterfrom
Varniex:master
Open

Added Typst equivalents of TeX and TexText files.#2421
Varniex wants to merge 9 commits into3b1b:masterfrom
Varniex:master

Conversation

@Varniex
Copy link
Contributor

@Varniex Varniex commented Feb 9, 2026

Motivation

Using Typst is cleaner, faster, more flexible and less complex than using standard $LaTeX$ (like MikTex) for equations. Besides the fact that Typst is similar to Markdown, it doesn't need different compilers (and/or packages) for different fonts and other features.

Proposed changes

  • Added a separate file typst_tex_mobject.py where the classes are implemented.
  • Added typst template in tex_templates.yml

Test

To test this version:

  • Install Typst CLI for your device.
  • Change the default tex template setting to typst in default_config.yml (or custom_config.yml).
  • Use TypstTex (or TypstTexText).

For e.g:

from manimlib import *
from manimlib.mobject.svg.typst_tex_mobject import TypstTex, TypstTexText


class EquationScene(Scene):
    def construct(self):
        equation = TypstTex("E = m c^2")
        self.add(equation)

        text = TypstTexText("Hello, World!")
        self.add(text)

Hi @3b1b, if you find this helpful as well, the functions can be moved to utils/tex_file_writing.py file.

@3b1b
Copy link
Owner

3b1b commented Feb 10, 2026

Thanks for the update. This looks intriguing, I'll take a deeper look later this week.

@Varniex
Copy link
Contributor Author

Varniex commented Feb 11, 2026

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants