I’ve been working on (another) pure-Julia LaTeX typesetting package TeXLayout.jl that is focused on rendering nice mathematics in Makie.jl (mostly CairoMakie.jl) for various diagramming needs that I have (lecture notes…).
One example of the sort of things it can do is:
Note I’ve only just tagged this version (v0.2), so it might take a little while to propagate through the package server.
Key features are:
- Any OpenType Math font can be used; the placement metrics are taken from the MATH table in the font. In principle, this means that quite a wide range of fonts are available, though your mileage may vary since some math fonts are better than others. (Above is an example of the Luciole font.)
- Mixed text / maths is supported. I’m predominantly targeting maths support, but there is basic text as well (nothing that requires iterative layouts though, so no automatic line breaking or things like that). This means you can use multi-line equations embedded in text, or inline mathematics. (I’ve designed it so I can include HarfBuzz-based typography later as an optional extension, but I haven’t got that far yet.)
- Good coverage of LaTeX mathematics. There is always more to add, but I think I’ve got most things that people will use.
- I’ve paid a bit of attention to performance. Whilst plotting diagrams isn’t usually a time critical thing, I don’t like wasting CPU cycles unnecessarily.
There are a few alternative packages available, just to highlight some differences:
- MathTeXEngine.jl is also pure Julia and is much more battle tested. However, it is more limited on the fonts available (placement metrics are hardcoded). It doesn’t handle matrices and is generally a bit more limited on the mathematics. It also doesn’t handle general text / multi-line equations.
- MakieTeX.jl is a wrapper around a LaTeX installation. It is much more versatile in terms of the LaTeX it can handle since it uses LaTeX directly, but it’s a much heavier solution.
At the moment, the Makie integration relies on some type piracy; hopefully a solution will be available in the future to mean that isn’t needed.
Comments / questions / issues all welcome.
