包裹mathtools
提供垂直对齐t
op、c
enter 和b
ottom:
\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}
我想要获得的是关于“=”的顶部对齐和关于“ \label
”的底部对齐(以下示例中的数字 2):
如何实现这一点?
答案1
为什么不尝试这样的方法,“隐藏”第一行的宽度,并将等号放在后面&
,并且,对于组件来说multline
,放在范围内multline
?
输入:
\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}