amsmath 的“gather”环境存在问题

amsmath 的“gather”环境存在问题

我有很多数学题要写,所以我尝试使用aligninside gather。当列结束时,我得到了 badboxes。所以我使用了两个gather环境,输出很奇怪。发生了什么事,为什么?我该如何解决这个问题?

\documentclass[12pt]{article}
\usepackage[top=0.3in, bottom=1.2in, left=0.8in, right=0.8in]{geometry}

\usepackage{multicol}

\usepackage[utf8]{inputenc}

\setlength{\parindent}{0cm}

\usepackage{setspace}

\usepackage{xltxtra}
\usepackage{xgreek}
\setmainfont[Mapping=tex-text]{GFSDidot.otf}
\setsansfont[Mapping=tex-text]{GFSDidot.otf}

\usepackage[fleqn]{amsmath}
\usepackage{unicode-math}

\setlength{\mathindent}{0cm}



\newcommand{\3}{\vspace{0.3cm}}

\title{}
\author{}
\date{}

\begin{document}

\begin{multicols*}{2}

\begin{gather*}
\begin{aligned}
&\text{70}\\
&e^{jz}=\cos z+j\sin z\\
&\cos z=(1/2)(2\cos z)=\\
&=(1/2)(2\cos z+j\sin z-j\sin z)=\\
&=(1/2)(\cos z+j\sin z+\cos z-j\sin z)=\\
&=(1/2)(e^{jz}+e^{-jz})
\end{aligned}\\
\begin{aligned}
&\text{207}\\
&x(t)=A_{c}\cos \theta(t)\\
&\theta(t)=2\pi f_{c}t+\phi(t)\\
&\phi(t)=K_{p}m(t)\\
&x(t)=A_{c}\cos[2\pi f_{c}t+K_{p}m(t)]
\end{aligned}\\
\begin{aligned}
&\text{208}\\
&x(t)=A_{c}\cos \theta(t)\\
&\theta(t)=2\pi f_{c}t+\phi(t)\\
&\frac{d\phi(t)}{dt}=2\pi K_{f}m(t)\Rightarrow\\
&\Rightarrow \phi(t)=2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau\\
&x(t)=A_{c}\cos\left[2\pi f_{c}t+2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau\right]
\end{aligned}\\
\begin{aligned}
&\text{208}\\
&x(t)=A_{c}\cos\theta(t)=A_{c}\cos[2\pi f_{c}t+\phi(t)]\\
&\cos(a+b)=\cos a \cos b-\sin a \sin b\\
&\phi(t)=K_{p}m(t)\\
&\phi(t)=2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau
\end{aligned}\\
\begin{aligned}
&\text{265}\\
&g(t)=f(t)\ast h(t)=\int\limits_{-\infty}^{\infty}f(\tau)h(t-\tau)d\tau\\
&j(t)=\sum\limits_{k=-\infty}^{\infty}\delta(t-kT_{s})\Rightarrow\\
&\Rightarrow \mathcal{F}[j(t)]=\sum\limits_{k=-\infty}^{\infty}\mathcal{F}[\delta(t)]e^{j2\pi fkT_{s}}\\
&=\sum\limits_{k=-\infty}^{\infty}e^{j2\pi fkT_{s}}
\end{aligned}
\end{gather*}

\end{multicols*}

\end{document}

在此处输入图片描述

\documentclass[12pt]{article}
\usepackage[top=0.3in, bottom=1.2in, left=0.8in, right=0.8in]{geometry}

\usepackage{multicol}

\usepackage[utf8]{inputenc}

\setlength{\parindent}{0cm}

\usepackage{setspace}

\usepackage{xltxtra}
\usepackage{xgreek}
\setmainfont[Mapping=tex-text]{GFSDidot.otf}
\setsansfont[Mapping=tex-text]{GFSDidot.otf}

\usepackage[fleqn]{amsmath}
\usepackage{unicode-math}

\setlength{\mathindent}{0cm}



\newcommand{\3}{\vspace{0.3cm}}

\title{}
\author{}
\date{}

\begin{document}

\begin{multicols*}{2}

