正如这里所问的那样(使用 amsthm 的定理环境后没有缩进),我想避免定理后的缩进。
接受的答案(https://tex.stackexchange.com/a/176039)建议添加
\AfterEndEnvironment{thm}{\noindent\ignorespaces}
定理定义。
虽然这个解决方案对我来说确实有效,但是当两个定理没有被某个文本段落分隔开时,它会在它们之间引入新的、不受欢迎的垂直空间。
梅威瑟:
\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}
答案1
\noindent 开始一个新段落。在我看来,这是抑制标识的错误方法。我要么使用类似列表\@doendpe
,仅当环境后没有空行时才抑制标识,要么\section
\setbox\z@\lastbox
在下一段中使用类似列表。
\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}