# The latex symbol is not working in a plot title

**URL:** https://discourse.julialang.org/t/the-latex-symbol-is-not-working-in-a-plot-title/90768
**Category:** General Usage
**Tags:** question, plotting
**Created:** [November 24, 2022, 6:07pm UTC](https://discourse.julialang.org/t/the-latex-symbol-is-not-working-in-a-plot-title/90768 "2022-11-24T18:07:40Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![maoc](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@maoc](https://discourse.julialang.org/u/maoc)
#### Post date: [November 24, 2022, 6:07pm UTC](https://discourse.julialang.org/t/the-latex-symbol-is-not-working-in-a-plot-title/90768/1 "2022-11-24T18:07:40Z")

</div>

I’m using the symbol latex \lambda in Julia scripts (\lambda = 5). When I plot, I need to put the \lambda symbol in the Title, but it’s not working. I am using the Jupyter Notebook on Chrome!

```julia
using Plots
title_ = ["λ =$λ, n = $nn " "" "" "" ""] 

```

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

I don’t know why the symbol is not showing. Does anyone have any tips on how to resolve this?

---

<div class="post-metadata">

### Author: ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)
#### Post date: [November 24, 2022, 6:47pm UTC](https://discourse.julialang.org/t/the-latex-symbol-is-not-working-in-a-plot-title/90768/2 "2022-11-24T18:47:07Z")

</div>

You should probably mention what package you are using for plotting, GR through Plots.jl?

---

<div class="post-metadata">

### Author: ![John\_Gibson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/john_gibson/32/5321_2.png) [@John\_Gibson](https://discourse.julialang.org/u/John_Gibson)
#### Post date: [November 24, 2022, 7:17pm UTC](https://discourse.julialang.org/t/the-latex-symbol-is-not-working-in-a-plot-title/90768/3 "2022-11-24T19:17:36Z")

</div>

Use the LaTeXStrings package and LaTeX-like markup.

```julia
using LaTeXStrings
title_ = L"\lambda=$λ"
plot(title=title_)

```

---

<div class="post-metadata">

### Author: ![empet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/empet/32/221303_2.png) [@empet](https://discourse.julialang.org/u/empet)
#### Post date: [November 24, 2022, 7:34pm UTC](https://discourse.julialang.org/t/the-latex-symbol-is-not-working-in-a-plot-title/90768/4 "2022-11-24T19:34:33Z")

</div>

It displays LaTeX even without LaTeXStrings:

```julia
using Plots
λ=5
title_ = "λ=$λ"
plot(title=title_, size=(300, 200))

```

---

<div class="post-metadata">

### Author: ![maoc](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@maoc](https://discourse.julialang.org/u/maoc)
#### Post date: [November 24, 2022, 9:09pm UTC](https://discourse.julialang.org/t/the-latex-symbol-is-not-working-in-a-plot-title/90768/5 "2022-11-24T21:09:03Z")

</div>

This seems to solve the problem, but other problems appear.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/3/e347acc9bbbe85f88790ec146a85fa0c4cab97ba.png)

---

<div class="post-metadata">

### Author: ![maoc](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@maoc](https://discourse.julialang.org/u/maoc)
#### Post date: [November 24, 2022, 9:10pm UTC](https://discourse.julialang.org/t/the-latex-symbol-is-not-working-in-a-plot-title/90768/6 "2022-11-24T21:10:42Z")

</div>

Plots.jl

---

<div class="post-metadata">

### Author: ![maoc](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@maoc](https://discourse.julialang.org/u/maoc)
#### Post date: [November 24, 2022, 9:12pm UTC](https://discourse.julialang.org/t/the-latex-symbol-is-not-working-in-a-plot-title/90768/7 "2022-11-24T21:12:28Z")

</div>

Yes, I believe that the problem should not be Julia’s, but maybe an update is needed. Is that it?

---

<div class="post-metadata">

### Author: ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)
#### Post date: [November 24, 2022, 9:18pm UTC](https://discourse.julialang.org/t/the-latex-symbol-is-not-working-in-a-plot-title/90768/8 "2022-11-24T21:18:46Z")

</div>

Or

```julia
using Latexify
_title=@latexdefine λ

```

---

<div class="post-metadata">

### Author: ![empet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/empet/32/221303_2.png) [@empet](https://discourse.julialang.org/u/empet)
#### Post date: [November 24, 2022, 9:38pm UTC](https://discourse.julialang.org/t/the-latex-symbol-is-not-working-in-a-plot-title/90768/9 "2022-11-24T21:38:51Z")

</div>

I checked it in REPL, and Jupyter Notebook, without any update.

---

<div class="post-metadata">

### Author: ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)
#### Post date: [December 10, 2022, 3:22pm UTC](https://discourse.julialang.org/t/the-latex-symbol-is-not-working-in-a-plot-title/90768/10 "2022-12-10T15:22:25Z")

</div>

The `$` symbol is the standard symbol to “interpolate” in text strings, e.g., with `x = 2`, the string `"Here, x = $x"` works.

If you use `LaTeXStrings`, this will, however, not work because `LaTeXStrings` will interpret the `$` character as indicating a LaTeX symbol.

Instead, in `LaTeXStrings`, you need to use `%$` as interpolation symbol. So with `x = 2`, the string `L"Here, $x = %$(x)` should work.
