1 unstable release
| 0.0.1 | Jul 22, 2023 |
|---|
#49 in #tex
315KB
5.5K
SLoC
Work In Progress
An implementation of a generic TeX engine, the core of the TeX typesetting system. This crate largely follows an object-oriented design for modularity and adaptability, with functionality largely implemented in generic traits. This lets the compiler optimize the code for the specific types used, while still allowing for easy customization.
lib.rs:
Work In Progress
An implementation of a generic TeX engine, the core of the TeX typesetting system. This crate largely follows an object-oriented design for modularity and adaptability, with functionality largely implemented in generic traits. This lets the compiler optimize the code for the specific types used, while still allowing for easy customization.
A specific Engine combines:
- a
Mouththat providesTokens to process - a
Gulletthat expands macros and returns primitives (StomachCommands), - a
Statethat keeps track of the current state of the engine, e.g. the currentCategoryCodeScheme, and allows for pushing/popping the stack, - a
Stomachthat processes theStomachCommands and returnsTeXBoxes.
Almost all algorithms, too, are generic over implementations of these traits.
The default Engine for plain TeX/LaTeX can be found
in PlainTeXEngine.
Dependencies
~4–10MB
~108K SLoC