# [IPython-User] When you raise something to an exponent that is more then one character long, only the first character is displayed as superscript

Aaron Meurer asmeurer@gmail....
Tue Feb 18 17:03:16 CST 2014

Don't confuse the convenience SymPy gives you with LaTeX. LaTeX is dumb, in
that it knows nothing about the math it is rendering. It's not a math
system, it's a typesetting system. ^ just superscripts the next character,
or the next group of characters if they are grouped with {}.

The latex() function in SymPy will show you what it is really outputting to
IPython to render:

In [5]: latex(Eq(a**n*a**m, a**(n + m)))
Out[5]: 'a^{m} a^{n} = a^{m + n}'

It's often easiest to just copy-paste this, rather than trying to type it
out manually. Note that in general you should print the result, as when it
shows as a string backslashes will be escaped, so things like \frac{x}{y}
will come up as '\\frac{x}{y}'.

Aaron Meurer

On Tue, Feb 18, 2014 at 4:30 PM, Nathan Goldbaum <nathan12343@gmail.com>wrote:

> This is more of a LaTeX issue, but the following should work when
> inputting into a markdown cell:
>
> $$> a^m + a^n = a^{(m+n)} >$$
>
> In general, you can always use {} to denote a logical block in a LaTeX
> math expression.
>
>
> On Tue, Feb 18, 2014 at 2:26 PM, Aaron E-J <ae03@hampshire.edu> wrote:
>
>>  I am trying to display some formatted math using the markdown syntax in
>> the notebook but when you raise something to an exponent that is more then
>> one character long, only the first character is displayed as superscript. I
>> have a screen shot of the math using SymPy and the math using markdown. If
>> this is not an error but simply that I am not formatting the code
>> correctly, let me know, I'm new to ipython
>> [image: markdownerror]<https://f.cloud.github.com/assets/1979828/2200733/40c09532-98e6-11e3-971c-20bb1e98a5ab.png>
>>
>> --
>> Aaron E-Jhttp://otherrealm.org
>> Vision without action is a daydream,
>> Action without vision is a nightmare,
>> One needs both to succeed.
>>
>>
>> _______________________________________________
>> IPython-User mailing list
>> IPython-User@scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-user
>>
>>
>
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20140218/b171df5f/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 40c09532-98e6-11e3-971c-20bb1e98a5ab.png
Type: image/png
Size: 40130 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/ipython-user/attachments/20140218/b171df5f/attachment-0001.png


More information about the IPython-User mailing list