Ask Your Question

Revision history [back]

It has been quite a while since the question was asked, but I seem to have an answer. The key points are to use unescaped strings (avoid \t in \textbf be misinterpreted for a tab) and LatexExpr(). The following is a MWE in my jupyter notebook:

var('x')
stats=((1,2),(3,4),(x,x^2-1))
tex_string = r"\textbf{stationary points: }"
tex_string += ", ".join(map(latex,stats))
show(LatexExpr(tex_string))
view(LatexExpr(tex_string))

This code both shows a typeset version in the notebook (second last command) and opens up a pdf viewer with typeset latex code (last command).