\begin{gather*}
\begin{aligned}
&\text{70}\\
&e^{jz}=\cos z+j\sin z\\
&\cos z=(1/2)(2\cos z)=\\
&=(1/2)(2\cos z+j\sin z-j\sin z)=\\
&=(1/2)(\cos z+j\sin z+\cos z-j\sin z)=\\
&=(1/2)(e^{jz}+e^{-jz})
\end{aligned}\\
\begin{aligned}
&\text{207}\\
&x(t)=A_{c}\cos \theta(t)\\
&\theta(t)=2\pi f_{c}t+\phi(t)\\
&\phi(t)=K_{p}m(t)\\
&x(t)=A_{c}\cos[2\pi f_{c}t+K_{p}m(t)]
\end{aligned}\\
\begin{aligned}
&\text{208}\\
&x(t)=A_{c}\cos \theta(t)\\
&\theta(t)=2\pi f_{c}t+\phi(t)\\
&\frac{d\phi(t)}{dt}=2\pi K_{f}m(t)\Rightarrow\\
&\Rightarrow \phi(t)=2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau\\
&x(t)=A_{c}\cos\left[2\pi f_{c}t+2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau\right]
\end{aligned}\\
\begin{aligned}
&\text{208}\\
&x(t)=A_{c}\cos\theta(t)=A_{c}\cos[2\pi f_{c}t+\phi(t)]\\
&\cos(a+b)=\cos a \cos b-\sin a \sin b\\
&\phi(t)=K_{p}m(t)\\
&\phi(t)=2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau
\end{aligned}\\
\end{gather*}
\begin{gather*}
\begin{aligned}
&\text{265}\\
&g(t)=f(t)\ast h(t)=\int\limits_{-\infty}^{\infty}f(\tau)h(t-\tau)d\tau\\
&j(t)=\sum\limits_{k=-\infty}^{\infty}\delta(t-kT_{s})\Rightarrow\\
&\Rightarrow \mathcal{F}[j(t)]=\sum\limits_{k=-\infty}^{\infty}\mathcal{F}[\delta(t)]e^{j2\pi fkT_{s}}\\
&=\sum\limits_{k=-\infty}^{\infty}e^{j2\pi fkT_{s}}
\end{aligned}
\end{gather*}

\end{multicols*}

\end{document}

在此处输入图片描述

编辑一:

这是评论中提出的输出\raggedcolumns,显然第一列剩余空间以及第一列和第二列之间的高度差存在问题。另外,我不明白为什么环境会出现问题gather

\documentclass[12pt]{article}
\usepackage[top=0.3in, bottom=1.2in, left=0.8in, right=0.8in]{geometry}

\usepackage{multicol}

\usepackage[utf8]{inputenc}

\setlength{\parindent}{0cm}

\usepackage{setspace}

\usepackage{xltxtra}
\usepackage{xgreek}
\setmainfont[Mapping=tex-text]{GFSDidot.otf}
\setsansfont[Mapping=tex-text]{GFSDidot.otf}

\usepackage[fleqn]{amsmath}
\usepackage{unicode-math}

\setlength{\mathindent}{0cm}

\newcommand{\3}{\vspace{0.3cm}}

\title{}
\author{}
\date{}

\begin{document}
\raggedcolumns

\begin{multicols*}{2}

\begin{gather*}
\begin{aligned}
&\text{70}\\
&e^{jz}=\cos z+j\sin z\\
&\cos z=(1/2)(2\cos z)=\\
&=(1/2)(2\cos z+j\sin z-j\sin z)=\\
&=(1/2)(\cos z+j\sin z+\cos z-j\sin z)=\\
&=(1/2)(e^{jz}+e^{-jz})
\end{aligned}\\
\begin{aligned}
&\text{207}\\
&x(t)=A_{c}\cos \theta(t)\\
&\theta(t)=2\pi f_{c}t+\phi(t)\\
&\phi(t)=K_{p}m(t)\\
&x(t)=A_{c}\cos[2\pi f_{c}t+K_{p}m(t)]
\end{aligned}\\
\begin{aligned}
&\text{208}\\
&x(t)=A_{c}\cos \theta(t)\\
&\theta(t)=2\pi f_{c}t+\phi(t)\\
&\frac{d\phi(t)}{dt}=2\pi K_{f}m(t)\Rightarrow\\
&\Rightarrow \phi(t)=2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau\\
&x(t)=A_{c}\cos\left[2\pi f_{c}t+2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau\right]
\end{aligned}\\
\begin{aligned}
&\text{208}\\
&x(t)=A_{c}\cos\theta(t)=A_{c}\cos[2\pi f_{c}t+\phi(t)]\\
&\cos(a+b)=\cos a \cos b-\sin a \sin b\\
&\phi(t)=K_{p}m(t)\\
&\phi(t)=2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau
\end{aligned}\\
\end{gather*}
\begin{gather*}
\begin{aligned}
&\text{265}\\
&g(t)=f(t)\ast h(t)=\int\limits_{-\infty}^{\infty}f(\tau)h(t-\tau)d\tau\\
&j(t)=\sum\limits_{k=-\infty}^{\infty}\delta(t-kT_{s})\Rightarrow\\
&\Rightarrow \mathcal{F}[j(t)]=\sum\limits_{k=-\infty}^{\infty}\mathcal{F}[\delta(t)]e^{j2\pi fkT_{s}}\\
&=\sum\limits_{k=-\infty}^{\infty}e^{j2\pi fkT_{s}}
\end{aligned}
\end{gather*}

