Compose.jl
Compose.jl copied to clipboard
Latex in the text form is not rendered in IJulia notebook
I see that if I draw on a PGF object, then I get a latex document that can be compiled into a PDF with latex text.
For example:
s = compose(context(),
(context(), text(1/2,1/2,"\$\\alpha=0.5\$")),
(context(), rectangle(), fill("bisque"))
)
draw(PGF("plot.tex", 6inch, 4inch), s)
Although I have to delete the \usepackage{fontspec}
line because I use pdflatex and not xelatex.
However in the IJulia notebook the latex expressions do not appear: Plain text works fine in the IJulia notebook.
Is there a way to get the latex expressions rendered properly in the IJulia notebook?
Not at the moment, unfortunately. The output to the notebooks are in SVG format by default, and we do have have a Julia implementation of LaTeX's math layout engine yet.
As for disabling the fontspec
option, you should be able to use the texfonts=true
option in the PGF
call (e.g. PGF("plot.tex", 6inch, 4inch, texfonts=true
).