A certain python function (from the module StrawberryFields) gives me a string that contains a latex file. In short:
latex_string = function(...)
print(latex_string)
gives for example:
\documentclass{article}
\pagestyle{empty}
\usepackage{qcircuit}
\begin{document}
\Qcircuit {
& \gate{Fock} & \gate{S} & \qw & \qw \\
& \multigate{3}{\mathcal{DM}} & \qw & \multigate{1}{BS} & \qw \\
& \ghost{\mathcal{DM}} & \qw & \ghost{BS} & \qw \\
& \ghost{\mathcal{DM}} & \qw & \qw & \qw \\
& \ghost{\mathcal{DM}} & \qw & \qw & \qw \\
}
\end{document}
I can save this string to a file and open it in TeXworks via os.system(latex_string_filename), but that interrupts my python code. How do I interpret this string directly in a jupyter notebook? (That is: render the latex file, display it and continue running the notebook cell). I think this should be feasible using sympy for example, but I don't exactly know how.