\end{multicols*}

\end{document}

在此处输入图片描述

答案1

使用这种方法,我将每个块构建为一个堆栈(上面和下面都有一个 3pt 缓冲区),然后\vspace{2ex}\par\vfil在每个块后插入一个。这2ex是块之间的最小间隙,并且\vfil将平滑整个列的外观(请参阅\vfil答案第二部分中没有此方法的替代方法)。在多页列表中的最后一项之后,您可以添加一个 final\vfil以避免部分填充的列产生过多的间隙。

在一个块内,项目间的间隙由 预先指定\setstackgap{S}{6pt}。块不会跨列或页边界一分为二,但\vfil解决方案使这种情况看起来不那么令人反感。

\documentclass[12pt]{article}
\usepackage[top=0.3in, bottom=1.2in, left=0.8in, right=0.8in]{geometry}

\usepackage{multicol}

\usepackage[utf8]{inputenc}

\setlength{\parindent}{0cm}

\usepackage{setspace}

\usepackage{xltxtra}
\usepackage{xgreek}
\setmainfont[Mapping=tex-text]{GFSDidot.otf}
\setsansfont[Mapping=tex-text]{GFSDidot.otf}

%\usepackage[fleqn]{amsmath}
\usepackage{amsmath}
\usepackage{unicode-math}

%\setlength{\mathindent}{0cm}

\newcommand{\3}{\vspace{0.3cm}}

\title{}
\author{}
\date{}
\usepackage[usestackEOL]{stackengine}
\stackMath
\def\stackalignment{l}
\setstackgap{S}{6pt}
\def\SS#1{\noindent\addstackgap[3pt]{\Shortstack{#1}}\vspace{2ex}\par\vfil}
\begin{document}

\begin{multicols*}{2}
Preceding text\par
\SS{
\text{70}\\
e^{jz}=\cos z+j\sin z\\
\cos z=(1/2)(2\cos z)=\\
=(1/2)(2\cos z+j\sin z-j\sin z)=\\
=(1/2)(\cos z+j\sin z+\cos z-j\sin z)=\\
=(1/2)(e^{jz}+e^{-jz})
}
\SS{
\text{70}\\
e^{jz}=\cos z+j\sin z\\
\cos z=(1/2)(2\cos z)=\\
=(1/2)(2\cos z+j\sin z-j\sin z)=\\
=(1/2)(\cos z+j\sin z+\cos z-j\sin z)=\\
=(1/2)(e^{jz}+e^{-jz})
}
\SS{
\text{207}\\
x(t)=A_{c}\cos \theta(t)\\
\theta(t)=2\pi f_{c}t+\phi(t)\\
\phi(t)=K_{p}m(t)\\
x(t)=A_{c}\cos[2\pi f_{c}t+K_{p}m(t)]
}
\SS{
\text{208}\\
x(t)=A_{c}\cos \theta(t)\\
\theta(t)=2\pi f_{c}t+\phi(t)\\
\dfrac{d\phi(t)}{dt}=2\pi K_{f}m(t)\Rightarrow\\
\Rightarrow \phi(t)=2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau\\
x(t)=A_{c}\cos\left[2\pi f_{c}t+2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau\right]
}
\SS{
\text{208}\\
x(t)=A_{c}\cos\theta(t)=A_{c}\cos[2\pi f_{c}t+\phi(t)]\\
\cos(a+b)=\cos a \cos b-\sin a \sin b\\
\phi(t)=K_{p}m(t)\\
\phi(t)=2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau
}
\SS{
\text{208}\\
x(t)=A_{c}\cos\theta(t)=A_{c}\cos[2\pi f_{c}t+\phi(t)]\\
\cos(a+b)=\cos a \cos b-\sin a \sin b\\
\phi(t)=K_{p}m(t)\\
\phi(t)=2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau
}
\SS{
\text{208}\\
x(t)=A_{c}\cos\theta(t)=A_{c}\cos[2\pi f_{c}t+\phi(t)]\\
\cos(a+b)=\cos a \cos b-\sin a \sin b\\
\phi(t)=K_{p}m(t)\\
\phi(t)=2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau
}
\SS{
\text{265}\\
g(t)=f(t)\ast h(t)=\int\limits_{-\infty}^{\infty}f(\tau)h(t-\tau)d\tau\\
j(t)=\sum\limits_{k=-\infty}^{\infty}\delta(t-kT_{s})\Rightarrow\\
\Rightarrow \mathcal{F}[j(t)]=\sum\limits_{k=-\infty}^{\infty}\mathcal{F}[\delta(t)]e^{j2\pi fkT_{s}}\\
=\sum\limits_{k=-\infty}^{\infty}e^{j2\pi fkT_{s}}
}
\SS{
\text{265}\\
g(t)=f(t)\ast h(t)=\int\limits_{-\infty}^{\infty}f(\tau)h(t-\tau)d\tau\\
j(t)=\sum\limits_{k=-\infty}^{\infty}\delta(t-kT_{s})\Rightarrow\\
\Rightarrow \mathcal{F}[j(t)]=\sum\limits_{k=-\infty}^{\infty}\mathcal{F}[\delta(t)]e^{j2\pi fkT_{s}}\\
=\sum\limits_{k=-\infty}^{\infty}e^{j2\pi fkT_{s}}
}
\vfil
\end{multicols*}

