How to use amsmath/mathtools in Plots.jl?

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

Neither GR + LaTeXStrings.jl nor PGFPlotsX.jl recognize commands like \lVert A \rVert

It could be easier, but one way would be:

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
2 Likes