Kolaru / MathTeXEngine.jl

A latex math mode engine in pure Julia.
MIT License
97 stars 19 forks source link

Add the TeXGyreHeros font as one of the default and a hack to use it #123

Closed Kolaru closed 1 month ago

Kolaru commented 1 month ago

This PR add (a quite terrible) support TeXGyreHeros for font (Makie's default, a sans serif font).

The font family can be used as generate_tex_elements(latex_string, FontFamily("TeXGyreHeros")).

Alternatively, to avoid intermediates, the command \fontfamily{TeXGyreHeros} can be used in the latex string itself, e.g. L"\fontfamily{TeXGyreHeros}$p_z$ (a. u.).

Most layouting is quite bad overall, but should be good enough for indices and superscripts.

Example:

image

To support other font, a FontFamily needs to be provided, that is composed of 5 fonts (regular, bold, italic, bolditalic, and math).