I am writing a document using the book
class, which, by design, does not indent the first line of the chapter/section/subsection. I noticed that if I start a chapter with a framed theorem then, for some reason, the initial \noindent
is postponed to the first line after the theorem. The same does not happen if I use a non-framed theorem instead. Here's a mwe:
\documentclass[oneside]{book}
\usepackage{framed}
\usepackage[framed]{ntheorem}
\newframedtheorem{theorem}{theorem}
\newtheorem{plainthm}{theorem}
\begin{document}
\section{section}
\begin{theorem}
This is a theorem
\end{theorem}
some text
\begin{theorem}
this is another theorem
\end{theorem}
some other text
\section{other section}
\begin{plainthm}
This is a plainthm
\end{plainthm}
some text
\begin{plainthm}
this is another plainthm
\end{plainthm}
some other text
\end{document}
While this does not seem a very important issue (I doubt I will ever begin a section with a theorem), I would like to understand why this is happening (I guess it has something to do with the fact that framed theorems are drawn within boxes) and what is the "proper" way to fix this. I can think of several workarounds (like adding a dummy line and a negative \vskip
before the framed theorem), but I am interested in a more flexible solution (e.g. something that doesn't break I change the documentclass).