Kolaru / MathTeXEngine.jl

A latex math mode engine in pure Julia.
MIT License
96 stars 20 forks source link

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

Closed Kolaru closed 3 months ago

Kolaru commented 3 months 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).