回忆录中框架环境的大小

回忆录中框架环境的大小

我正在使用 memoir 包和“framed”环境。垂直白色间距似乎因单个方程式或“多行”环境而异。请比较这两个快照:

在此处输入图片描述

在此处输入图片描述

在第二种情况下,最上面的字符(本例中为“1”)到框架的垂直距离较大。因此,我的问题是如何使两种情况下的垂直白色区域具有完全相同的高度?

这是我的代码:

\documentclass[11pt,a4paper,onecolumn,openright,final]{memoir}
%===============================================
\settrims{0.cm}{0.cm}
\setbinding{1cm} % space for binding
\setlrmarginsandblock{*}{3cm}{1} % spine = edge. Edge=3cm
\setulmarginsandblock{3cm}{*}{1} % upper=lower. Upper=3cm
\checkandfixthelayout
\pagestyle{empty}
%===============================================
\usepackage[]{stix,amsmath}
\renewcommand{\vec}[1]{\mathbf{#1}}
%===============================================
 \begin{document}
 Compare different spacing here
 \begin{framed}
 \begin{equation}
 \xi^{(1)}(\vec r)=\frac1{\omega^2}\Big(\vec\nabla n(\vec r)\cdot\vec \nabla\varphi^{(0)}(\vec r)
-n(\vec r)\Delta\varphi^{(0)}(\vec r)\Big)\label{eq:xi1}
\end{equation}
\end{framed}
\noindent and  here
\begin{framed}
\begin{multline}
\xi^{(2)}(\vec r)=\frac1{2\omega^4}\vec\nabla\cdot
\Big(\vec\nabla\varphi^{(1)}(\vec r)\left[n(\vec r)\Delta \varphi^{(1)}(\vec r)
+\big(\nabla\varphi^{(1)}(\vec r)\cdot\nabla n(\vec r)\big)\right]\\
+\frac14 n(\vec r)\vec\nabla\big(\vec\nabla\varphi^{(1)}(\vec  r)\big)^2\Big).\label{eq:xi2}
\end{multline}
\end{framed}
\end{document}

先感谢您!

答案1

较长的评论。似乎如果你添加控制\abovedisplayskip,那么它实际上multline是最糟糕的。无论如何,我几乎从不使用它,我倾向于align在大多数情况下使用它并将其与\MoveEqLeft`mathtools 结合使用。以下是比较。

\documentclass[11pt,a4paper,onecolumn,openright,final]{memoir}
%===============================================
\settrims{0.cm}{0.cm}
\setbinding{1cm} % space for binding
\setlrmarginsandblock{*}{3cm}{1} % spine = edge. Edge=3cm
\setulmarginsandblock{3cm}{*}{1} % upper=lower. Upper=3cm
\checkandfixthelayout
\pagestyle{empty}
%===============================================
\usepackage[]{stix,amsmath}
\renewcommand{\vec}[1]{\mathbf{#1}}
%===============================================

\newenvironment{mytest}{%
  \framed%
  \abovedisplayskip=\abovedisplayshortskip%
  \belowdisplayskip=\belowdisplayshortskip%
}{\endframed}

\FrameSep=0pt

 \begin{document}
 Compare different spacing here
 \begin{mytest}
 \begin{equation}
 \xi^{(1)}(\vec r)=\frac1{\omega^2}\Big(\vec\nabla n(\vec r)\cdot\vec \nabla\varphi^{(0)}(\vec r)
-n(\vec r)\Delta\varphi^{(0)}(\vec r)\Big)\label{eq:xi1}
\end{equation}
\end{mytest}
align
\begin{mytest}
\begin{align}
 \xi^{(1)}(\vec r)=\frac1{\omega^2}\Big(\vec\nabla n(\vec r)\cdot\vec \nabla\varphi^{(0)}(\vec r)
-n(\vec r)\Delta\varphi^{(0)}(\vec r)\Big)\label{eq:xi1}
\\
\text{second}
\end{align}
\end{mytest}
gather
\begin{mytest}
\begin{gather}
 \xi^{(1)}(\vec r)=\frac1{\omega^2}\Big(\vec\nabla n(\vec r)\cdot\vec \nabla\varphi^{(0)}(\vec r)
-n(\vec r)\Delta\varphi^{(0)}(\vec r)\Big)\label{eq:xi1}
\\
\text{second}
\end{gather}
\end{mytest}
multline
\begin{mytest}
\begin{multline}
 \xi^{(1)}(\vec r)=\frac1{\omega^2}\Big(\vec\nabla n(\vec r)\cdot\vec \nabla\varphi^{(0)}(\vec r)
-n(\vec r)\Delta\varphi^{(0)}(\vec r)\Big)\label{eq:xi1}
\\
\text{second}
\end{multline}
\end{mytest}

\end{document}

在此处输入图片描述

相关内容