I am familiar with using python and sympy on Jupyter Notebook. When printing LaTeX expressions on Notebook I have in my printing modules the statement -
init_printing(
use_latex='mathjax',
latex_mode='equation*',
latex_printer=latex,
# Affects only the plaintext printing, and makes our printing
# tests easier to maintain
wrap_line=False,
)
which is executed by the function Format()
.
I also print the following LaTeX macros so I can use them in print statements -
ip_cmds = raw"""
$\DeclareMathOperator{\Tr}{Tr}
\DeclareMathOperator{\Adj}{Adj}
\newcommand{\bfrac}[2]{\displaystyle\frac{#1}{#2}}
\newcommand{\lp}{\left (}
\newcommand{\rp}{\right )}
\newcommand{\paren}[1]{\lp {#1} \rp}
\newcommand{\half}{\frac{1}{2}}
\newcommand{\llt}{\left <}
\newcommand{\rgt}{\right >}
\newcommand{\abs}[1]{\left |{#1}\right | }
\newcommand{\pdiff}[2]{\bfrac{\partial {#1}}{\partial {#2}}}
\newcommand{\npdiff}[3]{\bfrac{\partial^{#3} {#1}}{\partial {#2}^{#3}}}
\newcommand{\lbrc}{\left \{}
\newcommand{\rbrc}{\right \}}
\newcommand{\W}{\wedge}
\newcommand{\prm}[1]{{#1}'}
\newcommand{\ddt}[1]{\bfrac{d{#1}}{dt}}
\newcommand{\R}{\dagger}
\newcommand{\deriv}[3]{\bfrac{d^{#3}#1}{d{#2}^{#3}}}
\newcommand{\grade}[1]{\left < {#1} \right >}
\newcommand{\f}[2]{{#1}\lp {#2} \rp}
\newcommand{\eval}[2]{\left . {#1} \right |_{#2}}$
"""
In Symbolics.jl is there an equivalent to the init_printing
statement for use in Jupyter Notebook. I am doing this so I can annotate my latex strings. An example would be
print(r"\theta_{l} =",latex_string)