Hi there!
I have been struggling for the last hour with the following issue.
I want to have a word in small caps within my legend in a CairoMakie plot.
To get a word in small caps in Latex I just do \textsc{Foo}.
Here is what I have done in Julia
using CairoMakie, LaTeXStrings
set_theme!(theme_latexfonts())
fig = Figure()
ax = Axis(fig[1, 1])
lines!(1:5, label=L"\textbf{Foo}")
lines!(1:2:5, label=L"\textsc{Foo}")
axislegend(position=:lt)
EDIT: now the whole error.
This gives me the following error:
Failed to resolve arg1:
[ComputeEdge] arg1 = compute_identity((linesgments_shifted, ), changed, cached)
@ /Users/markuspirke/.julia/packages/ComputePipeline/03tW7/src/ComputePipeline.jl:737
[ComputeEdge] linesgments_shifted = (::MapFunctionWrapper(#2928))((linesegments, lineindices, preprojection, model_f32c, positions_transformed_f32c, model_clip_planes, space, ), changed, cached)
@ unknown method location
[ComputeEdge] glyphcollections, glyphindices, font_per_char, glyph_origins, glyph_extents, text_blocks, text_color, text_rotation, text_scales, text_strokewidth, text_strokecolor, linesegments, linewidths, linecolors, lineindices = #2906((input_text, fontsize, selected_font, align, rotation, justification, lineheight, word_wrap_width, offset, fonts, computed_color, strokecolor, strokewidth, ), changed, cached)
@ /Users/markuspirke/.julia/packages/Makie/4JW9B/src/basic_recipes/text.jl:333
with edge inputs:
input_text = LaTeXStrings.LaTeXString[L"$\textsc{Foo}$"]
fontsize = 14.0f0
selected_font = FTFont (family = NewComputerModern Math, style = Regular)
align = (:center, :center)
rotation = 1.0 + 0.0im + 0.0jm + 0.0km
justification = :left
lineheight = 1.0f0
word_wrap_width = -1.0f0
offset = Float32[0.0, 0.0, 0.0]
fonts = Attributes()
computed_color = RGBA{Float32}(0.0, 0.0, 0.0, 1.0)
strokecolor = RGBA{Float32}(0.0, 0.0, 0.0, 0.0)
strokewidth = 0.0f0
Triggered by update of:
position, text, arg1, fontsize, fonts, font, align, rotation, justification, lineheight, word_wrap_width, offset, fonts, color, colorscale, alpha, colorrange, colorscale, color, colorscale, alpha, colormap, alpha, nan_color, lowclip, colormap, alpha, highclip, colormap, alpha, colormap, alpha, strokecolor or strokewidth
Due to ERROR: TeXParseError: unexpected error
at position 2 (string index 2)
$\textsc{Foo}$
^
Stack
[4] TeXExpr :command
└─ "\\textsc"
[3] TeXExpr :inline_math
[2] TeXExpr :line
[1] TeXExpr :lines
Failed to show error:
UndefVarError: `tex` not defined in `MathTeXEngine`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
[1] showerror(io::IOContext{IOBuffer}, e::MathTeXEngine.TeXParseError)
@ MathTeXEngine ~/.julia/packages/MathTeXEngine/dUSrK/src/parser/parser.jl:11
[2] showerror
If I only use \textbf{Foo} it works perfectly fine.
Any ideas how to solve this issues? Or what the problem is?
