# Indentation after theorem

Consider the following MWE:

\documentclass[11pt]{report}

\usepackage{framed}
\usepackage{pstricks}
\usepackage{color}
\usepackage[framed,thmmarks,thref, hyperref]{ntheorem}

\usepackage{etoolbox}

\definecolor{proofback}{rgb}{0.95,0.95,0.95}

\theorembodyfont{\upshape}
\theoremstyle{nonumberplain}
\theoremsymbol{\raisebox{-5mm}{ \rule{1ex}{1ex} }}

\begin{document}

\begin{proof}
test test
\end{proof}
some normal text
\end{document}


This gives the following output:

As per title I would like to remove the indentation after the end of the proof. As a solution I thought I could use something like

\let\oldendproof\endproof
\def\endproof{\oldendproof \leavevmode\vspace{-\baselineskip} \\  \noindent}


However, the problem is that, in case there is a proof followed directly by a theorem this solution creates an unnecessary amount of space:

\begin{proof}
test test
\end{proof}
\begin{proof}
another test
\end{proof}


while, without my hack, the rendered pdf looks like

I suspect this is due to the fact that I'm leaving vertical mode, but I know very little about how latex works internally. Any idea of how I can remove the indentation after a proof without this side effect? I know I can simply add a \noindent just after the end of the proof, but I was looking for some "automatic" and general solution that doesn't force me to do so. I'm compiling using xelatex.

• Not a duplicate but rather similar. – campa Oct 18 '16 at 8:46
• Yes I already tried that solution too, but unfortunately doesn't solve the problem of the extra space in case of multiple theorems (in my example I have two proofs but it think it would be the same for every newly-defined theorem environment) – Manlio Oct 18 '16 at 8:49
• the tombstone on all these examples is on a line by itself. that is usually something to be avoided, but not being a user of ntheorem, i can't suggest how to avoid it. – barbara beeton Oct 18 '16 at 13:14

You can re-use the suppression after heading code:

\documentclass[11pt]{report}

\usepackage{framed}
\usepackage{pstricks}
\usepackage{color}
\usepackage[framed,thmmarks,thref, hyperref]{ntheorem}

\usepackage{etoolbox}

\definecolor{proofback}{rgb}{0.95,0.95,0.95}

\theorembodyfont{\upshape}
\theoremstyle{nonumberplain}
\theoremsymbol{\raisebox{-5mm}{ \rule{1ex}{1ex} }}

\makeatletter
\let\oldendproof\endproof
\makeatother
\begin{document}

\begin{proof}
test test
\end{proof}
some normal text

\begin{proof}
test test
\end{proof}

some normal text

\end{document}


Here is a solution with \theorempostwork. I don't think you need pstricksfor shaded theorems: using\fcolorbox will do. Also, I modified the values of some parameters for a better vertical spacing (in my opinion).

\documentclass[11pt]{report}
\usepackage[showframe]{geometry}%
\usepackage{framed}
\usepackage{xcolor}%
\usepackage[framed,thmmarks,thref, hyperref]{ntheorem}

\definecolor{proofback}{rgb}{0.95,0.95,0.95}

\theorembodyfont{\upshape}
\theoremstyle{nonumberplain}
\theoremsymbol{\raisebox{-5mm}{ \rule{1ex}{1ex} }}
\theoremframepostskip{2ex}
\theoreminframepostskip{0.6ex}
\theorempostwork{\noindent\hspace*{-\fontdimen2\font}}

\usepackage{hyperref}%

\begin{document}

\begin{proof}
test test
\end{proof}
Some normal text

\end{document}


• This doesn't work if \end{proof} is followed by a blank line or a display such as another theorem or heading, you would get a spurious white paragraph from the \noindent` and then indented text – David Carlisle Oct 18 '16 at 11:27