0

This question already has an answer here:

As already asked here (No indentation after theorem environment with amsthm), I would like to avoid the indentation after a theorem.

The accepted answer (https://tex.stackexchange.com/a/176039) suggests adding

\AfterEndEnvironment{thm}{\noindent\ignorespaces}

to the theorem definition.

While this solution does work for me, it introduces new, undesired vertical space between two theoreoms when they are not separated by some text paragraph.

MWE:

enter image description here

\documentclass{scrbook}

\usepackage{amsthm}

\theoremstyle{plain}
\newtheorem{thm}{Theorem}[chapter]
\newtheorem*{thm*}{Theorem}

\usepackage{etoolbox}
\AfterEndEnvironment{thm}{\noindent\ignorespaces}


\begin{document}

\chapter{Chapter}

\section{Section}

Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. 

\begin{thm}
    Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. 
\end{thm}

Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. 

\begin{thm}
    Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. 
\end{thm}

\begin{thm}
    Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. 
\end{thm}

Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. 

\end{document}

marked as duplicate by egreg, Bobyandbob, Troy, Community Dec 5 '17 at 11:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • The accepted answer is unfortunately wrong. I added a better solution. – egreg Dec 5 '17 at 10:45
1

\noindent starts a new paragraph. This is imho the wrong way to suppress the identation. I would either use like lists \@doendpe, which suppress the identation only if there is no empty line after the environment, or like \section \setbox\z@\lastbox at the next par.

\documentclass{scrbook}

\usepackage{amsthm}

\theoremstyle{plain}
\newtheorem{thm}{Theorem}[chapter]
\newtheorem*{thm*}{Theorem}

\usepackage{etoolbox}
\makeatletter
%\AfterEndEnvironment{thm}{\@doendpe}
\AfterEndEnvironment{thm}{\everypar{\setbox\z@\lastbox\everypar{}}}
\makeatother

\begin{document}

\chapter{Chapter}

\section{Section}

Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.

\begin{thm}
    Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem.
\end{thm}
Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.

Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.

\begin{thm}
    Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem.
\end{thm}

\begin{thm}
    Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem. Theorem.
\end{thm}

Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.

\end{document}
  • Thank you for the answer, I really like the 'lazy option' which always removes the indentation, regardless of the existence of an empty line. – jpmath Dec 5 '17 at 11:15

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