text

Text and LaTeX, rendered as packed batches of bezier glyphs.

Tex compiles LaTeX through Algan’s bundled Manim, converts the resulting glyph outlines to cubic bezier circuits, and packs every glyph of the string into a single batched Mob. Text is the same machinery with Pango font rendering instead of LaTeX, and MarkupText accepts Pango markup.

Because the glyphs are outlines rather than bitmaps, text scales without softening and morphs into other shapes like any 2-D Mob.

character_mobs gives lazy indexed views onto individual glyphs in the packed batch, which is what per-character animation works on. A multi-part Tex also exposes each of its source strings through Tex.get_segment() – these are views, not children, which hold the single packed batch. Tex.write() draws the string as though by hand.

The Triangulated variants build filled triangle meshes instead of bezier circuits, for cases where a fragment-shaded interior is wanted.

make_manim_dir() prepares Manim’s Tex/text scratch directories inside Algan’s cache so nothing is written beside the user’s script.

See Text and Mathematics.

Classes

Code

Source-code display with Manim 0.20.1 constructor names.

MarkupText

Plain text from a Pango-markup source, with the markup stripped out.

Paragraph

A group of individually addressable text lines.

Tex

LaTeX compiled to one packed batch of cubic bezier glyphs.

TexTriangulated

LaTeX text rendered as one packed batch of triangulated glyphs.

Text

Plain (non-LaTeX) text, rendered as one packed batch of cubic bezier glyphs.

TextTriangulated

Triangulated plain text; accepts the same arguments as Text.

Functions

make_manim_dir()[source]

Create manim’s tex/text output directories if they don’t exist yet.

Touching mn.config loads manim, and with it algan.utils.manim_svg_cache. The paths are resolved again here so a runtime change to SETTINGS.paths.cache_directory is honored and Manim never creates its default media tree beside the user’s script.

Called lazily on first Tex construction (manim errors if they are missing) rather than at import algan time, so importing the package doesn’t write to disk.