# displaying results in latex fonts

Is there way to display results in latex fonts? Let me explain what I mean by that. Let's say I have the following expression

(y3^3)*(y2^2)*(y1^2)


I want to see the expression above in the format $y_3^3y_2^2y_1^2$.

Is there a way to do this?

edit retag close merge delete

Sort by » oldest newest most voted

Yes. And that's documented :

• Declare your variables with var("y_1, y_2, y_3") (note the underscores). Alternatively, use the latex_name of var (or SR.var).

• In the Jupyter notebook, a cell whose first line is the "magic" display typeset" will switch your output toLaTeX by default. Revert to "normal" display with the magic%display simple.

• In command-line (or emacs), use view. This will open your default PDF viewer on a temporary document containing a nice typesetting of the argument of view.

• in emacs + sage-shell-mode, there are multiple possibilities depending on the modes...

Don't forget to read the docs : that is usually faster than querying ask.sagemath`...

HTH,

more