# Latex fonts on axis and labels in Makie

**URL:** <https://discourse.julialang.org/t/latex-fonts-on-axis-and-labels-in-makie/131887>\
**Category:** Performance\
**Tags:** makie, latexstrings\
**Created:** [August 27, 2025, 2:08pm UTC](https://discourse.julialang.org/t/latex-fonts-on-axis-and-labels-in-makie/131887 "2025-08-27T14:08:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tduretz](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@tduretz](https://discourse.julialang.org/u/tduretz)\
**Post date:** [August 27, 2025, 2:08pm UTC](https://discourse.julialang.org/t/latex-fonts-on-axis-and-labels-in-makie/131887/1 "2025-08-27T14:08:19Z")

</div>

I would like to use LaTeX fonts for every text of a Makie figure.  
It’s easy to apply them to labels as `LaTeXStrings` can be used. For other texts, in particular axis tick labels, it a bit less trivial.  
I was once told to use this:

```julia
using GLMakie 
using MathTeXEngine
Makie.update_theme!( fonts = (regular = texfont(), bold = texfont(:bold), italic = texfont(:italic))) 

```

This indeeds successfully replaces the fonts by the LaTeX ones and allows to homogenize fonts over a figure that uses LaTeXStrings.  
~~Nevertheless, the installation of `MathTeXEngine` appears problematic on some machines.~~  
Is there any other workaround in order to activate LaTeX fonts everywhere on a figure?  
Thanks!

edit: crossed out the statement about installation of `MathTextEngine` since it’s not the cause of the problem (see below)

---

<div class="post-metadata">

**Author:** ![barucden](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barucden/32/26154_2.png) [@barucden](https://discourse.julialang.org/u/barucden)\
**Post date:** [August 27, 2025, 2:55pm UTC](https://discourse.julialang.org/t/latex-fonts-on-axis-and-labels-in-makie/131887/2 "2025-08-27T14:55:19Z")

</div>

It might be the same under the hood, but I always use the LaTeX theme: [Predefined themes | Makie](https://docs.makie.org/dev/explanations/theming/predefined_themes#theme_latexfonts)

> [@tduretz](#):
>
> the installation of `MathTeXEngine` appears problematic on some machines

Does it? It looks like an ordinary Julia package to me, so I wouldn’t expect any problems (and never faced any myself).

---

<div class="post-metadata">

**Author:** ![tduretz](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@tduretz](https://discourse.julialang.org/u/tduretz)\
**Post date:** [August 27, 2025, 3:05pm UTC](https://discourse.julialang.org/t/latex-fonts-on-axis-and-labels-in-makie/131887/3 "2025-08-27T15:05:33Z")

</div>

thanks for the suggestion !  
With this approach the difference is that the whole figure apparently needs to be wrapped up into a function. This does the job nevertheless.

---

<div class="post-metadata">

**Author:** ![tduretz](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@tduretz](https://discourse.julialang.org/u/tduretz)\
**Post date:** [August 27, 2025, 3:10pm UTC](https://discourse.julialang.org/t/latex-fonts-on-axis-and-labels-in-makie/131887/4 "2025-08-27T15:10:54Z")

</div>

yes, we’re current developing a package and one contributor gets issues of that kind:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/7/9797cb6fa16470c7aaa89ebfdd4d896b392eb4f6.png)

---

<div class="post-metadata">

**Author:** ![barucden](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barucden/32/26154_2.png) [@barucden](https://discourse.julialang.org/u/barucden)\
**Post date:** [August 27, 2025, 3:17pm UTC](https://discourse.julialang.org/t/latex-fonts-on-axis-and-labels-in-makie/131887/5 "2025-08-27T15:17:47Z")

</div>

MathTexEngine is innocent here, I think. Is it possible that the active package, RheologyCalculator, restricts the version of LinearAlgebra to the range `1.11.0-1`, while running a Julia version with LinearAlgebra version 1.10.3? That’s how I read the error at least.

---

<div class="post-metadata">

**Author:** ![tduretz](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@tduretz](https://discourse.julialang.org/u/tduretz)\
**Post date:** [August 27, 2025, 3:19pm UTC](https://discourse.julialang.org/t/latex-fonts-on-axis-and-labels-in-makie/131887/6 "2025-08-27T15:19:18Z")

</div>

Ah OK… But why does the installation of `MathTeXEngine` has anything to do with `LinearAlgebra` ? That’s confusing…

---

<div class="post-metadata">

**Author:** ![barucden](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barucden/32/26154_2.png) [@barucden](https://discourse.julialang.org/u/barucden)\
**Post date:** [August 27, 2025, 3:30pm UTC](https://discourse.julialang.org/t/latex-fonts-on-axis-and-labels-in-makie/131887/7 "2025-08-27T15:30:37Z")

</div>

My _guess_ is that Pkg resolves all package versions when adding any package. RheologyCalculator depends on LinearAlgebra, so a version for LinearAlgebra is being resolved. I am not sure why the error pops up _now_ instead of when LinearAlgebra was added as a dependency. Maybe the package was originally developed with Julia 1.11, and later on that user started using Julia 1.10?

However, you can test this hypothesis by running `] resolve` (instead of `] add MathTexEngine`). My expectation is it’ll fail too.

You can also run `] status --compat`. It should display the restriction on LinearAlgebra versions. I bet you can than go ahead and just loosen it or remove it from `Project.toml`. Likely, you have something like

```toml
[compat]
LinearAlgebra = "1.11"

```

You can try removing that line, or maybe changing `1.11` → `1` to allow any version `1.x.x`.

---

<div class="post-metadata">

**Author:** ![tduretz](https://avatars.discourse-cdn.com/v4/letter/t/bcef8e/32.png) [@tduretz](https://discourse.julialang.org/u/tduretz)\
**Post date:** [August 27, 2025, 3:33pm UTC](https://discourse.julialang.org/t/latex-fonts-on-axis-and-labels-in-makie/131887/8 "2025-08-27T15:33:09Z")

</div>

Thank you so much for your suggestions. I’ll pass that on to my colleagues, this will likely help fixing the issue. Meanwhile I edited the original post since the mention of an installation problem of `MathTexEngine` was incorrect.
