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정의 전후에 두 개의 s가 생성됩니다. 정리 전에는 의 조정이 아닌 를 \parskip사용하여 간격을 설정할 수 있습니다 . 정리 이후 관련 수량은 이지만 , 어쨌든 다음과 같은 결과가 나오므로 이는 0으로 두어야 합니다 .\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}

관련 정보