\end{document}

在此处输入图片描述


替代方法(无\vfil块间)

如果不喜欢均匀分布的垂直柱,而喜欢柱底部有较大的间隙,那么定义

\def\SS#1{\noindent\addstackgap[3pt]{\Shortstack{#1}}\\}

似乎解决了这个问题(并且还在每个堆栈上方/下方添加了一个 3pt 缓冲区),如下所示

\documentclass[12pt]{article}
\usepackage[top=0.3in, bottom=1.2in, left=0.8in, right=0.8in]{geometry}

\usepackage{multicol}

\usepackage[utf8]{inputenc}

\setlength{\parindent}{0cm}

\usepackage{setspace}

\usepackage{xltxtra}
\usepackage{xgreek}
\setmainfont[Mapping=tex-text]{GFSDidot.otf}
\setsansfont[Mapping=tex-text]{GFSDidot.otf}

%\usepackage[fleqn]{amsmath}
\usepackage{amsmath}
\usepackage{unicode-math}

%\setlength{\mathindent}{0cm}

\newcommand{\3}{\vspace{0.3cm}}

\title{}
\author{}
\date{}
\usepackage[usestackEOL]{stackengine}
\stackMath
\def\stackalignment{l}
\setstackgap{S}{6pt}
\def\SS#1{\noindent\addstackgap[3pt]{\Shortstack{#1}}\\}
\begin{document}

\begin{multicols*}{2}
\SS{
\text{70}\\
e^{jz}=\cos z+j\sin z\\
\cos z=(1/2)(2\cos z)=\\
=(1/2)(2\cos z+j\sin z-j\sin z)=\\
=(1/2)(\cos z+j\sin z+\cos z-j\sin z)=\\
=(1/2)(e^{jz}+e^{-jz})
}
\SS{
\text{70}\\
e^{jz}=\cos z+j\sin z\\
\cos z=(1/2)(2\cos z)=\\
=(1/2)(2\cos z+j\sin z-j\sin z)=\\
=(1/2)(\cos z+j\sin z+\cos z-j\sin z)=\\
=(1/2)(e^{jz}+e^{-jz})
}
\SS{
\text{207}\\
x(t)=A_{c}\cos \theta(t)\\
\theta(t)=2\pi f_{c}t+\phi(t)\\
\phi(t)=K_{p}m(t)\\
x(t)=A_{c}\cos[2\pi f_{c}t+K_{p}m(t)]
}
\SS{
\text{208}\\
x(t)=A_{c}\cos \theta(t)\\
\theta(t)=2\pi f_{c}t+\phi(t)\\
\dfrac{d\phi(t)}{dt}=2\pi K_{f}m(t)\Rightarrow\\
\Rightarrow \phi(t)=2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau\\
x(t)=A_{c}\cos\left[2\pi f_{c}t+2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau\right]
}
\SS{
\text{265}\\
g(t)=f(t)\ast h(t)=\int\limits_{-\infty}^{\infty}f(\tau)h(t-\tau)d\tau\\
j(t)=\sum\limits_{k=-\infty}^{\infty}\delta(t-kT_{s})\Rightarrow\\
\Rightarrow \mathcal{F}[j(t)]=\sum\limits_{k=-\infty}^{\infty}\mathcal{F}[\delta(t)]e^{j2\pi fkT_{s}}\\
=\sum\limits_{k=-\infty}^{\infty}e^{j2\pi fkT_{s}}
}
\SS{
\text{265}\\
g(t)=f(t)\ast h(t)=\int\limits_{-\infty}^{\infty}f(\tau)h(t-\tau)d\tau\\
j(t)=\sum\limits_{k=-\infty}^{\infty}\delta(t-kT_{s})\Rightarrow\\
\Rightarrow \mathcal{F}[j(t)]=\sum\limits_{k=-\infty}^{\infty}\mathcal{F}[\delta(t)]e^{j2\pi fkT_{s}}\\
=\sum\limits_{k=-\infty}^{\infty}e^{j2\pi fkT_{s}}
}
\SS{
\text{265}\\
g(t)=f(t)\ast h(t)=\int\limits_{-\infty}^{\infty}f(\tau)h(t-\tau)d\tau\\
j(t)=\sum\limits_{k=-\infty}^{\infty}\delta(t-kT_{s})\Rightarrow\\
\Rightarrow \mathcal{F}[j(t)]=\sum\limits_{k=-\infty}^{\infty}\mathcal{F}[\delta(t)]e^{j2\pi fkT_{s}}\\
=\sum\limits_{k=-\infty}^{\infty}e^{j2\pi fkT_{s}}
}
\vfil
\end{multicols*}

