My question is closely related to How do you get a scriptscriptstyle-sized prime? However, I don't know how to use the answer to that question to solve my problem.
In the first line of the sample output below, I'm using '
in various contexts which are presumably determining whether the rendered prime will be in subscriptstyle
, scriptscriptstyle
, etc. This works fine until I get to a certain level of nesting, at which point the prime doesn't get any smaller, as is the case with the fourth '
. (I believe primes #2 and #3 are, and should be, the same size.)
This behaviour is nicely explained by @egreg in the earlier question: basically '
is equivalent to ^{\prime}
, so one gets a scriptscriptstyle
prime in scriptstyle and the same in
scriptscriptstyle`.
What I would like is for prime #4 to be scaled accordingly, and the earlier question proposes a solution. However I'm not sure how to adapt that solution so that the scaling is automatic: I'd like to be able to use '
(or some suitable macro) uniformly in my definitions, and have the the resulting prime be rendered at the appropriate size, as determined by the context.
The second line of output shows what happens when I naively adopt the solution from the earlier question. The behaviour seems wrong: the first prime is too small, and prime #4 is still too big.
\documentclass{article}
\usepackage{amsmath}
\usepackage{scalerel}
\newcommand\scale[2]{\vstretch{#1}{\hstretch{#1}{#2}}}
\newcommand\ssp[1]{#1^{\scale{.6}{\scriptstyle\prime}}}
\begin{document}
\[
\ssp{a} \quad E^{\ssp{a}}
\xrightarrow{\ssp{a} \quad E^{\ssp{a}}}
\]
\[
a' \quad E^{a'}
\xrightarrow{a' \quad E^{a'}}
\]
\end{document}
How do I adapt the solution from the earlier question to give me relative scaling? I tried removing the explicit \scriptstyle
from the definition of \ssp
; then prime #4 looks right, but #2 and #3 look wrong.
a^{a^{a^{a^{a}}}}
Thea
get no smaller after subsubscript size, would you really want just the primes to get smaller? why?