Following this question, I'm having problems when using the accepted answer on subscripts.
\[
A_ {z {_{y}^{x}} {_{x}^{y}} } \qquad
{z {_{y}^{x}} {_{x}^{y}} }
\]
I don't know why, when in a subscript, the alignement/centering messes up.
I've also tried other options. I'll comment them a bit.
- \atop , \genfrac and \above
\[
A_ {z {x \atop y} {y \atop x} } \qquad
{z {x \atop y} {y \atop x} }
\]
\[
A_ {z {\genfrac{}{}{0pt}{2}{x}{y}} {\genfrac{}{}{0pt}{2}{y}{x}} } \qquad
{z {\genfrac{}{}{0pt}{2}{x}{y}} {\genfrac{}{}{0pt}{2}{y}{x}} }
\]
\[
A_ {z {x \above 0pt y} {y \above 0pt x} } \qquad
{z {x \above 0pt y} {y \above 0pt x} }
\]
They seem to render exactly the same. They have too much blank space.
- \stackanchor from "stackengine" package
\stackMath
\[
A_ {z {\stackanchor{x}{y}} {\stackanchor{y}{x}} } \qquad
{z {\stackanchor{x}{y}} {\stackanchor{y}{x}} }
\]
In both cases, it's misaligned. In the subscript, it's not the right size,
- \overset from "mathtools" package and \stackrel
\[
A_ {z {\overset{x}{y}} {\overset{y}{x}} } \qquad
{z {\overset{x}{y}} {\overset{y}{x}} }
\]
\[
A_ {z {\stackrel{x}{y}} {\stackrel{y}{x}} } \qquad
{z {\stackrel{x}{y}} {\stackrel{y}{x}} }
\]
They seem to render exactly the same. In both cases, not centered, neither the correct size.
By "aligned" I mean "$xy$ alignment", so "misaligned" refers to anything else.
There's no need that it renders strictly perfect aligned, centered or sized: something close will do.
Desired output:
Best Answer
Do you want to stack the objects? In this case a version of
\atop
can do it (using\genfrac
, of course). The trick is to force\textstyle
when the object is found in\displaystyle
, otherwise the standard action is good.