
私は thmtools パッケージを使用して新しい証明環境を作成しました。次のコードを使用して、環境全体をインデントしました。
\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}
、ご覧のとおり、 proof 環境内では段落のインデントが保持されています。