How to print LaTeX in Julia?

Viewed 299

In Python, I have LaTeX code that I print as:

print('Lane-Emden Equation')
display(Latex(r'$'\
              r'\dfrac{\text{d}}{\text{d}\xi}'\
              r'\left( \xi^2 \dfrac{\text{d}\theta}{\text{d}\xi} \right)'\
              r'='\
              r'-\xi^2\theta^n'\
             r'$'))

How would I print the same thing in Julia?

1 Answers

You could try this code (note \text does not work and you need to use \mathrm instead):

using LaTeXStrings

lat = L"""\dfrac{\mathrm {d}}{\mathrm {d}\xi} \left( \xi^2 \dfrac{\mathrm {d}\theta}{\mathrm {d}\xi} \right) = -\xi^2\theta^n"""

using PyPlot
PyPlot.cla()
PyPlot.text(0.5,0.5,lat)

enter image description here

Related