6

Package mathtools provides the vertical alignments top, center, and bottom:

\documentclass{report}
\usepackage{amsmath}
\usepackage{mathtools}
\begin{document}

\makeatletter
\setlength{\@tempdimc}{\the\textwidth}
\settowidth{\@tempdima}{\hspace{2em}(\ref{equationA})}
\addtolength{\@tempdimc}{-\the\@tempdima}
\edef\somelength{\the\@tempdimc}
\makeatother

\begin{align}
  & \framebox[0.8\linewidth]{\strut} \\
= & \!%
\begin{multlined}[t][\somelength]
  \framebox[0.55\linewidth]{\strut} \\
  \framebox[0.55\linewidth]{\strut} 
\end{multlined}                     \label{equationA} \\
= & \!%
\begin{multlined}[c][\somelength]
  \framebox[0.55\linewidth]{\strut} \\
  \framebox[0.55\linewidth]{\strut} 
\end{multlined}                     \label{equationB} \\
= & \!%
\begin{multlined}[b][\somelength]
  \framebox[0.55\linewidth]{\strut} \\
  \framebox[0.55\linewidth]{\strut} 
\end{multlined}                     \label{equationC} \\
= & \framebox[0.8\linewidth]{\strut} 
\end{align}

\end{document}

current result of MWE

What I would like to get is top alignment regarding "=" and bottom alignment regarding the "\label" (number 2 in the following example):

wanted result

How can this be achieved?

2
  • Small comment: It isn't necessary to load amsmath explicitly; it is already loaded by mathtools. Commented Dec 6, 2013 at 14:01
  • You cannot with multlined, it only handles contents, not where the equation number is placed in relation to that content (that is handled by the outer env, here align).
    – daleif
    Commented Dec 6, 2013 at 14:51

1 Answer 1

1

why not try something like this, "hiding" the width of the first line and putting the equals signs after the &, and, in the case of the multline components, within the scope of multline?

enter image description here

the input:

\documentclass{report}
\usepackage{mathtools}
\begin{document}

\begin{align}
 \rlap{\framebox[0.8\linewidth]{\strut}}\quad \\
 &\begin{multlined}[b][.8\textwidth]
  = \framebox[0.55\linewidth]{\strut} \\
  \framebox[0.55\linewidth]{\strut} 
\end{multlined}                     \label{equationA} \\
 &= \framebox[0.8\linewidth]{\strut} 
\end{align}

\end{document}
2
  • 1
    @Stephen -- i must admit, i find that aligning the beginning of the line that precedes the first equals sign in a displayed equation to be counter-intuitive. it isn't the style recommended in swanson's "mathematics into type" (section 3.35), which is how i was trained. Commented Dec 6, 2013 at 18:48
  • Well, yes, \framebox[0.1\linewidth]{\strut} & \rlap{$ {} = \framebox[0.7\linewidth]{\strut} $}` proved to be the better solution. Thanks for the hint! Before \begin{multlined} a \! is necessary to counter an intern \, in multlined.
    – Stephen
    Commented Dec 6, 2013 at 19:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .