Is it possible to show `print` output as LaTeX in jupyter notebook?

Use IPython.display‘s display function with a Math object:

from IPython.display import display, Math
display(Math(r'Dims: {}x{}m \\ Area: {}m^2 \\ Volume: {}m^3'.format(a, round(b,2), P, V)))

Note the use of Latex-style \\ newlines, and the r'' string, which will take the backslashes as literal backslashes and not see them as escape characters.

Found the solution here.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)