# Superscript size when using reflected glyphs

I want to use a reflected $\Gamma$ symbol as a superscript in math mode. I am using \reflectbox from graphicx package to declare a macro for reflected symbol and it works in normal size (math) mode.

However, when I try to use the macro as a superscript, the reflected symbol does not scale appropriately. What can be done?

\documentclass{article}

\usepackage{xparse}
\usepackage{graphicx}
\usepackage{mathtools}

\DeclareDocumentCommand{\GammaInv}  {        } { \reflectbox{$\Gamma$} }

\begin{document}
\begin{align*}
% regular letter superscript
L^{\Gamma} \\
% reflected letter superscript (does not scale down as expected)
L^{\GammaInv}
\end{align*}
\end{document}


You have to use \mathpalette:

\documentclass{article}

\usepackage{xparse}
\usepackage{graphicx}
\usepackage{mathtools}

\NewDocumentCommand{\GammaInv}{}{\mathpalette\doGammaInv\relax}
\makeatletter
\NewDocumentCommand{\doGammaInv}{mm}{%
\reflectbox{$\m@th#1\Gamma$}%
}
\makeatother

\begin{document}
\begin{align*}
% regular letter superscript
L^{\Gamma} \\
% reflected letter superscript (does not scale down as expected)
L^{\GammaInv}
\end{align*}
\end{document}


The \mathpalette macro wants two arguments: the first is an auxiliary macro which will receive as first argument a math style selection. The second one can be used for variable input, an example follows.