diff --git a/src/backends/pgfplotsx.jl b/src/backends/pgfplotsx.jl index 1931343a..97863344 100644 --- a/src/backends/pgfplotsx.jl +++ b/src/backends/pgfplotsx.jl @@ -901,6 +901,15 @@ function pgfx_sanitize_string(s::AbstractString) s = replace(s, r"\\?\%" => "\\%") s = replace(s, r"\\?\_" => "\\_") s = replace(s, r"\\?\&" => "\\&") + s = replace(s, r"\\?\{" => "\\{") + s = replace(s, r"\\?\}" => "\\}") +end +@require LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" begin + using LaTeXStrings + function pgfx_sanitize_string(s::LaTeXString) + s = replace(s, r"\\?\#" => "\\#") + s = replace(s, r"\\?\%" => "\\%") + end end function pgfx_sanitize_plot!(plt) for (key, value) in plt.attr