# How to align with respect to a symbol inside the argument of a command?

I would like to align several lines with respect to a symbol, say an equality sign, above which something else is written (using \overset), while taking that, what is written above the symbol, into account for spacing, like this:

However, I cannot put the "&" into the argument of \overset, as this seems to be syntactically forbidden. When placing it next to \overset, the lines are, of course, not aligned with respect to the equality sign:

I tried using \mathclap, which provides the alignment I want, but then the spacing gets too tight: Here is my minimal working example:

\documentclass[a4paper,12pt,fleqn]{article}

\usepackage[fleqn]{amsmath}
\usepackage{amsmath, amssymb, graphics, setspace}
\usepackage{latexsym}
\usepackage{mathtools}

\begin{document}

Placing "\&" next to overset:
\begin{alignat*}{1}
\textrm{some expression} & \overset{(23.1)}{=}\textrm{other expression}\\
& \overset{(1.3)}{=}\textrm{other expression}\\
& \overset{(2.4,3.5)}{=}\textrm{other expression}
\end{alignat*}

Using mathclap:
\begin{alignat*}{1}
\textrm{some expression} & \overset{\mathclap{(23.1)}}{=}\textrm{other expression}\\
& \overset{\mathclap{(1.3)}}{=}\textrm{other expression}\\
& \overset{\mathclap{(2.4,3.5)}}{=}\textrm{other expression}
\end{alignat*}

How I want it to look like:
\begin{alignat*}{1}
\end{alignat*}
Of course, adding spaces manually as done here is not a satisfactory solution to the problem.

\end{document}

• is the alignat a necessary environment for your purposes? if not, perhaps an arrangement using an array environment may help? e.g $\begin{array}{r@{}c@{}l} \textrm{some expression} & \overset{{(23.1)}}{=}&\textrm{other expression}\\ & \overset{{(1.3)}}{=}&\textrm{other expression}\\ & \overset{{(2.4,3.5)}}{=}&\textrm{other expression} \end{array}$ – cmhughes Feb 18 '16 at 12:19
• (looks like I was thinking along the same lines as Herbert) – cmhughes Feb 18 '16 at 12:20
• I chose the alignat environment because it is page-breakable and allows numbering single lines. If this is possible with array, then array is fine for me as well. – emilG Feb 18 '16 at 14:23

$\begin{array}{r@{}c@{}l} \textrm{some expression} & \overset{(23.1)}{=} &\textrm{other expression}\\ & \overset{(1.3)}{=} & \textrm{other expression}\\ & \overset{(2.4,3.5)}{=} &\textrm{other expression} \end{array}$


or for less space:

\begin{array}{r@{\kern-2pt}c@{\kern-2pt}l}


• Thanks, this works nicely. Is there a way to make this array environment page-breakable? – emilG Feb 18 '16 at 14:19
• Yes, but only in Text mode with a longtable. You have to use the $...$ Notation for math – user2478 Feb 18 '16 at 15:01

This uses a \tabularCenterstack from the tabstackengine package. Intercolumn width is controlled by \setstacktabulargap{0pt}. Interrow baselineskip is controlled by \setstackgap{L}{1.4\baselineskip}.

\documentclass[a4paper,12pt,fleqn]{article}

\usepackage[fleqn]{amsmath}
\usepackage{amsmath, amssymb, graphics, setspace}
\usepackage{latexsym}
\usepackage{mathtools}
\usepackage{tabstackengine}
\stackMath
\def\poverset{\protect\overset}
\setstackgap{L}{1.4\baselineskip}
\setstacktabulargap{0pt}
\begin{document}

Using \verb|\tabularCenterstack|:
$\tabularCenterstack{rcl}{ \textrm{some expression} & \poverset{(23.1)}{=}&\textrm{other expression}\\ & \poverset{(1.3)}{=}&\textrm{other expression}\\ & \poverset{(2.4,3.5)}{=}&\textrm{other expression} }$
\end{document}


• Thanks, this works nicely. Is there a way to make this tabularCenterstack environment page-breakable? – emilG Feb 18 '16 at 14:19