對齊*前的額外空格且不顯示方程

對齊*前的額外空格且不顯示方程

頁面的section和部分之間有一個額外的空格。align*如果方程式簡單地包含在 中,則不會發生這種情況\[...\]

\documentclass{article}

\usepackage[fleqn]{amsmath}

\setlength{\mathindent}{0cm}

\begin{document}
\section{Test}
\[
  a^2 + b^2 = c^2
\]
\section{Test}
\begin{align*}
  a^2 + b^2 &= c^2
\end{align*}
\end{document}

其產量: pdf

align*我可以使用否定來提高環境\vspace,但我想知道是否有更合適的方法。

編輯:

定義:

\newcommand{\A}[1]{{\setlength{\abovedisplayskip}{0pt}\begin{align*}#1%
  \end{align*}}}

我替換了必要的內容\begin{align*}...\end{align*}\A{...}現在我得到了這個(這是我的實際文件): 更大的底部空間

是什麼原因導致底部空間變大?

答案1

align並使用大約高於環境的align*垂直跳躍量。10pt這可以設定為0pt,但這應該在群組內完成,即使用

{%
\abovedisplayskip=0pt%
 \begin{align*}
  ...
 \end{align*}
}%

請注意,\belowdisplayskip環境下方的空間也具有類似的意義。僅減少跳過暫存器值之一可能會導致輸出看起來不美觀。

0pt不建議將兩者都設為。

\documentclass{article}

\usepackage[fleqn]{amsmath}

\setlength{\mathindent}{0cm}

\begin{document}
\section{Test}
\[
  a^2 + b^2 = c^2
\]
\section{Test}
\begin{align*}
  a^2 + b^2 &= c^2
\end{align*}
Some other text

\section{Another Test}
{%
  \abovedisplayskip=0pt
\begin{align*}
  a^2 + b^2 &= c^2
\end{align*}
}%
Some other text


\section{Another Test}
\begin{align*}
  a^2 + b^2 &= c^2
\end{align*}
Some other text


\end{document}

相關內容