
새로운 증명 환경을 만들기 위해 thmtools-package를 사용했습니다. 다음 코드를 사용하여 전체 환경을 들여쓰기했습니다.
\AtBeginEnvironment{prf}{
\patchcmd\@thm{\trivlist}{\list{}{\leftmargin25pt}}{}{}
\patchcmd\thmt@original@endprf{\endtrivlist}{\endlist}{}{}
}
문제는 이제 이 환경 내에 여러 단락이 있을 때 단락 들여쓰기가 더 이상 표시되지 않는다는 것입니다( \setlength{\parindent}{25pt}
). 이 문제를 어떻게 해결할 수 있나요?
미리 감사드립니다.
이는 문제를 보여줍니다.
\documentclass[a4paper,12pt]{article}
\usepackage{etoolbox,amsthm,thmtools}
\declaretheoremstyle[
spaceabove=\topsep,
spacebelow=\topsep,
headformat={\NAME},
headfont=\bfseries,
notefont=\normalfont,
bodyfont=\normalfont,
headindent=0pt,
headpunct={\ },
qed =\qedsymbol
]{proof}
\declaretheorem[style=proof,name=Proof,numbered=no]{prf}
\makeatletter
\AtBeginEnvironment{prf}{%
\patchcmd\@thm{\trivlist}{\list{}{\leftmargin25pt}}{}{}
\patchcmd\thmt@original@endprf{\endtrivlist}{\endlist}{}{}
}
\makeatother
\setlength{\parindent}{25pt}
\begin{document}
\section{Section}
Some text\\
And more text
Here the paragraph is indented.
\begin{prf}
Some text\\
And more text
Here the paragraph is not (visibly) indented.
\end{prf}
\end{document}
답변1
매개변수를 설정하여 단락 들여쓰기를 복원하세요 \listparindent
.
\documentclass[a4paper,12pt]{article}
\usepackage{etoolbox,amsthm,thmtools}
\declaretheoremstyle[
spaceabove=\topsep,
spacebelow=\topsep,
headformat={\NAME},
headfont=\bfseries,
notefont=\normalfont,
bodyfont=\normalfont,
headindent=0pt,
headpunct={\ },
qed =\qedsymbol
]{proof}
\declaretheorem[style=proof,name=Proof,numbered=no]{prf}
\makeatletter
\AtBeginEnvironment{prf}{%
\patchcmd\@thm{\trivlist}{\list{}{\leftmargin25pt\listparindent\parindent}}{}{}
\patchcmd\thmt@original@endprf{\endtrivlist}{\endlist}{}{}
}
\makeatother
\setlength{\parindent}{25pt}
\begin{document}
\section{Section}
Some text\\
And more text
Here the paragraph is indented.
\begin{prf}
Some text\\
And more text
Here the paragraph is indented.
\end{prf}
\end{document}
답변2
패키지 ntheorem
는 와 호환 thmtools
되며 이미 정의되어 있습니다 \theoremindent
. 내 이전 파일의 다음 예에서는 \theoremindent{1cm}
보시다시피 교정 환경 내에서 단락 들여쓰기가 유지되도록 설정했습니다.