# How to get a small letter version of \mathcal{O} inside table caption

I have used the suggestion given in How to get a small letter version of \mathcal{O}, and it worked perfectly, except when \smallO is inside a table caption. How to overcome the nuisance?

• \protect\smallO with \smallO defined as in the linked question Apr 1, 2016 at 18:45
• Being a math letter, did you employ it as $\smallO$ (with the dollar signs)? Apr 1, 2016 at 18:45

the \mathchoice construct used in the linked answer would not work in a moving argument such as \caption so you would need
\caption{...$\protect\smallO{n}$....}

or use \DeclareRobustCommand instead of \newcommand to define \smallO.