16.4 LaTeX conversion

Yes, you can output some of your results into LaTeX.

sage: M = MatrixSpace(RealField(),3,3)
sage: A = M([1,2,3, 4,5,6, 7,8,9])
sage: print latex(A)
\left(\begin{array}{rrr}
    1.00000000000000 & 2.00000000000000 & 3.00000000000000 \\
    4.00000000000000 & 5.00000000000000 & 6.00000000000000 \\
    7.00000000000000 & 8.00000000000000 & 9.00000000000000
    \end{array}\right)

sage: view(A)
At this point a dvi preview should automatically be called to display in a separate window the LaTeX output produced.

LaTeX previewing for multivariate polynomials and rational functions is also available:

sage: x = PolynomialRing(QQ,3, 'x').gens()
sage: f = x[0] + x[1] - 2*x[1]*x[2]
sage: h = f /(x[1] + x[2])
sage: print latex(h)
\frac{-2 x_{1} x_{2} + x_{0} + x_{1}}{x_{1} + x_{2}}

See About this document... for information on suggesting changes.