Compose.jl
Compose.jl copied to clipboard
LaTeX string rendering in SVG?
Hi,
I'm using GraphPlot.jl which uses Compose.jl for drawing SVGs. As far as I can see that library uses the text() function to draw those labels. I was now wondering whether it's possible to use LaTeX strings (e.g. some math formula surrounded by dollar signs) just like for PGFs as described here.
I can write some Julia but not familiar with the Compose.jl code-base (yet) so wondering where to start and/or whether it would be easy to implement.
kr, Dieter
Since Gadfly uses Compose too, this has also come up there, see GiovineItalia/Gadfly.jl#1094. In Compose, supporting LaTeX strings could be done either by:
-
Converting LaTeX strings to Julia unicode e.g. UnicodeFun.jl or LaTeX_Entities.jl (contains LaTeX→unicode maps) , or
-
Investigating if Compose's other backends can support latex e.g. for SVG, can a latex equation be added as an SVG element? (google that). As you mentioned, the PGF backend natively supports latex.
See #418 for an attempt to implement point 2. using mathjax with the SVG backend.