How to pretty print in ipython notebook via sympy?

后端 未结 4 1995
迷失自我
迷失自我 2020-12-05 03:57

I tried pprint, print, the former only prints Unicode version, and the latter doesn\'t do pretty prints.

from sympy import symbols         


        
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-05 04:42

    The issue is with your init_printing statement. In a notebook, you do not want to run latex, instead you should use mathjax, so try this instead:

    init_printing(use_latex='mathjax')
    

    When I use this, I get normal pretty printing everywhere, even when I have a sympy expression as the last line of the cell.

提交回复
热议问题