我有以下内容
\documentclass[12pt,a4paper]{article}
\begin{document}
\begin{align}
a_{m,m} &\overset{(\eqref{eq:masssplitAIndex},\eqref{eq:masssplitLinvIndex})}{=} 1 - a \\
&\overset{
\substack{\eqref{eq:masssplitLinvIndex} \\ % too much space here
\hphantom{\meqref{eq:masssplitAIndex,eq:masssplitLinvIndex}}
}
}
}{=} 1 - a.
\end{align}
\结束{文档}
将幻影框堆叠(零跳过)在图中(0.33)上方以使等号的间距正确的正确解决方案是什么?)
答案1
以下示例使用\stackrel
将引用放在等号上方。第二行的虚线是通过设置的,\ooalign
以避免明确测量上一个等式的引用。
\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{hyperref}
\numberwithin{equation}{section}
\begin{document}
\setcounter{equation}{32}
\begin{gather}
\label{eq:masssplitLinvIndex}
\text{mass split L inv index}
\\
\label{eq:masssplitAtIndex}
\text{mass split at index}
\end{gather}
\begin{align}
a_{m,m}
& \stackrel{(\ref{eq:masssplitAtIndex},\,\ref{eq:masssplitLinvIndex})}{=}
1
\\
& \stackrel{%
\ooalign{%
\phantom{%
$\scriptstyle
(\ref{eq:masssplitAtIndex},\,\ref{eq:masssplitLinvIndex})$%
}\cr
\hfil$\scriptstyle(\ref{eq:masssplitLinvIndex})$\hfil
}%
}{=}
1
\end{align}
\end{document}
答案2
您可以alignat
与 hack 一起使用来使列内容居中:
\documentclass{article}
\usepackage{amsmath,amssymb}
\numberwithin{equation}{section}
\makeatletter
\newcommand{\Cen}[2]{%
\ifmeasuring@
#2%
\else
\makebox[\ifcase\expandafter #1\maxcolumn@widths\fi]{$\displaystyle#2$}%
\fi
}
\makeatother
\begin{document}
\setcounter{equation}{32}
\begin{gather}
x\label{eq:masssplitAIndex}\\
y\label{eq:masssplitLinvIndex}
\end{gather}
Now the main thing:
\begin{alignat}{2}
a_{m,m} &\Cen{2}{\overset{(\ref{eq:masssplitAIndex},\ref{eq:masssplitLinvIndex})}{=}{}} && 1 - a \\
&\Cen{2}{\overset{\eqref{eq:masssplitLinvIndex}}{=}}&& 1 - a.
\end{alignat}
\end{document}
看https://tex.stackexchange.com/a/209732/4427为了\Cen
然而,我更喜欢简单一点的东西:
\begin{alignat}{2}
a_{m,m} &= 1-a &&\qquad\text{by (\ref{eq:masssplitAIndex}, \ref{eq:masssplitLinvIndex})} \\
&= 1-a &&\qquad\text{by \eqref{eq:masssplitLinvIndex}}
\end{alignat}