Hello all, and sorry if this question is a beginner’s one.
I do some symbolic computation in a code block using Sympy. And then I output the LateX version of the formula.
I’d like Datalore to display this in Latex. How do I give Datalore a hint about how to interpret the result ?
Example:
from sympy import symbols, Function, latex
x, a = symbols(‘x a’)
u = symbols(‘u’, cls=Function)
f = a**(u(x))
print("$${}$$".format(latex(f.diff(x))))
In fact, this is a very good question! We do not support LaTeX formulas in the output for code blocks, so I’ll file a feature request and post updates here.
Hmm… It seems as though your output is still unicode rather than LaTeX. LaTeX has a serif font and a slightly different look. If you do a matrix you’ll notice how the brackets (in unicode) look like L’s instead of [ (LaTex brackets).
I’ve turned off Reactive Mode though, which did help a bit with performance. Also, (and this might be the bug you’ve mentioned), I haven’t been able to output equations by simply writing the variable name in a separate line.
I could also be completely wrong about what I’ve stated here. I’ve recently switched to Kaggle Kernels because of sympy’s inability to use LaTeX, but I would love to come back if it can be showed to display LaTeX Matrices and larger equations.
ah I see, I need to use Math and latex. Thank you!
One extra thing, is it possible to expand the width of the code area in Datalore to the full width of the screen? When I’m working with larger matrices, they overflow off screen and it’s a little annoying to constantly scroll back and fourth to read it.
Interesting… because that’s exactly what I have done, use init_printing, and I either get unicode output or no output at all (the issue I highlighted in my second to last post). Math and latex works though for some reason, so I know my browser can support LaTeX.