\end{document}

在此处输入图片描述

答案2

你不允许 LaTeX 在任何地方分割列;如果你真的有这么大的显示器,那么告诉

\allowdisplaybreaks

在您的文件序言中。

初始垂直空间是由于以显示环境开始一个段落,这是错误的。

这是一个更简单的例子:

\documentclass[12pt]{article}
\usepackage[top=0.3in, bottom=1.2in, left=0.8in, right=0.8in]{geometry}

\usepackage{multicol}

\setlength{\parindent}{0cm}

\usepackage[fleqn]{amsmath}
\setlength{\mathindent}{0cm}

\newcommand{\3}{\vspace{0.3cm}}

\title{}
\author{}
\date{}

\allowdisplaybreaks

\begin{document}
\raggedcolumns

\begin{multicols}{2}
70
\begin{gather*}
\begin{aligned}
&e^{jz}=\cos z+j\sin z\\
&\cos z=(1/2)(2\cos z)=\\
&=(1/2)(2\cos z+j\sin z-j\sin z)=\\
&=(1/2)(\cos z+j\sin z+\cos z-j\sin z)=\\
&=(1/2)(e^{jz}+e^{-jz})
\end{aligned}\\
\begin{aligned}
&\text{207}\\
&x(t)=A_{c}\cos \theta(t)\\
&\theta(t)=2\pi f_{c}t+\phi(t)\\
&\phi(t)=K_{p}m(t)\\
&x(t)=A_{c}\cos[2\pi f_{c}t+K_{p}m(t)]
\end{aligned}\\
\begin{aligned}
&\text{208}\\
&x(t)=A_{c}\cos \theta(t)\\
&\theta(t)=2\pi f_{c}t+\phi(t)\\
&\frac{d\phi(t)}{dt}=2\pi K_{f}m(t)\Rightarrow\\
&\Rightarrow \phi(t)=2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau\\
&x(t)=A_{c}\cos\left[2\pi f_{c}t+2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau\right]
\end{aligned}\\
\begin{aligned}
&\text{208}\\
&x(t)=A_{c}\cos\theta(t)=A_{c}\cos[2\pi f_{c}t+\phi(t)]\\
&\cos(a+b)=\cos a \cos b-\sin a \sin b\\
&\phi(t)=K_{p}m(t)\\
&\phi(t)=2\pi K_{f}\int\limits_{-\infty}^{t}m(\tau)d\tau
\end{aligned}\\
\begin{aligned}
&\text{265}\\
&g(t)=f(t)\ast h(t)=\int\limits_{-\infty}^{\infty}f(\tau)h(t-\tau)d\tau\\
&j(t)=\sum\limits_{k=-\infty}^{\infty}\delta(t-kT_{s})\Rightarrow\\
&\Rightarrow \mathcal{F}[j(t)]=\sum\limits_{k=-\infty}^{\infty}\mathcal{F}[\delta(t)]e^{j2\pi fkT_{s}}\\
&=\sum\limits_{k=-\infty}^{\infty}e^{j2\pi fkT_{s}}
\end{aligned}
\end{gather*}

\end{multicols}

\end{document}

当然,由于数量太多,平衡列是不可能的aligned

在此处输入图片描述


另外,请inputenc注意绝不在使用 XeLaTeX 或 LuaLaTeX 进行编译时使用。

相关内容