Change Latex font in Makie

Hi all,

Is there a way to change the font Makie uses when you want to typeset labels (etc…) in Latex? See here for a MWE:

using CairoMakie, LaTeXStrings

fontpath = joinpath(pwd(), "fonts", "tex-gyre", "texgyreheros-bold.otf") # path to some font

fig = Figure(font = fontpath, fontsize = 24, resolution = (1024, 768));
ax = Axis(fig[1, 1], xlabel = L"\Delta_rG \frac{kJ}{mol}", ylabel = "Concentration [mM]");
scatter!(ax, rand(10), rand(10))

This generates the figure, shown below, with the mismatched fonts. Is it possible to change the default Latex font (on the x-axis) to match the y-axis font?

Unfortunately, it is not yet possible.

Makie can render LaTeX strings from the LaTeXStrings.jl package using MathTeXEngine.jl.

—— LaTeX

Currently the only font set supported is Computer Modern.

—— Kolaru/MathTeXEngine.jl: A latex math mode engine in pure Julia.

1 Like

Cool, thanks for letting me know :slight_smile: