Merge pull request #3020 from JuliaPlots/bbs/latexify

latexify unicode
This commit is contained in:
Daniel Schwabeneder 2020-10-06 00:33:55 +02:00 committed by GitHub
commit 954f002dfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -13,6 +13,7 @@ GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326" GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
GeometryTypes = "4d00f742-c7ba-57c2-abde-4428a4b178cb" GeometryTypes = "4d00f742-c7ba-57c2-abde-4428a4b178cb"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Measures = "442fdcdd-2543-5da2-b0f3-8c86c306513e" Measures = "442fdcdd-2543-5da2-b0f3-8c86c306513e"
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"

View File

@ -1,5 +1,6 @@
using Contour: Contour using Contour: Contour
using UUIDs using UUIDs
using Latexify
Base.@kwdef mutable struct PGFPlotsXPlot Base.@kwdef mutable struct PGFPlotsXPlot
is_created::Bool = false is_created::Bool = false
was_shown::Bool = false was_shown::Bool = false
@ -1040,6 +1041,9 @@ 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"\\?\}" => "\\}") s = replace(s, r"\\?\}" => "\\}")
s = map(split(s, "")) do s
isascii(s) ? s : latexify(s)
end |> join
end end
@require LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" begin @require LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" begin
using .LaTeXStrings using .LaTeXStrings