[Tex/LaTex] How to get a scriptscriptstyle-sized prime

fontsizesubscriptssuperscriptssymbols

As you go from \displaystyle to \scriptstyle to \scriptscriptstyle, letters and numbers, for instance, shrink. Weirdly, to my mind, the prime symbol (') shrinks from \displaystyle to \scriptstyle, but then is again the same size in \scripstscriptstyle. For example:

\[
a {\scriptstyle a} {\scriptscriptstyle a} \quad
' {\scriptstyle '} {\scriptscriptstyle '} \quad
a' {\scriptstyle a'} {\scriptscriptstyle a'}
\]

Various prime sizes

The effect of this is that sometimes (eg in certain sub or superscripts or labels), primes look much too large relative to the surrounding symbols.

How should one produce a properly scriptscriptstyle-sized prime symbol?

Best Answer

The scalerel package can do this. I made the scriptscript prime equal to .6 the size of the script prime. One invokes it as \ssp{base} to get base'

\documentclass{article}
\usepackage{scalerel}

\newcommand\scale[2]{\vstretch{#1}{\hstretch{#1}{#2}}}
\newcommand\ssp[1]{#1^{\scale{.6}{\scriptstyle\prime}}}

\begin{document}

\[
a {\scriptstyle a} {\scriptscriptstyle a} \quad
' {\scriptstyle '} %{\scriptscriptstyle '} 
{\scriptscriptstyle \ssp{\rule{0ex}{1ex}}}
\quad
a' {\scriptstyle a'} %{\scriptscriptstyle a'}
{\scriptscriptstyle \ssp{a}}
\]

\end{document}

enter image description here

Related Question