0

MWE:

\documentclass{article}
\usepackage{xcolor}

\begin{document} $M_{\theta}$ % correct size theta $M_{\rlap{\ensuremath{\theta}}}$ % too large theta \end{document}

enter image description here Why does this happen? How can I fix it? In my case the \rlap is inisede a command that I would like to work inside and outside of supscripts and superscripts:

\documentclass{article}
\usepackage{xcolor}
\newcommand{\rlaptheta}{\rlap{\ensuremath{\theta}}} % I would like the command to work both in normal mode as well as in subscript or superscruit

\begin{document} $M_{\theta}$ % correct size theta $M_{\rlap{\ensuremath{\theta}}}$ % too large theta

$M_{\rlaptheta}$ % too large theta

$\theta\rlaptheta$ %correct size

%The same for superscripts $M^{\theta}$ % correct size theta $M^{\rlaptheta}$ % too large theta \end{document}

enter image description here

Jakob
  • 993
  • 3
    Always been like that. \rlap is thought to be for text and does not scale in subscripts. Use \mathrlap from the mathtools package. – campa Nov 16 '23 at 13:54
  • The definition of \rlap is \def\rlap#1{\hbox to 0pt{#1\hss}}. Note that the <stuff> in M_{\hbox{$<stuff>$}} won't get subscript size unless you specify \scriptstyle explicitly. – Stephen Nov 16 '23 at 13:59
  • Yes, thank you, this answers my question. – Jakob Nov 16 '23 at 14:01

0 Answers0