JuliaTeX / TreeView.jl

Draw Julia syntax trees as a graph
Other
82 stars 15 forks source link

LaTeX error in trees that contain generated symbols #3

Closed rdeits closed 7 years ago

rdeits commented 7 years ago

This is actually an upstream bug in TikzGraphs: https://github.com/sisl/TikzGraphs.jl/issues/12 but I figured you might run into it here anyway.

Trying to render an expression that contains symbols generated with gensym() gives a LaTeX error because of the # character in those symbols. Minimal example:

expr = Expr(gensym())
walk_tree(expr)

produces:

! Illegal parameter number in definition of \pgfutil@reserved@a.
<to be read again> 
2
l.13 }
    ;
Error saving as SVG
LaTeX error

Would it be worth just replacing # with another character for now?

rdeits commented 7 years ago

(once this is fixed, I'll add TreeView output to the https://github.com/rdeits/CommonSubexpressions.jl docs 😄 )