
Ich habe das thmtools-Paket verwendet, um eine neue Proof-Umgebung zu erstellen. Mit dem folgenden Code habe ich die gesamte Umgebung eingerückt:
\AtBeginEnvironment{prf}{
\patchcmd\@thm{\trivlist}{\list{}{\leftmargin25pt}}{}{}
\patchcmd\thmt@original@endprf{\endtrivlist}{\endlist}{}{}
}
Das Problem besteht nun darin, dass, wenn ich mehrere Absätze in dieser Umgebung habe, der Absatzeinzug nicht mehr sichtbar ist ( \setlength{\parindent}{25pt}
). Wie kann ich dieses Problem beheben?
Dank im Voraus.
Dies sollte das Problem veranschaulichen:
\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}
Antwort1
Stellen Sie einfach die Absatzeinrückung wieder her, indem Sie den \listparindent
Parameter festlegen:
\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}
Antwort2
Das ntheorem
Paket ist kompatibel mit thmtools
und definiert bereits ein \theoremindent
. Im folgenden Beispiel aus einer meiner alten Dateien hatte ich \theoremindent{1cm}
einen Absatzeinzug festgelegt, und wie Sie sehen, bleibt dieser innerhalb der Proof-Umgebung erhalten: