# Calligraphic LaTeX fonts in Makie

**URL:** <https://discourse.julialang.org/t/calligraphic-latex-fonts-in-makie/101209>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [July 5, 2023, 12:39pm UTC](https://discourse.julialang.org/t/calligraphic-latex-fonts-in-makie/101209 "2023-07-05T12:39:58Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pablo\_Marchant](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pablo_marchant/32/32828_2.png) [@Pablo\_Marchant](https://discourse.julialang.org/u/Pablo_Marchant)\
**Post date:** [July 5, 2023, 12:39pm UTC](https://discourse.julialang.org/t/calligraphic-latex-fonts-in-makie/101209/1 "2023-07-05T12:39:58Z")

</div>

Hi all,

I’ve run into a small problem regarding mismatch of LaTeX fonts between Makie and the LaTeX documents where I am placing such figures. This is really a problem with the calligraphic fonts that are used in math mode. Below is a simple example:

```julia
using CairoMakie, LaTeXStrings

f = Figure()
ax = Axis(f[1,1], title=L"\mathcal{ABCDEFGHIJKLMOPQRSTUVWXYZ}", titlesize=30)
save("makie_mathcal.png", f)
f

```

 ![makie_mathcal](https://global.discourse-cdn.com/julialang/original/3X/8/d/8d88d732e3a4176c2dc620a19b64d77982e81e17.png)

The LaTeX calligraphic fonts I am used to look like the ones that are rendered in a jupyter notebook by constructing that same LaTeXString, as shown below

 ![mathcal](https://global.discourse-cdn.com/julialang/original/3X/d/0/d024ab9bda23c04e830b0f7e4d69a9e1693367e3.png)

My main concern is in regards to a single one of these letters, \mathcal{M}. This is a common symbol in my field, and not being able to render it as expected is the single annoyance I have while switching all my plotting from python to julia+Makie. After digging a lot I have not been able to find any workaround for this. Is there any possibility to adjust this? Barring other options I would just post-process all pdfs to use the symbol I want, but that is very cumbersome if I need to produce small modifications to figures.

For reference, I’m using julia 1.9.0 with the following package versions:  
[13f3f980] CairoMakie v0.10.6  
[b964fa9f] LaTeXStrings v1.3.0  
[91a5bcdd] Plots v1.38.16

---

<div class="post-metadata">

**Author:** ![Pablo\_Marchant](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pablo_marchant/32/32828_2.png) [@Pablo\_Marchant](https://discourse.julialang.org/u/Pablo_Marchant)\
**Post date:** [July 5, 2023, 12:42pm UTC](https://discourse.julialang.org/t/calligraphic-latex-fonts-in-makie/101209/2 "2023-07-05T12:42:20Z")

</div>

And one small extra detail, I get the same calligraphic fonts if I do this with Plots.jl

```julia
using Plots, LaTeXStrings

x = range(0, 10, length=100)
y = sin.(x)
Plots.plot(x, y)
title!(L"\mathcal{ABCDEFGHIJKLMOPQRSTUVWXYZ}")
savefig("plots_mathcal.png")

```

![plots_mathcal](https://global.discourse-cdn.com/julialang/original/3X/6/5/6580195e7c9b9448b8c4706383c17f502389505a.png)

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [July 6, 2023, 7:44am UTC](https://discourse.julialang.org/t/calligraphic-latex-fonts-in-makie/101209/3 "2023-07-06T07:44:54Z")

</div>

I’m not sure I can help you very much, but here are my thoughts:

The MathTeXEngine.jl (via Makie) uses NewComputer Modern (NewCMMath-Regular):

```plaintext
julia> using MathTeXEngine
julia-1.9> generate_tex_elements(L"\scrM")
1-element Vector{Any}:
 (TeXChar 'ℳ' [index 694 in NewComputerModern Math - Regular], [0.0, 0.0], 1.0)

```

for U+2133.

In CMUSerif-Roman (which I think Plots.jl/GR uses), this glyph is also stored at U+2133. I think CMUSerif and NewComputerModern are basically the same, at least in this area.

 ![Screenshot 2023-07-06 at 08.28.09](https://global.discourse-cdn.com/julialang/original/3X/f/e/fea80f3eea79256ad6d57c72c8cd5cd96d618c4f.png)

In ComputerModern (`cmr10`?), this Unicode point doesn’t exist, so I think the symbol is found in `cmsy10.ttf`, and presumably \LaTeX knows to look there…

 ![Screenshot 2023-07-06 at 08.32.25](https://global.discourse-cdn.com/julialang/original/3X/0/a/0a9d2b3af1a7a6dde98914c45a5ca02dedf87ce0.png)

So I think the solutions are:

- use the same font(s) in both your Julia packages and your \LaTeX packages

- open issues for the Julia packages to allow a way of accessing alternate fonts for a specific \LaTeX character

---

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [July 6, 2023, 8:59am UTC](https://discourse.julialang.org/t/calligraphic-latex-fonts-in-makie/101209/4 "2023-07-06T08:59:28Z")

</div>

> [@Pablo\_Marchant](#):
>
> Makie

The Makie [docs](https://docs.makie.org/stable/documentation/latex/) say:

> Makie can render LaTeX strings from the LaTeXStrings.jl package using [MathTeXEngine.jl](https://github.com/Kolaru/MathTeXEngine.jl/).

The README.md of the latter package says:

> Currently the only font set supported is Computer Modern.

I guess that if you’re including plots in a LaTeX document, the best approach would be to use [PGFPlotsX](https://kristofferc.github.io/PGFPlotsX.jl/stable/), so that you could include actual TeX code into the document seamlessly and have a complete TeX engine and LaTeX implementation at your disposal.

---

<div class="post-metadata">

**Author:** ![Pablo\_Marchant](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pablo_marchant/32/32828_2.png) [@Pablo\_Marchant](https://discourse.julialang.org/u/Pablo_Marchant)\
**Post date:** [July 6, 2023, 5:05pm UTC](https://discourse.julialang.org/t/calligraphic-latex-fonts-in-makie/101209/5 "2023-07-06T17:05:21Z")

</div>

Thanks for the info! Sounds like I will just need to live with this one. I knew MathTeXEngine states in their README that they’re limited to Computer Modern, but thought the calligraphic M symbol I wanted was contained in there. Here I’m a bit confused on the status of MathTeXEngine.jl. The git history on the README says they [swapped to ComputerModern from NewComputerModern about two years ago](https://github.com/Kolaru/MathTeXEngine.jl/commit/8dbd3c7cbf5845a1b444ab7f5a99980da062a61b), but on the current version `generate_tex_elements` produces results using NewComputerModern. Perhaps things were swapped back and the readme file is outdated right now.

@nsajko, being that this is my single remaining issue while creating plots with Makie and I’ve gotten quite used to it, switching to PGFPlotsX would not make much sense. I will probably need to live with a small inconsistency regarding this symbol.

---

<div class="post-metadata">

**Author:** ![xzackli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xzackli/32/38301_2.png) [@xzackli](https://discourse.julialang.org/u/xzackli)\
**Post date:** [July 6, 2023, 5:47pm UTC](https://discourse.julialang.org/t/calligraphic-latex-fonts-in-makie/101209/6 "2023-07-06T17:47:37Z")

</div>

I also find LaTeX fonts to be a pain point for using Makie. There is [MakieTex](https://github.com/JuliaPlots/MakieTeX.jl) which I’ve been meaning to take a look at. In principle, you could just render any label?

---

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [July 6, 2023, 10:27pm UTC](https://discourse.julialang.org/t/calligraphic-latex-fonts-in-makie/101209/7 "2023-07-06T22:27:15Z")

</div>

> [@Pablo\_Marchant](#):
>
> but thought the calligraphic M symbol I wanted was contained in there

Maybe this is just a bug? Perhaps it could be worth it to report it, if it’s easily fixable.

---

<div class="post-metadata">

**Author:** ![ederag](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ederag/32/4106_2.png) [@ederag](https://discourse.julialang.org/u/ederag)\
**Post date:** [July 8, 2023, 8:07am UTC](https://discourse.julialang.org/t/calligraphic-latex-fonts-in-makie/101209/8 "2023-07-08T08:07:06Z")

</div>

`MakieTeX` used to be wonderful (`MathTeXEngine` is faster but younger ~~thus~~ and more limited),  
especially for 2D figures where speed does not matter,  
and would be the perfect workaround here.  
But I just tested it with

```julia
  [13f3f980] CairoMakie v0.10.6
  [ee78f7c6] Makie v0.19.6
  [6d554a22] MakieTeX v0.3.1

```

and it is still broken

> <https://github.com/JuliaPlots/MakieTeX.jl/issues/39>
>
> It looks like MathTeXEngine is used instead of MakieTeX,
> in recent Makie versio…ns (visible in the summary head), and julia-1.7.3.
> 
> It happens both with code that used to work about a month ago, and with the README.md example:
> 
> \<details\>
> \<summary\>REPL session\</summary\>
> 
> \`\`\`
> julia
> pkg\> activate --temp
> (jl\_F8E2SV) pkg\> add Makie
> \[ee78f7c6\] + Makie v0.17.8
> (jl\_F8E2SV) pkg\> add MakieTeX
> \[6d554a22\] + MakieTeX v0.2.3
> (jl\_F8E2SV) pkg\> add CairoMakie
> \[13f3f980\] + CairoMakie v0.8.8
> 
> julia\> using Makie, MakieTeX
> julia\> using CairoMakie # or whichever other backend
> julia\> fig = Figure()
> julia\> 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
> )
> julia\> 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)",
> )
> ERROR: TeXParseError: unexpected error while parsing
> at position 14 (string index 14)
> \\displaystyle \\Phi(\\vec x) = f(\\vec x) + g(V)
> ^
> Stack before
> \[1\] TeXExpr :expr
> 
> 
> Stacktrace:
> \[1\] texparse(data::String; showdebug::Bool)
> @ MathTeXEngine ~/.julia/packages/MathTeXEngine/rSv9C/src/parser/parser.jl:285
> \[2\] texparse
> @ ~/.julia/packages/MathTeXEngine/rSv9C/src/parser/parser.jl:271 \[inlined\]
> \[3\] \_broadcast\_getindex\_evalf
> @ ./broadcast.jl:670 \[inlined\]
> \[4\] \_broadcast\_getindex
> @ ./broadcast.jl:643 \[inlined\]
> \[5\] \_getindex
> @ ./broadcast.jl:666 \[inlined\]
> \[6\] \_broadcast\_getindex
> @ ./broadcast.jl:642 \[inlined\]
> \[7\] getindex
> @ ./broadcast.jl:597 \[inlined\]
> \[8\] copy
> @ ./broadcast.jl:899 \[inlined\]
> \[9\] materialize
> @ ./broadcast.jl:860 \[inlined\]
> \[10\] generate\_tex\_elements(str::LaTeXString, font\_family::MathTeXEngine.FontFamily)
> @ MathTeXEngine ~/.julia/packages/MathTeXEngine/rSv9C/src/engine/layout.jl:304
> \[11\] generate\_tex\_elements
> @ ~/.julia/packages/MathTeXEngine/rSv9C/src/engine/layout.jl:298 \[inlined\]
> \[12\] texelems\_and\_glyph\_collection(str::LaTeXString, fontscale\_px::Float32, halign::Symbol, valign::Symbol, rotation::Quaternionf, color::ColorTypes.RGBA{Float32}, strokecolor::ColorTypes.RGBA{Float32}, strokewidth::Int64, word\_wrap\_width::Int64)
> @ Makie ~/.julia/packages/Makie/bwZTV/src/basic\_recipes/text.jl:156
> \[13\] \_get\_glyphcollection\_and\_linesegments(latexstring::LaTeXString, index::Int64, ts::Float32, f::FreeTypeAbstraction.FTFont, al::Tuple{Symbol, Symbol}, rot::Quaternionf, jus::MakieCore.Automatic, lh::Float64, col::ColorTypes.RGBA{Float32}, scol::ColorTypes.RGBA{Float32}, swi::Int64, www::Int64)
> @ Makie ~/.julia/packages/Makie/bwZTV/src/basic\_recipes/text.jl:73
> \[14\] #\_#83
> @ ./operators.jl:1085 \[inlined\]
> \[15\] ComposedFunction
> @ ./operators.jl:1085 \[inlined\]
> \[16\] macro expansion
> @ ~/.julia/packages/Makie/bwZTV/src/utilities/utilities.jl:199 \[inlined\]
> \[17\] broadcast\_foreach(::ComposedFunction{Makie.var"#push\_args#1801"{Vector{Int64}, Vector{ColorTypes.RGBA{Float32}}, Vector{Float32}, Vector{Point{2, Float32}}, Vector{Makie.GlyphCollection}}, typeof(Makie.\_get\_glyphcollection\_and\_linesegments)}, ::LaTeXString, ::UnitRange{Int64}, ::Float32, ::FreeTypeAbstraction.FTFont, ::Tuple{Symbol, Symbol}, ::Quaternionf, ::MakieCore.Automatic, ::Float64, ::ColorTypes.RGBA{Float32}, ::ColorTypes.RGBA{Float32}, ::Int64, ::Int64)
> @ Makie ~/.julia/packages/Makie/bwZTV/src/utilities/utilities.jl:185
> \[18\] (::Makie.var"#1797#1800"{Base.RefValue{Vector{Int64}}, Observable{Vector{ColorTypes.RGBA{Float32}}}, Observable{Vector{Float32}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Makie.GlyphCollection}}})(str::LaTeXString, ts::Float64, f::FreeTypeAbstraction.FTFont, al::Tuple{Symbol, Symbol}, rot::Float32, jus::MakieCore.Automatic, lh::Float64, col::ColorTypes.RGBA{Float32}, scol::Tuple{Symbol, Float64}, swi::Int64, www::Int64)
> @ Makie ~/.julia/packages/Makie/bwZTV/src/basic\_recipes/text.jl:34
> \[19\] (::Observables.var"#callback#13"{Makie.var"#1797#1800"{Base.RefValue{Vector{Int64}}, Observable{Vector{ColorTypes.RGBA{Float32}}}, Observable{Vector{Float32}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Makie.GlyphCollection}}}, NTuple{11, Observable{Any}}})(x::Any)
> @ Observables ~/.julia/packages/Observables/ynr7h/src/Observables.jl:339
> \[20\] #invokelatest#2
> @ ./essentials.jl:716 \[inlined\]
> \[21\] invokelatest
> @ ./essentials.jl:714 \[inlined\]
> \[22\] notify(observable::Observables.AbstractObservable)
> @ Observables ~/.julia/packages/Observables/ynr7h/src/Observables.jl:143
> \[23\] plot!(plot::MakieCore.Text{Tuple{Vector{Point{2, Float32}}}})
> @ Makie ~/.julia/packages/Makie/bwZTV/src/basic\_recipes/text.jl:53
> \[24\] plot!(scene::Scene, P::Type{MakieCore.Text{Tuple{Point{2, Float32}}}}, attributes::Attributes, input::Tuple{Observable{Point{2, Float32}}}, args::Observable{Tuple{Vector{Point{2, Float32}}}})
> @ Makie ~/.julia/packages/Makie/bwZTV/src/interfaces.jl:402
> \[25\] plot!(scene::Scene, P::Type{MakieCore.Text}, attributes::Attributes, args::Observable{Point{2, Float32}}; kw\_attributes::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
> @ Makie ~/.julia/packages/Makie/bwZTV/src/interfaces.jl:320
> \[26\] plot!
> @ ~/.julia/packages/Makie/bwZTV/src/interfaces.jl:288 \[inlined\]
> \[27\] #plot!#132
> @ ~/.julia/packages/Makie/bwZTV/src/interfaces.jl:271 \[inlined\]
> \[28\] text!(::Scene, ::Vararg{Any}; attributes::Base.Pairs{Symbol, Any, NTuple{9, Symbol}, NamedTuple{(:text, :textsize, :color, :visible, :align, :rotation, :font, :markerspace, :inspectable), Tuple{Observable{Any}, Observable{Any}, Observable{Any}, Observable{Any}, Observable{Tuple{Symbol, Symbol}}, Observable{Float32}, Observable{Any}, Symbol, Bool}}})
> @ MakieCore ~/.julia/packages/MakieCore/YlbA1/src/recipes.jl:38
> \[29\] Makie.LineAxis(parent::Scene, attrs::Attributes)
> @ Makie ~/.julia/packages/Makie/bwZTV/src/makielayout/lineaxis.jl:367
> \[30\] #LineAxis#1151
> @ ~/.julia/packages/Makie/bwZTV/src/makielayout/lineaxis.jl:3 \[inlined\]
> \[31\] initialize\_block!(ax::Axis; palette::Nothing)
> @ Makie ~/.julia/packages/Makie/bwZTV/src/makielayout/blocks/axis.jl:330
> \[32\] initialize\_block!
> @ ~/.julia/packages/Makie/bwZTV/src/makielayout/blocks/axis.jl:170 \[inlined\]
> \[33\] \_block(::Type{Axis}, ::Figure; bbox::Nothing, kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:xtickformat, :ytickformat, :ylabel), Tuple{var"#1#3", var"#2#4", LaTeXString}}})
> @ Makie ~/.julia/packages/Makie/bwZTV/src/makielayout/blocks.jl:393
> \[34\] \_block(::Type{Axis}, ::GridPosition; kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:xtickformat, :ytickformat, :ylabel), Tuple{var"#1#3", var"#2#4", LaTeXString}}})
> @ Makie ~/.julia/packages/Makie/bwZTV/src/makielayout/blocks.jl:284
> \[35\] #\_#999
> @ ~/.julia/packages/Makie/bwZTV/src/makielayout/blocks.jl:269 \[inlined\]
> \[36\] top-level scope
> @ REPL\[9\]:1
> 
> caused by: TeXParseError: unsupported command \\displaystyle
> at position 14 (string index 14)
> \\displaystyle \\Phi(\\vec x) = f(\\vec x) + g(V)
> ^
> Stack before
> \[1\] TeXExpr :expr
> 
> 
> Stacktrace:
> \[1\] \_end\_command\_builder!(stack::DataStructures.Stack{Any}, p::Int64, data::String)
> @ MathTeXEngine ~/.julia/packages/MathTeXEngine/rSv9C/src/parser/parser.jl:233
> \[2\] macro expansion
> @ ~/.julia/packages/MathTeXEngine/rSv9C/src/parser/parser.jl:256 \[inlined\]
> \[3\] macro expansion
> @ ~/.julia/packages/Automa/1KOLQ/src/codegen.jl:149 \[inlined\]
> \[4\] texparse(data::String; showdebug::Bool)
> @ MathTeXEngine ~/.julia/packages/MathTeXEngine/rSv9C/src/parser/parser.jl:283
> \[5\] texparse
> @ ~/.julia/packages/MathTeXEngine/rSv9C/src/parser/parser.jl:271 \[inlined\]
> \[6\] \_broadcast\_getindex\_evalf
> @ ./broadcast.jl:670 \[inlined\]
> \[7\] \_broadcast\_getindex
> @ ./broadcast.jl:643 \[inlined\]
> \[8\] \_getindex
> @ ./broadcast.jl:666 \[inlined\]
> \[9\] \_broadcast\_getindex
> @ ./broadcast.jl:642 \[inlined\]
> \[10\] getindex
> @ ./broadcast.jl:597 \[inlined\]
> \[11\] copy
> @ ./broadcast.jl:899 \[inlined\]
> \[12\] materialize
> @ ./broadcast.jl:860 \[inlined\]
> \[13\] generate\_tex\_elements(str::LaTeXString, font\_family::MathTeXEngine.FontFamily)
> @ MathTeXEngine ~/.julia/packages/MathTeXEngine/rSv9C/src/engine/layout.jl:304
> \[14\] generate\_tex\_elements
> @ ~/.julia/packages/MathTeXEngine/rSv9C/src/engine/layout.jl:298 \[inlined\]
> \[15\] texelems\_and\_glyph\_collection(str::LaTeXString, fontscale\_px::Float32, halign::Symbol, valign::Symbol, rotation::Quaternionf, color::ColorTypes.RGBA{Float32}, strokecolor::ColorTypes.RGBA{Float32}, strokewidth::Int64, word\_wrap\_width::Int64)
> @ Makie ~/.julia/packages/Makie/bwZTV/src/basic\_recipes/text.jl:156
> \[16\] \_get\_glyphcollection\_and\_linesegments(latexstring::LaTeXString, index::Int64, ts::Float32, f::FreeTypeAbstraction.FTFont, al::Tuple{Symbol, Symbol}, rot::Quaternionf, jus::MakieCore.Automatic, lh::Float64, col::ColorTypes.RGBA{Float32}, scol::ColorTypes.RGBA{Float32}, swi::Int64, www::Int64)
> @ Makie ~/.julia/packages/Makie/bwZTV/src/basic\_recipes/text.jl:73
> \[17\] #\_#83
> @ ./operators.jl:1085 \[inlined\]
> \[18\] ComposedFunction
> @ ./operators.jl:1085 \[inlined\]
> \[19\] macro expansion
> @ ~/.julia/packages/Makie/bwZTV/src/utilities/utilities.jl:199 \[inlined\]
> \[20\] broadcast\_foreach(::ComposedFunction{Makie.var"#push\_args#1801"{Vector{Int64}, Vector{ColorTypes.RGBA{Float32}}, Vector{Float32}, Vector{Point{2, Float32}}, Vector{Makie.GlyphCollection}}, typeof(Makie.\_get\_glyphcollection\_and\_linesegments)}, ::LaTeXString, ::UnitRange{Int64}, ::Float32, ::FreeTypeAbstraction.FTFont, ::Tuple{Symbol, Symbol}, ::Quaternionf, ::MakieCore.Automatic, ::Float64, ::ColorTypes.RGBA{Float32}, ::ColorTypes.RGBA{Float32}, ::Int64, ::Int64)
> @ Makie ~/.julia/packages/Makie/bwZTV/src/utilities/utilities.jl:185
> \[21\] (::Makie.var"#1797#1800"{Base.RefValue{Vector{Int64}}, Observable{Vector{ColorTypes.RGBA{Float32}}}, Observable{Vector{Float32}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Makie.GlyphCollection}}})(str::LaTeXString, ts::Float64, f::FreeTypeAbstraction.FTFont, al::Tuple{Symbol, Symbol}, rot::Float32, jus::MakieCore.Automatic, lh::Float64, col::ColorTypes.RGBA{Float32}, scol::Tuple{Symbol, Float64}, swi::Int64, www::Int64)
> @ Makie ~/.julia/packages/Makie/bwZTV/src/basic\_recipes/text.jl:34
> \[22\] (::Observables.var"#callback#13"{Makie.var"#1797#1800"{Base.RefValue{Vector{Int64}}, Observable{Vector{ColorTypes.RGBA{Float32}}}, Observable{Vector{Float32}}, Observable{Vector{Point{2, Float32}}}, Observable{Vector{Makie.GlyphCollection}}}, NTuple{11, Observable{Any}}})(x::Any)
> @ Observables ~/.julia/packages/Observables/ynr7h/src/Observables.jl:339
> \[23\] #invokelatest#2
> @ ./essentials.jl:716 \[inlined\]
> \[24\] invokelatest
> @ ./essentials.jl:714 \[inlined\]
> \[25\] notify(observable::Observables.AbstractObservable)
> @ Observables ~/.julia/packages/Observables/ynr7h/src/Observables.jl:143
> \[26\] plot!(plot::MakieCore.Text{Tuple{Vector{Point{2, Float32}}}})
> @ Makie ~/.julia/packages/Makie/bwZTV/src/basic\_recipes/text.jl:53
> \[27\] plot!(scene::Scene, P::Type{MakieCore.Text{Tuple{Point{2, Float32}}}}, attributes::Attributes, input::Tuple{Observable{Point{2, Float32}}}, args::Observable{Tuple{Vector{Point{2, Float32}}}})
> @ Makie ~/.julia/packages/Makie/bwZTV/src/interfaces.jl:402
> \[28\] plot!(scene::Scene, P::Type{MakieCore.Text}, attributes::Attributes, args::Observable{Point{2, Float32}}; kw\_attributes::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
> @ Makie ~/.julia/packages/Makie/bwZTV/src/interfaces.jl:320
> \[29\] plot!
> @ ~/.julia/packages/Makie/bwZTV/src/interfaces.jl:288 \[inlined\]
> \[30\] #plot!#132
> @ ~/.julia/packages/Makie/bwZTV/src/interfaces.jl:271 \[inlined\]
> \[31\] text!(::Scene, ::Vararg{Any}; attributes::Base.Pairs{Symbol, Any, NTuple{9, Symbol}, NamedTuple{(:text, :textsize, :color, :visible, :align, :rotation, :font, :markerspace, :inspectable), Tuple{Observable{Any}, Observable{Any}, Observable{Any}, Observable{Any}, Observable{Tuple{Symbol, Symbol}}, Observable{Float32}, Observable{Any}, Symbol, Bool}}})
> @ MakieCore ~/.julia/packages/MakieCore/YlbA1/src/recipes.jl:38
> \[32\] Makie.LineAxis(parent::Scene, attrs::Attributes)
> @ Makie ~/.julia/packages/Makie/bwZTV/src/makielayout/lineaxis.jl:367
> \[33\] #LineAxis#1151
> @ ~/.julia/packages/Makie/bwZTV/src/makielayout/lineaxis.jl:3 \[inlined\]
> \[34\] initialize\_block!(ax::Axis; palette::Nothing)
> @ Makie ~/.julia/packages/Makie/bwZTV/src/makielayout/blocks/axis.jl:330
> \[35\] initialize\_block!
> @ ~/.julia/packages/Makie/bwZTV/src/makielayout/blocks/axis.jl:170 \[inlined\]
> \[36\] \_block(::Type{Axis}, ::Figure; bbox::Nothing, kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:xtickformat, :ytickformat, :ylabel), Tuple{var"#1#3", var"#2#4", LaTeXString}}})
> @ Makie ~/.julia/packages/Makie/bwZTV/src/makielayout/blocks.jl:393
> \[37\] \_block(::Type{Axis}, ::GridPosition; kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:xtickformat, :ytickformat, :ylabel), Tuple{var"#1#3", var"#2#4", LaTeXString}}})
> @ Makie ~/.julia/packages/Makie/bwZTV/src/makielayout/blocks.jl:284
> \[38\] #\_#999
> @ ~/.julia/packages/Makie/bwZTV/src/makielayout/blocks.jl:269 \[inlined\]
> \[39\] top-level scope
> @ REPL\[9\]:1
> \`\`\`
> \</details\>

---

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [July 8, 2023, 9:03am UTC](https://discourse.julialang.org/t/calligraphic-latex-fonts-in-makie/101209/9 "2023-07-08T09:03:39Z")

</div>

> [@ederag](#):
>
> `MathTeXEngine` is faster but younger thus more limited

It’s unrealistic to expect `MathTeXEngine` to ever approach anything resembling a full TeX engine. It’s more a MathJax than a TeX.

---

<div class="post-metadata">

**Author:** ![ederag](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ederag/32/4106_2.png) [@ederag](https://discourse.julialang.org/u/ederag)\
**Post date:** [July 8, 2023, 10:21am UTC](https://discourse.julialang.org/t/calligraphic-latex-fonts-in-makie/101209/10 "2023-07-08T10:21:22Z")

</div>

Agreed.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [July 8, 2023, 11:08am UTC](https://discourse.julialang.org/t/calligraphic-latex-fonts-in-makie/101209/11 "2023-07-08T11:08:40Z")

</div>

Fixing MathTeX seems a little tricky, needing some thought. It broke when `text` stopped using the actual text object as a positional argument. More like `scatter` with `marker` it’s now `text` with `text` attribute. But that means that the opportunity to dispatch away from using `GlyphCollection`s and `linesegments` is gone for now, which was the mechanism MakieTeX used to insert its functionality into anything `text`-related. It would be relatively easy I think to get a separate recipe going again. It’s more difficult to reuse `text` but I guess that would be the most practical thing, as it’s used by axis titles, labels, ticks, etc.
