Hello. First post on this forum so I apologize if I fall short of the conventions.
I can’t get L strings to work with Makie on Jupyter Notebook. I just installed Makie, CairoMakie and MakieTeX. I couldn’t get my own examples to work, so I just copied one of the examples from the tutorial, which also doesn’t work:
First, if I just do as quoted in the code (see below), I get the error: LoadError: UndefVarError: @L_str not defined in expression starting at In[3]:6
using Makie, MakieTeX
using CairoMakie
fig = Figure()
l1 = Label(
fig[1, 1], L"A \emph{convex} function $f \in C$ is \textcolor{blue}{denoted} as \tikz{\draw[line width=1pt, >->] (0, -2pt) arc (-180:0:8pt);}";
tellwidth = false, tellheight = true
)
ax1 = Axis(
fig[2, 1];
xtickformat = x -> latexstring.("a_{" .* string.(x) .* "}"),
ytickformat = x -> latexstring.(string.(x)),
ylabel = L"\displaystyle \Phi(\vec x) = f(\vec x) + g(V)",
)
heatmap!(ax1, Makie.peaks())
fig
If I use LaTexStrings, the error goes away, but the L strings don’t seem to work:
using Makie, MakieTeX
using CairoMakie, LaTeXStrings
fig = Figure()
l1 = Label(
fig[1, 1], L"A \emph{convex} function $f \in C$ is \textcolor{blue}{denoted} as \tikz{\draw[line width=1pt, >->] (0, -2pt) arc (-180:0:8pt);}";
tellwidth = false, tellheight = true
)
ax1 = Axis(
fig[2, 1];
xtickformat = x -> latexstring.("a_{" .* string.(x) .* "}"),
ytickformat = x -> latexstring.(string.(x)),
ylabel = L"\displaystyle \Phi(\vec x) = f(\vec x) + g(V)",
)
heatmap!(ax1, Makie.peaks())
fig
Thanks a lot for any help.