KOMA スクリプトと amsthm の parskip オプションによる間隔の不一致

KOMA スクリプトと amsthm の parskip オプションによる間隔の不一致

この問題は、質問 25346しかし、提案された解決策では私の問題は解決されません。

\documentclass[parskip=full]{scrreprt}

\usepackage{amsmath, amsthm}

\theoremstyle{definition}
\newtheorem{definition}{Definition}[chapter]

\begin{document}

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

\begin{definition} 
In luctus mattis felis ac tristique.
\end{definition}

Nunc vulputate lectus at eros vehicula.

Aliquam fermentum eu justo in lobortis. 
\end{document}

一貫性のない間隔が生成されます。


ここに画像の説明を入力してください


追加

\begingroup
    \makeatletter
    \@for\theoremstyle:=definition,remark,plain\do{%
        \expandafter\g@addto@macro\csname th@\theoremstyle\endcsname{%
            \addtolength\thm@preskip\parskip
            }%
        }
\endgroup

前文に、質問 25346生産する


ここに画像の説明を入力してください


しかし、このスペースは段落スキップよりも大幅に大きくなっています。text-to-theorem-skip のサイズを parskip と同じにしたいと思います。ありがとうございます!

答え1

コードを実行する\parskipと、定義の前後に基本的に 2 つの が生成されます。定理の前では、の調整ではなくを\parskip使用して までの間隔を設定できます。定理の後では、関連する量は ですが、とにかく が来るので、これをゼロにする必要があります。\setlength\addtolength\thm@preskip\thm@postskip\parskip

サンプル出力

\documentclass[parskip=full]{scrreprt}

\usepackage{amsmath, amsthm}

\begingroup
    \makeatletter
    \@for\theoremstyle:=definition,remark,plain\do{%
        \expandafter\g@addto@macro\csname th@\theoremstyle\endcsname{%
            \setlength\thm@preskip\parskip
            \setlength\thm@postskip{0pt}
            }%
        }
\endgroup

\theoremstyle{definition}
\newtheorem{definition}{Definition}[chapter]

\begin{document}
\show\definition

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

\begin{definition} 
In luctus mattis felis ac tristique.
\end{definition}

Nunc vulputate lectus at eros vehicula.

Aliquam fermentum eu justo in lobortis. 

\end{document}

関連情報