Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have used the thmtools-package to create a new proof environment. With the following code I indented the whole environment:

\AtBeginEnvironment{prf}{
  \patchcmd\@thm{\trivlist}{\list{}{\leftmargin25pt}}{}{}
  \patchcmd\thmt@original@endprf{\endtrivlist}{\endlist}{}{}
}

The problem is now that when I have multiple paragraphs inside this environment, the paragraph indentation is not visible anymore (\setlength{\parindent}{25pt}). How could I fix this problem?

Thanks in advance.


This should demonstrate the problem:

\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}
share|improve this question
    
Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  egreg May 10 at 16:06
    
Please provide a complete small document that shows the problem. Do you mean that if you don't have those lines there is indentation? An example that we could run would make it a lot clearer. –  David Carlisle May 10 at 16:07
    
Possibly you want to set \listparindent instead but without any supplied example that is only a wild guess. –  David Carlisle May 10 at 16:12
    
I hope this example makes my problem clear. Thanks. –  AYK May 10 at 16:22
add comment

2 Answers 2

up vote 4 down vote accepted

Just reinstate the paragraph indentation, by setting the \listparindent parameter:

\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}

enter image description here

share|improve this answer
add comment

The ntheorem package is compatible with thmtools and already defines a \theoremindent. In the following example from an old file of mine, I had set \theoremindent{1cm} and, as you can see, inside the proof environment, paragraph indent is preserved:

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.