-
-
Save Artem-B/2aa3d67c7df1f83c8d6764960c1a7df9 to your computer and use it in GitHub Desktop.
Add LaTeX support to a Colab notebook for SymPy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sympy | |
def custom_latex_printer(exp, **options): | |
from google.colab.output._publish import javascript | |
url = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/latest.js?config=default" | |
javascript(url=url) | |
return sympy.printing.latex(exp, **options) | |
sympy.init_printing(use_latex="mathjax", latex_printer=custom_latex_printer) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment