Issue
I have set up IPython console in Spyder to output in LaTeX with sympy via
import sympy as sy
sy.init_printing(use_latex=True)
The output now is a LaTeX style png. Now I would like to copy paste the underlying "LaTeX code" into my .tex file. How can I do that efficiently, how do I get the LaTeX from this png output?
E.g. from the output of
a, b, c, d = sy.symbols('a b c d')
sy.Eq(a**2*(b-c),d)
which is a^2(b-c)=d, but in a fancy LaTeX-png, I would like to get something like
a^{2} \left(b-c\right) = d
In reality the equations are much more complex and there are a lot of them and I don't want to transcribe them all manually.
Thanks for your help!
Solution
I figured it out myself
sy.print_latex(sy.Eq(a**2*(b-c),d))
does the trick!
printing this in the console gives the output
a^{2} \left(b - c\right) = d
like I wanted.
Answered By - Phaneroptera
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.