| 1 | initial version |
Since you can do x.mul(1/x, hold=True), you can also do latex(x.mul(1/x, hold=True)).
I suppose you could also write the expression using LaTeX:
sage: LatexExpr(r"\frac{%s}{%s}" % (latex(x), latex(x)))
\frac{x}{x}
sage: LatexExpr(r"\frac{%s}{%s}" % (latex(factor(x^2+3*x + 2)), latex(x)))
\frac{{\left(x + 1\right)} {\left(x + 2\right)}}{x}
But in general, latex(foo) first computes foo, which means that typically it will get simplified, and then it computes its LaTeX representation. So I don't think there is a simple way to do what you want.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.