Easily render mathematical equations and code blocks.
Prepare a Typst File
Create a .txt
or .typ
file and write your Typst code in it. For more on Typst, check out https://github.com/typst/typst.
Example Typst "hello.txt" code:
#set page(width: auto, height: auto, margin: 0cm, fill: none)
#set text(size: 20pt)
$ sum_(k=1)^n k = (n(n+1)) / 2 $
.txt
file directly into Blender.It's also possible to import via the Python API:
from typst_importer.typst_to_svg import typst_express
typst_express("$ a = b/c $")
content = "$ limits(integral)_a^b f(x) dif x $"
typst_express(content, name="Integral Example")
typst_express("""
#let korange() = text(fill: orange)[$k$]
#let nblue() = text(fill: blue)[$n$]
$ sum_(#korange() = 1)^#nblue() #korange() = (nblue()(nblue()+1)) / 2 $
""")
Change blend_method for transparency. "Dithered" looks more grany, and the new default "Blended" looks smoother.
update to typst 0.13.1
Added object indices support with blue numbered labels.
from typst_importer.typst_to_svg import typst_express
content = "$ a = b + c $"
c = typst_express(content, origin_to_char=True, show_indices=True,
position=(0, 2, 0), name="Simple")
content = "$ limits(integral)_a^b f(x) dif x $"
c = typst_express(content, origin_to_char=True, show_indices=True,
name="Integral")
This extension requests the following permission:
Importing data files from disk