The link the-mysteries-of-mathpalette gives a nice overview of the mathpalette command. My question is pseudo-related. Is there a version of mathpalette where instead of "preserving the font size" it "preserves the font style"?
For example_practicality, the underline command \underline
has the property that any math written within it preserves the fontstyle (e.g. \mathit, \mathtt, \mathrm) but the underbracket command \underbracket[rule thickness][bracket height]{arg}
does not have this feature. I wish to make my own custom version of underbracket which mimics the underline command in this regard. If the mathpalette-version exists (I suspect not after a quick internet search), then I can see a way to get the desired code. Any suggestion is welcome.