Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue when using \operatorname #332

Open
HMegh opened this issue Nov 24, 2024 · 0 comments
Open

issue when using \operatorname #332

HMegh opened this issue Nov 24, 2024 · 0 comments

Comments

@HMegh
Copy link

HMegh commented Nov 24, 2024

Hi,

I was trying to use PGFPlotsX with LaTeXStrings (for my labels) but I encountered an issue. For instance

using Plots, LaTeXStrings
pgfplotsx()
plot(z->sinc(z),0,1,label=L"\operatorname{sinc}(z)")

returns an error ! Undefined control sequence. <recently read> \operatorname (full error message is at the end). The same code works as expected with GR as a backend. Currently, I am using Plots v1.40.8 and PGFPlotsX v1.6.2.

The error message

! Undefined control sequence.
<recently read> \operatorname 
              
l.84 \end{axis}
             
Error showing value of type Plots.Plot{Plots.PGFPlotsXBackend}:
ERROR: The latex command `lualatex jl_f8nu94F6Fu.tex` failed
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] savepdf(filename::String, td::PGFPlotsX.TikzDocument; latex_engine::PGFPlotsX.LaTeXEngine, buildflags::Vector{…}, run_count::Int64, tmp::String)
    @ PGFPlotsX ~/.julia/packages/PGFPlotsX/XcmEC/src/tikzdocument.jl:202
  [3] savepdf
    @ ~/.julia/packages/PGFPlotsX/XcmEC/src/tikzdocument.jl:159 [inlined]
  [4] save(filename::String, td::PGFPlotsX.TikzDocument; include_preamble::Bool, latex_engine::PGFPlotsX.LaTeXEngine, buildflags::Vector{…}, dpi::Int64, showing_ide::Bool)
    @ PGFPlotsX ~/.julia/packages/PGFPlotsX/XcmEC/src/tikzdocument.jl:86
  [5] save(filename::String, td::PGFPlotsX.TikzDocument)
    @ PGFPlotsX ~/.julia/packages/PGFPlotsX/XcmEC/src/tikzdocument.jl:67
  [6] display(d::PGFPlotsX.PGFPlotsXDisplay, p::PGFPlotsX.TikzDocument)
    @ PGFPlotsX ~/.julia/packages/PGFPlotsX/XcmEC/src/tikzdocument.jl:355
  [7] _display(plt::Plots.Plot{Plots.PGFPlotsXBackend})
    @ Plots ~/.julia/packages/Plots/kLeqV/src/backends/pgfplotsx.jl:1386
  [8] display(::Plots.PlotsDisplay, plt::Plots.Plot{Plots.PGFPlotsXBackend})
    @ Plots ~/.julia/packages/Plots/kLeqV/src/output.jl:169
  [9] display(x::Any)
    @ Base.Multimedia ./multimedia.jl:340
 [10] #invokelatest#2
    @ ./essentials.jl:1055 [inlined]
 [11] invokelatest
    @ ./essentials.jl:1052 [inlined]
 [12] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{…})
    @ REPL ~/.julia/juliaup/julia-1.11.1+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/REPL.jl:409
 [13] (::REPL.var"#70#71"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
    @ REPL ~/.julia/juliaup/julia-1.11.1+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/REPL.jl:378
 [14] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL ~/.julia/juliaup/julia-1.11.1+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/REPL.jl:661
 [15] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
    @ REPL ~/.julia/juliaup/julia-1.11.1+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/REPL.jl:376
 [16] (::REPL.var"#do_respond#96"{})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
    @ REPL ~/.julia/juliaup/julia-1.11.1+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1003
 [17] #invokelatest#2
    @ ./essentials.jl:1055 [inlined]
 [18] invokelatest
    @ ./essentials.jl:1052 [inlined]
 [19] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit ~/.julia/juliaup/julia-1.11.1+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2755
 [20] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL ~/.julia/juliaup/julia-1.11.1+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1471
 [21] (::REPL.var"#75#81"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL ~/.julia/juliaup/julia-1.11.1+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/REPL.jl:480
Some type information was truncated. Use `show(err)` to see complete types.
Julia version info
 Julia Version 1.11.1
Commit 8f5b7ca12ad (2024-10-16 10:53 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 20 × 12th Gen Intel(R) Core(TM) i9-12900H
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, alderlake)
Threads: 1 default, 0 interactive, 1 GC (on 20 virtual cores)
Environment:
  JULIA_LOAD_PATH = /usr/share/gmsh/api/julia:
  JULIA_EDITOR = vim
Texlive version info
TeX 3.141592653 (TeX Live 2024/Arch Linux)
kpathsea version 6.4.0
Copyright 2024 D.E. Knuth.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant