What symbolic math software can output latex quickly?

In Mathematica, you can use TeXForm:

In[1]:= TrigExpand[Sin[5 x]] // TeXForm

Out[1]//TeXForm=
\sin ^5(x)+5 \sin (x) \cos ^4(x)-10 \sin ^3(x) \cos ^2(x)

You can also right click and select Copy As -> LaTeX

enter image description here


As mentioned in a comment, sympy might be an option, see e.g. the docs: http://docs.sympy.org/dev/modules/printing.html#sympy.printing.latex.latex.

It is a Python package, and part of the SciPy stack. Hence it is also available in Sage MathCloud, and probably the desktop version of Sage Math.

An example from a terminal session:

In [1]: import sympy as sp
   ...: from sympy.printing import latex as spl

In [2]: x = sp.symbols('x')

In [3]: f = (1/sp.cos(x))

In [4]: print(spl(f.series(x,0,6)))
1 + \frac{x^{2}}{2} + \frac{5 x^{4}}{24} + \mathcal{O}\left(x^{6}\right)

Tags:

Math Mode