5

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}
5

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}

enter image description here

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.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.