CairoMakie.jl, MathTeXEngine.jl, Small Caps

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)

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 = 20.0f0

    selected_font = FTFont (family = NewComputerModern Math, style = Regular)

If I only use \textbf{Foo} it works perfectly fine.

Any ideas how to solve this issues? Or what the problem is?

1 Like