I am defining a macro, and would like to run other macro's on any sub/superscripts given to it. For example, I would like to define it such that something like:
\myMacro_{lower}^{upper} -----> \operatorname{something}_\someMacro{lower}^\anotherMacro(upper)
Where both sub/super-scripts would be optional. How would this best be done?
Prior works:
Capture a macro's subscripts/superscripts by the macro provides a neat solution when we are just interested in a superscript.
How can I capture both superscripts and subscripts after a macro might be the correct solution to use, but it seems like it might be overly complex - is there a simpler solution that avoids adding the xparse package (as the first solution manages)?