title: Pretty printing with Sagemath command line
body: <p>How do I "pretty-print" something in the Sagemath command line (as in sympy)? The only solution I found was to use <code>get_test_shell()</code> function, according to <a href="http://doc.sagemath.org/html/en/reference/repl/sage/repl/display/formatter.html" rel="nofollow noreferrer">this entry</a> in the docs. But basically I have to use</p>
  
  <pre><code>from sage.repl.interpreter import get_test_shell
  shell = get_test_shell()
  shell.run_cell('%display ascii_art')
  shell.run_cell('integral(x^2/pi^x, x)')
  </code></pre>
  
  <p>I find this to be too cumbersome (4 complicated lines just to display things nicely!) and what you want to display even has to be given as a string. So I'm looking for an easier alternative. I'm sure there's another way; I just can't find it.</p>
  
  <p>I think I might be using the wrong terms because according to the manual itself:</p>
  
  <blockquote>
    <blockquote>
      <p>Pretty printing means
          rendering things so that MathJax or some other latex-aware front end
          can render real math.</p>
    </blockquote>
  </blockquote>
  
  <p>So if I use <code>pretty_print_default(True)</code> it's going to always print latex, which isn't what I want for now.</p>
  
  <p>One thing I tried that I thought would work was to do </p>
  
  <pre><code>from sympy import pretty_print
  </code></pre>
  
  <p>Which should use Sympy's pretty-print (which is what I actually want), but it doesn't make any difference.</p>