# Copy to ~/.global.sage from subprocess import run ht_filename = "/tmp/mathtemp.html" def wv(expr): """ View an expression as LaTeX -> mathjax+html in a browser tab """ with open(ht_filename, "w") as f: f.write(f""" vis
$${latex(expr)}$$
""") run(["open", ht_filename])