[Tex/LaTex] Getting superscripts in math mode without the ^ character

math-modemathjaxsuperscripts

Is there a way to get the superscript math mode behavior without using ^?

By way of background: I work at a large school that has a large web site that occasionally has math content on pages. I recently convinced the powers that be to start using MathJax to render all of the math content, but they have encountered a hitch. There is a collection of pages that is processed by complicated subsystems in an automated way, and I'm told that the ^ character is a control character at some stage(s).

So either they have to work around that, or I could start communicating the math without using ^ symbol. (I understand that I may still have a MathJax issue to move on to, but my issue starts with this LaTeX question.)

Best Answer

in latex.ltx there is a line

\let\sp=^

so there is an alternate command, \sp, that will produce a superscript.

@egreg notes in a comment that this isn't available for mathjax, so it's apparently not "portable". however, david cervone (mathjax lead developer) says that

MathJax does handle \let\sp=^ [...]. MathJax's \let only works to set a control sequence name, not another character, so you can't do \let!=^, for example, but setting \sp would certainly work.

this command is inherited from plain.tex. in the texbook (p.135)

\danger If for some reason you cannot use ^ and _ for superscripts and subscripts, because you have an unusual keyboard or because you need ^ for French accents or something, plain TeX lets you type \sp and \sb instead. For example, $x\sp2$ is another way to get x2. On the other hand, some people are lucky enough to have keyboards that contain additional symbols besides those of standard ASCII.