Unexpected error while parsing widehat
sethaxen opened this issue · 3 comments
sethaxen commented
julia> using MathTeXEngine
julia> generate_tex_elements(L"\hat{x}"); # fine
julia> generate_tex_elements(L"\widehat{x}"); # error
ERROR: TeXParseError: unexpected error while parsing
at position 9 (string index 9)
\widehat{x}
^
Stack before
[1] TeXExpr :expr
Stacktrace:
[1] texparse(data::String; showdebug::Bool)
@ MathTeXEngine ~/.julia/packages/MathTeXEngine/yfkMo/src/parser/parser.jl:303
[2] texparse
@ ~/.julia/packages/MathTeXEngine/yfkMo/src/parser/parser.jl:287 [inlined]
[3] _broadcast_getindex_evalf
@ ./broadcast.jl:670 [inlined]
[4] _broadcast_getindex
@ ./broadcast.jl:643 [inlined]
[5] _getindex
@ ./broadcast.jl:666 [inlined]
[6] _broadcast_getindex
@ ./broadcast.jl:642 [inlined]
[7] getindex
@ ./broadcast.jl:597 [inlined]
[8] copy
@ ./broadcast.jl:899 [inlined]
[9] materialize
@ ./broadcast.jl:860 [inlined]
[10] generate_tex_elements(str::LaTeXStrings.LaTeXString, font_family::MathTeXEngine.FontFamily)
@ MathTeXEngine ~/.julia/packages/MathTeXEngine/yfkMo/src/engine/layout.jl:301
[11] generate_tex_elements(str::LaTeXStrings.LaTeXString)
@ MathTeXEngine ~/.julia/packages/MathTeXEngine/yfkMo/src/engine/layout.jl:295
[12] top-level scope
@ REPL[6]:1
caused by: TeXParseError: unsupported command \widehat
at position 9 (string index 9)
\widehat{x}
^
Stack before
[1] TeXExpr :expr
Stacktrace:
[1] _end_command_builder!(stack::DataStructures.Stack{Any}, p::Int64, data::String)
@ MathTeXEngine ~/.julia/packages/MathTeXEngine/yfkMo/src/parser/parser.jl:251
[2] macro expansion
@ ~/.julia/packages/MathTeXEngine/yfkMo/src/parser/parser.jl:274 [inlined]
[3] macro expansion
@ ~/.julia/packages/Automa/1KOLQ/src/codegen.jl:149 [inlined]
[4] texparse(data::String; showdebug::Bool)
@ MathTeXEngine ~/.julia/packages/MathTeXEngine/yfkMo/src/parser/parser.jl:301
[5] texparse
@ ~/.julia/packages/MathTeXEngine/yfkMo/src/parser/parser.jl:287 [inlined]
[6] _broadcast_getindex_evalf
@ ./broadcast.jl:670 [inlined]
[7] _broadcast_getindex
@ ./broadcast.jl:643 [inlined]
[8] _getindex
@ ./broadcast.jl:666 [inlined]
[9] _broadcast_getindex
@ ./broadcast.jl:642 [inlined]
[10] getindex
@ ./broadcast.jl:597 [inlined]
[11] copy
@ ./broadcast.jl:899 [inlined]
[12] materialize
@ ./broadcast.jl:860 [inlined]
[13] generate_tex_elements(str::LaTeXStrings.LaTeXString, font_family::MathTeXEngine.FontFamily)
@ MathTeXEngine ~/.julia/packages/MathTeXEngine/yfkMo/src/engine/layout.jl:301
[14] generate_tex_elements(str::LaTeXStrings.LaTeXString)
@ MathTeXEngine ~/.julia/packages/MathTeXEngine/yfkMo/src/engine/layout.jl:295
[15] top-level scope
@ REPL[6]:1
julia> versioninfo()
Julia Version 1.8.4
Commit 00177ebc4fc (2022-12-23 21:32 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 8 × 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-13.0.1 (ORCJIT, tigerlake)
Threads: 8 on 8 virtual cores
Environment:
JULIA_CMDSTAN_HOME = /home/sethaxen/software/cmdstan/2.30.1/
JULIA_NUM_THREADS = auto
JULIA_EDITOR = code
(jl_uI2CGX) pkg> st
Status `/tmp/jl_uI2CGX/Project.toml`
[0a4f8689] MathTeXEngine v0.5.4
theogf commented
Got the same error, any clue on how to fix it?
sethaxen commented
I never found a solution. I just didn't use Makie for that plot.
Kolaru commented
Sorry for the long wait.
I'm fixing the displayed error in #109
For supporting the command, I have to think about it. After a quick research it looks like the \wide
family just stretch the combining character to the size of whatever is under it. That will require a bit more time to implement.