4 ms·
I think Sympy's latex solution is probably more complete, but of course it requires a bigger install (but Sympy is already in Anaconda). Their example: >>
by jmmcd 9y ago
I think Sympy's latex solution is probably more complete, but of course it requires a bigger install (but Sympy is already in Anaconda).
Their example:
>>> print(latex(Integral(sqrt(1/x), x)))
\int \sqrt{\frac{1}{x}}\, dx
http://docs.sympy.org/latest/tutorial/printing.html#latex http://docs.sympy.org/latest/tutorial/printing.html#latex
- iogf 9y agoInteresting, i wasn't aware of that.However one of the goals of Lax is being extensible through python easily and being simplistic, one could define their own common latex structures in python then reuse it.
- jakeogh 9y agoinversely: https://github.com/augustt198/latex2sympy https://github.com/augustt198/latex2sympy https://github.com/sympy/sympy/issues/5418 https://github.com/sympy/sympy/issues/5418
- williamstein 9y agoLikewise, in SageMath you can turn any expression obj (matrices, fractions, elliptic curves, etc.) into latex by typing `latex(obj)`. (Disclaimer: I started SageMath and wrote a lot of this conversion to latex functionality early on, since it's useful for notebook interfaces.) Most objects in Sage have an _latex_ method, and the latex function works by recursively calling those methods to build a big latex expression. SageTex -- which lets you embed Python code in LaTeX documents -- also uses this latex(obj) functionality.