ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 09 Sep 2016 09:39:39 -0500Displaying mathematical notation as "strings"http://ask.sagemath.org/question/34784/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.Fri, 09 Sep 2016 09:24:17 -0500http://ask.sagemath.org/question/34784/displaying-mathematical-notation-as-strings/Answer by kcrisman for <p>Hello!</p>
<p>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.</p>
<p>For example, if I try;</p>
<pre><code>foo = exp(x)
foo2 = str(foo)
</code></pre>
<p>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?</p>
<p>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.</p>
<p>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.</p>
http://ask.sagemath.org/question/34784/displaying-mathematical-notation-as-strings/?answer=34785#post-id-34785You 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.Fri, 09 Sep 2016 09:39:39 -0500http://ask.sagemath.org/question/34784/displaying-mathematical-notation-as-strings/?answer=34785#post-id-34785