A big +1 to this.
LaTeX is arguably the best way to display mathematics and one may wonder why "%display latex" is not the default in the Jupyter notebook. If one would like the plain text view of an object X instead, one can use print(X).
So, in the Jupyter notebook, instead of having (as of today)
X.show() --> LaTeX typeset
X --> plain text
we could have
X --> LaTeX typeset
print(X) --> plain text
By the way, a proper way to implement this could be to simply add the following method to SageObject:
def _repr_latex_(self):
return '$' + str(latex(self)) + '$'
Then the LaTeX display is taken in charge by the *native* Jupyter rich output mechanism (there is no need of "%display latex", which is a magic implemented at the Sage level) . Moreover, this would fix the long standing issue of pdf export reported in
I've discussed this point with Fernando Perez at the CIRM meeting in February and he recommends that we use Jupyter's _repr_latex_. See
for more details on customizing Jupyter rich output.
Eric.