GR.jl icon indicating copy to clipboard operation
GR.jl copied to clipboard

syntax error trying to include LaTeX \uparrow or \downarrow in plot

Open MasonProtter opened this issue 3 years ago • 1 comments

Sort of a strange issue:

julia> using GR, LaTeXStrings

julia> xs = 0:π/100:2π;

julia> plot(xs, sin.(xs), title=L"\psi_{\uparrow}")
ERROR: syntax error

julia> 

produces image

Interestingly, one does not get this syntax error if I put invalid LaTeX in the plot, so that's not the issue

julia> plot(xs, sin.(xs), title=L"\psi_{\fdsfsdf}")

julia> 

image

(@v1.5) pkg> st GR
Status `~/.julia/environments/v1.5/Project.toml`
  [28b8d3ca] GR v0.53.0

julia> versioninfo()
Julia Version 1.5.3
Commit 788b2c77c1* (2020-11-09 13:37 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: AMD Ryzen 5 2600 Six-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, znver1)
Environment:
  JULIA_NUM_THREADS = 6

MasonProtter avatar Nov 12 '20 02:11 MasonProtter

Thanks for the hint. This is a bug in the mathtex parser. We will check this.

jheinen avatar Nov 12 '20 03:11 jheinen