I'm trying to make sense of the \mathpalette
code used in this answer. To repeat it below:
\makeatletter
\newcommand{\raisemath}[1]{\mathpalette{\raisem@th{#1}}}
\newcommand{\raisem@th}[3]{\raisebox{#1}{$#2#3$}}
\makeatother
$\Pi_{\raisemath{2pt}{-}}$
When I did \tracingmacros=1
, the interesting part of the log file was:
\raisemath #1->\mathpalette {\raisem@th {#1}}
#1<-2pt
\mathpalette #1#2->\mathchoice {#1\displaystyle {#2}}{#1\textstyle {#2}}
{#1\scriptstyle {#2}}{#1\scriptscriptstyle {#2}}
#1<-\raisem@th {2pt}
#2<--
\raisem@th #1#2#3->\raisebox {#1}{$#2#3$}
#1<-2pt
#2<-\displaystyle
#3<--
etc...
\raisem@th #1#2#3->\raisebox {#1}{$#2#3$}
#1<-2pt
#2<-\textstyle
#3<--
etc...
From the code \mathpalette{\raisem@th{#1}}
in the definition of \raisemath
, I'd think that \mathpalette
only is given one parameter in this instance, \raisem@th{2pt}
. So, how does the second parameter, -
, end up being passed to \mathpalette
?