Latex strings not working with makie

I’m trying to plot some graphs using CairoMakie.jl that contains latex strings. But it doesn’t work as intended. it renders the same string but with a $ before and after. Here is an example from Makie documentation. Any Ideas why is that so?

using CairoMakie

f = Figure(fontsize = 18)

Axis(f[1, 1],
    title = L"\frac{x + y}{\sin(k^2)}",
    xlabel = L"\sum_a^b{xy}",
    ylabel = L"\sqrt{\frac{a}{b}}"
)

f

Could you post the versions of CairoMakie and Makie you’re using? It could be that you’re on an old version.

Also, note that you have to supply the latex string at the time you’re creating the axis or label - updating it later will lead to the effect you have described.

I made sure to update both to the latest versions

(@v1.7) pkg> status CairoMakie Makie
      Status `~/.julia/environments/v1.7/Project.toml`
  [13f3f980] CairoMakie v0.7.5
  [ee78f7c6] Makie v0.16.6

Those are not the latest versions, you can always see those by going to makie.juliaplots.org/stable and looking at the very bottom what versions the docs we’re built with. Or check the versions in the github repository directly.

that was the problem, thanks. I updated the packages to the latest versions and it’s working fine now.

Got another problem, any reason why the arrows are rendered like that as empty boxes?

the yticks vector:

6-element Vector{LaTeXString}:
 L"$H+O_2 \longrightarrow O+OH$"
 L"$O+H_2 \longrightarrow H+OH$"
 L"$OH+H_2 \longrightarrow H+H_2O$"
 L"$O+H_2O \longrightarrow OH+OH$"
 L"$HO_2+H \longrightarrow H_2+O_2$"
 L"$HO_2+H \longrightarrow OH+OH$"

That usually means that they haven’t been correctly mapped in MathTeXEngine or the computer modern font doesn’t have them. Maybe open an issue in MathTeXEngine.jl?