# How to write an actual superscript with \lim, \sup, etc?

I'm trying to write $\sup' S$ -- that is to say, $\sup S$ but with a prime on the sup. However, in display style, this comes out instead with the prime on top of the sup instead of in the superscript position. Presumably this is because LaTeX reads it as a superscript, and in display style, superscripts go on top of \sup just as subscripts go below it. How can I actually write sup' S and have it come out right?

Thank you!

• {\textstyle \sup^S}? – John Kormylo Dec 31 '15 at 2:41
• $\mbox{\ensuremath\sup}' S$ – Fran Dec 31 '15 at 2:53

You can drop in a \nolimits

\documentclass{article}
%\usepackage{amsmath}
\begin{document}
$\sup' S$
$\sup\nolimits' S$
\end{document}


Define a new operator:

\documentclass{article}
\usepackage{amsmath}

\DeclareMathOperator*{\psup}{sup^{\prime}}

\begin{document}
$\psup_{x>0}f(x)\ne\sup_{x>0}f(x)$
\end{document}


It's just a bit more complicated if you want that the limit is centered with respect to “sup” disregarding the prime:

\documentclass{article}
\usepackage{amsmath}

\DeclareMathOperator*{\psupop}{\hphantom{^{\prime}}sup^{\prime}}
\DeclareRobustCommand\psup{%

\makeatletter
\sbox\z@{$\m@th#1{}^{\prime}$}%
$a+\psup_{x>0}f(x)_{\psup A}\ne a+\sup_{x>0}f(x)_{\sup A}$

I insert an empty math operator for fixing the spacing, then a negative thin space, a negative kern as wide as a prime, another negative thin space for neutralizing the one inserted by \psupop (which has at its left an empty space as wide as a prime).