如果我使用双倍空间,对齐空间会太多

如果我使用双倍空间,对齐空间会太多

我使用的是 Latex 模板。它们提供了以下命令来设置双倍行距

%% To produce output with the desired line spacing, the argument of
%% \spacing should be multiplied by 5/6 = 0.8333, so that 1 1/2 spaced
%% corresponds to \spacing{1.5} and double spaced is \spacing{1.66}.
\def\normalspacing{1.25} % default line spacing

我尝试使用他们的命令,但没有用。我决定\usepackage{setspace}使用

\begin{spacing}{1.5}
...
\end{spacing}

现在双倍空间可以正常工作了,但我注意到前后的空间太多了align。从下图中你可以看到块之间的空间有多大。

在此处输入图片描述

如何控制align模式的垂直空间?

这是模仿我的作品的样本

\documentclass[12pt]{article}

\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{subcaption}
\usepackage{setspace}
\usepackage{blindtext}

\begin{document}

\begin{spacing}{1.5}


hhs haha ahaha ha aha ahahaha ha ahaha aha 
ahahah ahaha ahahahaha ahah ah hhs haha ahaha ha aha ahahaha ha ahaha aha  ahahah ahaha ahahahaha ahah ah hhs haha ahaha ha aha ahahaha ha ahaha aha ahahah ahaha ahahahaha ahah ah  ahah ah hhs haha ahaha ha aha ahahaha ha ahaha aha 

\begin{align}
x = 
\begin{bmatrix}
ss & ss & ss & ss \\
ss & ss & ss & ss \\
ss & ss & ss & ss \\
ss & ss & ss & ss
\end{bmatrix}
\end{align}

hhs haha ahaha ha aha ahahaha ha ahaha aha 
ahahah ahaha ahahahaha ahah ah hhs haha ahaha ha aha ahahaha ha ahaha aha  ahahah ahaha ahahahaha ahah ah hhs haha ahaha ha aha ahahaha ha ahaha aha ahahah ahaha ahahahaha ahah ah

\begin{align}
x = 
\begin{bmatrix}
ss & ss & ss & ss \\
ss & ss & ss & ss \\
ss & ss & ss & ss \\
ss & ss & ss & ss
\end{bmatrix}
\end{align}
\blindtext


\end{spacing}

\end{document}

答案1

等环境前后切勿留空行alignequation如果要用%代替空行。那么间距就可以了。

\documentclass[12pt]{article}

\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{subcaption}
\usepackage{setspace}
\usepackage{blindtext}

\begin{document}

\onehalfspacing
hhs haha ahaha ha aha ahahaha ha ahaha aha
ahahah ahaha ahahahaha ahah ah hhs haha ahaha ha aha ahahaha ha ahaha aha  ahahah ahaha ahahahaha ahah ah hhs haha ahaha ha aha ahahaha ha ahaha aha ahahah ahaha ahahahaha ahah ah  ahah ah hhs haha ahaha ha aha ahahaha ha ahaha aha
%
\begin{align}
x =
\begin{bmatrix}
ss & ss & ss & ss \\
ss & ss & ss & ss \\
ss & ss & ss & ss \\
ss & ss & ss & ss
\end{bmatrix}
\end{align}
%
hhs haha ahaha ha aha ahahaha ha ahaha aha
ahahah ahaha ahahahaha ahah ah hhs haha ahaha ha aha ahahaha ha ahaha aha  ahahah ahaha ahahahaha ahah ah hhs haha ahaha ha aha ahahaha ha ahaha aha ahahah ahaha ahahahaha ahah ah
%
\begin{align}
x =
\begin{bmatrix}
ss & ss & ss & ss \\
ss & ss & ss & ss \\
ss & ss & ss & ss \\
ss & ss & ss & ss
\end{bmatrix}
\end{align}
%
\blindtext


\end{document}

在此处输入图片描述

答案2

align如果你希望在代码前有空行,可以插入

\setlength{\abovedisplayskip}{0pt}
\setlength{\abovedisplayshortskip}{0pt}

在你的spacing环境中

梅威瑟:

\documentclass[12pt]{article}

\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{subcaption}
\usepackage{setspace}
\usepackage{blindtext}

\begin{document}

\begin{spacing}{1.5}
\setlength{\abovedisplayskip}{0pt}
\setlength{\abovedisplayshortskip}{0pt}


hhs haha ahaha ha aha ahahaha ha ahaha aha
ahahah ahaha ahahahaha ahah ah hhs haha ahaha ha aha ahahaha ha ahaha aha  ahahah ahaha ahahahaha ahah ah hhs haha ahaha ha aha ahahaha ha ahaha aha ahahah ahaha ahahahaha ahah ah  ahah ah hhs haha ahaha ha aha ahahaha ha ahaha aha

\begin{align}
x =
\begin{bmatrix}
ss & ss & ss & ss \\
ss & ss & ss & ss \\
ss & ss & ss & ss \\
ss & ss & ss & ss
\end{bmatrix}
\end{align}

hhs haha ahaha ha aha ahahaha ha ahaha aha
ahahah ahaha ahahahaha ahah ah hhs haha ahaha ha aha ahahaha ha ahaha aha  ahahah ahaha ahahahaha ahah ah hhs haha ahaha ha aha ahahaha ha ahaha aha ahahah ahaha ahahahaha ahah ah

\begin{align}
x =
\begin{bmatrix}
ss & ss & ss & ss \\
ss & ss & ss & ss \\
ss & ss & ss & ss \\
ss & ss & ss & ss
\end{bmatrix}
\end{align}
\blindtext


\end{spacing}

\end{document} 

在此处输入图片描述

相关内容