Escape characters for LaTeX
I am using SageTeX and LaTeX to produce several variations of an exam, with a script that makes several iterations. I do this:
var('x, y, z')
v = vector([x, y, z])
a = vector([1, -2, -1])
These will change from one iteration to the next.
sortie = str(latex(a.dot_product(v)))
This leads to
x - 2 \\, y - z
which is correct, and I would like to turn into
\bbm{x} -2 \\, \bbm{y} - \bbm{z}
for the LaTeX processing so that x
, y
and z
are shown like vectors.
Suggestions?