I am aware of Align in Substack, but I am trying another solution and would like to understand why it is not working:

\newcommand{\before}{k_\rho k_\rho k_\rho k_\rho}%
%\substack{% <-- uncomment this line
%}% <-- uncomment this line

First of all, alignment is working fine in a multline or align. But in a substack, it is not, the = are not aligned.

  • \settowidth{\mylength}{$\before$} does the same, by the way. – bers Oct 23 '14 at 18:07

It is the same as comparing $X_{a=b}$ with $X_{\mbox{$a=b$}}$ If you start a new math expression inside a box it will be textsize even if you are in a subscript. Explicitly adding \scriptstyle gets you back on track.

\newcommand{\before}{\scriptstyle k_\rho k_\rho k_\rho k_\rho}
\substack{% <-- uncomment this line
}% <-- uncomment this line
  • Awesome, thank you. I had suspected something like this, but my test with \LARGE worked as expected (LARGE font size was respected in settowidth). I was not aware there is a difference between text and subscript other than font size that might not be respected implicitly. – bers Oct 23 '14 at 18:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.