\hbox overrides setting of \displaystyle inside the box
In
\hbox{$\displaystyle \sum_n$}
the inner \displaystyle
is ignored. (Actually, it is not quite ignored, but its displaystyle="true"
is changed to "displaystyle="false"
as can be seen in the "Show Math As MML" menu item.)
This is due to a problem in the InternalMath()
function in the TeX input Jax. In addition to mixing up the displaystyle, that routine also fails to group some output properly, so that
2^\hbox{x$x$}
produces the same result as
2^\hbox{x}{x}
where the second "x" is not in the superscript.