定理/证明环境后的神秘垂直空间

定理/证明环境后的神秘垂直空间

我已经定义了自己的定理样式,使其上方和下方均为 0pt。为简单起见,我还将所有其他相关间距设置为 0pt。但是,当我使用定理或证明环境时,下方会出现一些神秘的空白。

请注意,上面没有任何空格(因此0pt上面的内容\newtheoremstyle似乎有效)。有人能告诉我空格来自哪里吗?这是我的代码:

\documentclass[11pt,a4paper]{report}

\usepackage{amsmath,amssymb,amsthm}

\setlength{\topsep}{0pt}
\setlength{\partopsep}{0pt plus 0pt minus 0pt}
\setlength{\parskip}{0pt}
\setlength{\parindent}{0pt}

\newtheoremstyle{mytheoremstyle}{0pt}{0pt}{\itshape}{}{\bf}{.}{.5em}{} 

\theoremstyle{mytheoremstyle}

\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{lemma}[theorem]{Lemma}

\begin{document}
Some normal text goes here, with a lemma immediately below.
\begin{lemma}
This is the statement of the lemma.
\end{lemma}
\begin{proof}
This is the proof of the lemma, with a mysterious space above.
\end{proof}
Some normal text goes here, with a mysterious space above. \par
The next paragraph comes immediately below.

\end{document}

示例输出

答案1

打开之前环境proof会重置;您可以通过重新定义或修补来删除此设置。\topseptrivlist\proof

\documentclass[11pt,a4paper]{report}

\usepackage{amsmath,amssymb,amsthm,xpatch}

\setlength{\topsep}{0pt}
\setlength{\partopsep}{0pt plus 0pt minus 0pt}
\setlength{\parskip}{0pt}
\setlength{\parindent}{0pt}

\newtheoremstyle{mytheoremstyle}{0pt}{0pt}{\itshape}{}{\bfseries}{.}{.5em}{} 

\theoremstyle{mytheoremstyle}

\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{lemma}[theorem]{Lemma}

\makeatletter
\xpatchcmd{\proof}{\topsep6\p@\@plus6\p@\relax}{}{}{}
\makeatother

\begin{document}
Some normal text goes here, with a lemma immediately below.
\begin{lemma}
This is the statement of the lemma.
\end{lemma}
\begin{proof}
This is the proof of the lemma, with a mysterious space above.
\end{proof}
Some normal text goes here, with a mysterious space above. \par
The next paragraph comes immediately below.

\end{document}

在此处输入图片描述

我希望这只是为了研究 LaTeX 的工作原理,因为输出很糟糕。

请注意,它\bf已经过时二十年了,\bfseries应该继续使用。

相关内容