[Tex/LaTex] Problem with \mathpalette and \mathchoice

math-modesubscriptstex-core

When working on an additional answer to this question of mine, I stumbled across the following problem with \mathpalette. For simplicity I give an example where in practice it is ridiculous to use \mathpalette: \mathpalette{}{B}_b gives the output , whereas the straightforward B_b gives . Note that in the latter version the subscript is closer to the "B", which is good. If instead of \mathpalette one uses the version \mathchoice{B}{B}{B}{B}_b, one (of course) has the same problem.

Is there a way around this problem? (I mean other than \mathpalette{}{B_b}, which is not an option for what I need.)

Best Answer

Short answer: no. If you use \mathchoice, this is unavoidable.

Luatex offers a way to do \mathstyle-based typesetting without having to fall back on \mathchoice, see my answer to this question for details.

Related Question