Using Typst instead of LaTeX in Tex and TexText#2450
Open
Varniex wants to merge 5 commits into3b1b:masterfrom
Open
Using Typst instead of LaTeX in Tex and TexText#2450Varniex wants to merge 5 commits into3b1b:masterfrom
Tex and TexText#2450Varniex wants to merge 5 commits into3b1b:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (with LaTeX like equation format), it doesn't need different compilers (and/or packages) for different fonts and other features.
Proposed changes
tex_mobject.py,tex_file_writing.pyandtex_to_symbol_count.pyto adapt Typst related equation stringsspecial_tex.py) to accept Typst like equations.example_scenes.pyTest
To test this version:
Install Typst CLI for your device.
Use
Tex(orTexText) as before but with Typst style (likeintegralinstead of\int).To set a different font, you can add these lines in the
templates.ymlor give as theadditional_preambleparameter:#set text(font: <font_name>)#show math.equation: set text(font: <math_font_name>)Some things to apply to keep indexing correct:
frac(num, denom)instead ofnum / denom^) before subscript (_). For eg:integral^infinity_0 e^(-x^2) d xFor e.g: