逐項列出內部環境後給予雙倍空間

逐項列出內部環境後給予雙倍空間

有些定義和定理以逐條結尾。當我使用純 amsthm 時,這看起來不錯,但是當我使用 thmtools+amsthm 時,它看起來很難看,定理下方有太多空間。我沒有看到我在 \declaretheoremstyle 中做錯了什麼。

有人可以幫我嗎?

\documentclass{article}
\usepackage{amsthm}

%%%%%%%%%%% Uncomment to use pure amsthm %%%%%%%%%%%%
% \newtheorem{mytheorem}{Mytheorem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%% Comment out to use pure amsthm %%%%%%%%%%
\usepackage{thmtools}

% Set all vertical spaces I know of to zero to illustrate issue.
\declaretheoremstyle[
spaceabove=0pt,
spacebelow=0pt,
headfont=\normalfont\bfseries,
notefont=\bfseries,
notebraces={(}{)},
bodyfont=\normalfont,
qed={},
headpunct={.}
]{mytheoremstyle}

\declaretheorem[style=mytheoremstyle, name=MyTheorem]{mytheorem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\noindent
Text before theorem without indent for clarity.

\begin{mytheorem}
  Here is my theorem with itemize inside it.
  \begin{itemize}

  \item My item A.

  \item My item B.

  \end{itemize}
\end{mytheorem}

\noindent
Text after the theorem without indent for clarity.

\begin{mytheorem}
  Here is another theorem without any itemize inside it.
\end{mytheorem}

\noindent
Final text here without indent for clarity.

\end{document}

答案1

我認為這qed={}是添加了一行空格。如果您將其註解掉,差異就會消失:

\documentclass{article}
\usepackage{amsthm}

%%%%%%%%%%% Uncomment to use pure amsthm %%%%%%%%%%%%
% \newtheorem{mytheorem}{Mytheorem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%% Comment out to use pure amsthm %%%%%%%%%%
\usepackage{thmtools}

% Set all vertical spaces I know of to zero to illustrate issue.
\declaretheoremstyle[
spaceabove=0pt,
spacebelow=0pt,
headfont=\normalfont\bfseries,
notefont=\bfseries,
notebraces={(}{)},
bodyfont=\normalfont,
% qed={},
headpunct={.}
]{mytheoremstyle}
%
\declaretheorem[style=mytheoremstyle, name=MyTheorem]{mytheorem}
% \declaretheorem[name=MyTheorem]{mytheorem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\noindent
Text before theorem without indent for clarity.

\begin{mytheorem}
  Here is my theorem with itemize inside it.
  \begin{itemize}

  \item My item A.

  \item My item B.

  \end{itemize}
\end{mytheorem}

\noindent
Text after the theorem without indent for clarity.

\begin{mytheorem}
  Here is another theorem without any itemize inside it.
\end{mytheorem}

\noindent
Final text here without indent for clarity.

\end{document}

取消設定 qed 選項以實現壓縮

相關內容