# How to use amsmath/mathtools in Plots.jl?

**URL:** <https://discourse.julialang.org/t/how-to-use-amsmath-mathtools-in-plots-jl/111542>\
**Category:** Visualization\
**Tags:** question, latex, plots, pgfplotsx, latexstrings\
**Created:** [March 12, 2024, 9:42pm UTC](https://discourse.julialang.org/t/how-to-use-amsmath-mathtools-in-plots-jl/111542 "2024-03-12T21:42:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![homocomputeris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/homocomputeris/32/8933_2.png) [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Post date:** [March 12, 2024, 9:42pm UTC](https://discourse.julialang.org/t/how-to-use-amsmath-mathtools-in-plots-jl/111542/1 "2024-03-12T21:42:12Z")

</div>

How can I use `amsmath` or `mathtools` commands in Plots.jl?

Neither GR + LaTeXStrings.jl nor PGFPlotsX.jl recognize commands like [`\lVert A \rVert`](https://tex.stackexchange.com/questions/43008/absolute-value-symbols)

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [March 13, 2024, 9:12am UTC](https://discourse.julialang.org/t/how-to-use-amsmath-mathtools-in-plots-jl/111542/2 "2024-03-13T09:12:33Z")

</div>

It could be easier, but one way would be:

```julia
julia> using Plots; pgfplotsx()
julia> using LaTeXStrings
julia> p = plot(1:5, title = L"\lVert A \rVert"));
julia> Plots.PGFPlotsX.push_preamble!(backend_object(p).the_plot, "\\usepackage{amsmath}");
julia> p
```
