# Displaying mathematical notation as "strings"

Hello!

I can't seem to find if there is a command (or if sage is even capable) to display mathematical notation as a string to be printed, rather than evaluated.

For example, if I try;

foo = exp(x)
foo2 = str(foo)


Then using "foo2" displays e^x, rather than the actual superscript x. Although this isn't terribly surprising to me, I'm curious if there is a way to get the actual correct notation?

An even more important one would be limit notation. I can't figure out how to display the text "Lim" with "x -> 0" underneath the text "Lim" at all in sage.

If these features aren't possible that would be good to know, but it seems like a common and straight forward issue. Unfortunately googling gets drown in irrelevant hits and I don't know the appropriate term to search for. A pointer in the right direction would be much appreciated.

edit retag close merge delete

Sort by » oldest newest most voted

You are probably looking for view(), show(), or latex(). But Sage's output is usually ASCII unless you specifically ask for something like this, and how that renders (e.g. in a separate output program or in the 'usual' place) depends on whether you are using the command line or one of the notebooks.

more