0

this command output latex in online Env

solve(x**2 - 33*x + 20*13-14**2, x)

enter image description here

same command outputs a plaintext on my local Env.

enter image description here

a simpler one could be rendered successfully.

enter image description here

did I missing something?

  • 1
    keep in mind that a browser can run additional javascript code. They are using MatJax for rendering – WiseDev Jun 26 '19 at 11:23
  • Possible duplicate of [Can I integrate MathJax into a Python program?](https://stackoverflow.com/questions/37754756/can-i-integrate-mathjax-into-a-python-program) – WiseDev Jun 26 '19 at 11:27
  • thanks for your comments. but I think my question is different to your link. my local env can render a simpler latex. did you run my code on your own env? –  Jun 26 '19 at 11:45
  • What env are you using? – WiseDev Jun 26 '19 at 11:46

1 Answers1

0

You need to initiate session first by calling init_session()

If you plan to work in an interactive calculator-type session, the init_session() function will automatically import everything in SymPy, create some common Symbols, setup plotting, and run init_printing()

from sympy import init_session

init_session()

x = 5
solve(x**2 - 33*x + 20*13 - 14**2, x)
mrzrm
  • 926
  • 7
  • 19