This project is an attempt to build an implementation of TeX in Rust. The overall goals of this project are:
- Be a complete TeX implementation (see more info about the goals for a detailed discussion of what this means)
- Personally, to learn more intrinsically how TeX works by reading the TeXbook and trying things instead of by just reading the TeX source
- Allow for better debugging of TeX (especially w.r.t. macro expansion) to provide helpful information for other TeX-like projects like KaTeX.
Currently, XymosTeX has reached the point where is it Turing complete (that is, it implements things like macro expansion, conditionals, assignments), can interpret basic horizontal and vertical boxes, and can generate a DVI file with the result.
The next body of work will be parsing math expressions, performing paragraph breaking, and performing page breaking.
Because XymosTeX is under development, the best way to try it is to clone the repo and build it from in there.
XymosTeX produces DVI files as output, so something like dvipdf from another TeX system is needed to actually view the result.
$ git clone https://github.com/xymostech/XymosTeX.git
$ cd XymosTeX
$ cargo run
\def\hello #1{Hello, #1!}
\hello{World}
\end
$ dvipdf texput.dvi
$ open texput.pdf
The most fun and impressive thing that XymosTeX can do is calculate primes for you:
$ cargo run --release < examples/primes.tex
$ dvipdf texput.dvi
$ open texput.pdf
I'm not currently taking feature contributions to XymosTeX since the goal is really for me to learn how TeX works for myself. However, since I am a Rust newbie, I am welcome to feedback about my Rust style and any suggestions about how to improve the code or repo structure.
XymosTeX is licensed under the MIT License