# LaTeX code for titles, labels,... with Plots.jl

**URL:** <https://discourse.julialang.org/t/latex-code-for-titles-labels-with-plots-jl/1967>\
**Category:** General Usage\
**Tags:** question, package, plotting\
**Created:** [February 7, 2017, 8:57pm UTC](https://discourse.julialang.org/t/latex-code-for-titles-labels-with-plots-jl/1967 "2017-02-07T20:57:10Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![Rob\_van\_Weelderen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rob_van_weelderen/32/7621_2.png) [@Rob\_van\_Weelderen](https://discourse.julialang.org/u/Rob_van_Weelderen)\
**Post date:** [August 7, 2018, 9:43am UTC](https://discourse.julialang.org/t/latex-code-for-titles-labels-with-plots-jl/1967/18 "2018-08-07T09:43:45Z")

</div>

Hi Nils,

I found that for the **title** and **gr() backend** one has to use the `latexstring()` function directly instead of `L"some latex code"`.

Below an example code

```julia
using Plots, LaTeXStrings

gr()

date = "07-08-2018"
titlestring = latexstring("\\mathrm{My\\, \\alpha\\, including\\, a\\, variable\\, date:\\,}", date)

plot(sin, (0:0.01:5*pi), dpi=300,
     title = titlestring,
     xlabel = L"\mathrm{My\, x-label\, (mJ/cm^{3})}",
     ylabel = L"\mathrm{\alpha (m/s)}")

```

Rob.

---

_[View the full topic](https://discourse.julialang.org/t/latex-code-for-titles-labels-with-plots-jl/1967)._
