Skip to content

Instantly share code, notes, and snippets.

@jleugeri
jleugeri / to_svg.jl
Created June 23, 2019 14:49
Render a latex equation to a raw svg string.
using LaTeXStrings
function to_svg(formula::LaTeXString ; preamble="\\usepackage{amsmath}")
text="""
\\documentclass[border=2pt]{standalone}
$(preamble)
\\usepackage{varwidth}
\\begin{document}
\\begin{varwidth}{\\linewidth}
$(String(formula))