
나는 amsthm 패키지를 사용하고 있으며 정리 환경 바로 다음에 시작되는 줄이 들여쓰기되는 것을 원하지 않습니다. 패키지 매뉴얼을 찾아보니 새로운 정리 스타일을 정의하라고 나와 있었습니다. 나는 다음 MWE가 이 작업을 수행할 것으로 기대했습니다.
\documentclass[12pt,a4paper]{scrreprt}
\usepackage{amsthm}
\newtheoremstyle{abcd}% name
{}% Space above, empty = `usual value'
{}% Space below
{\itshape}% Body font
{}% Indent amount (empty = no indent, \parindent = para indent)
{\bfseries}% Thm head font
{.}% Punctuation after thm head
{.5em}% Space after thm head: \newline = linebreak
{}% Thm head spec
\theoremstyle{abcd}
\newtheorem{defn}{Definition}
\begin{document}
\begin{defn}
Some defintion
\end{defn}
This sentence shouldn't be indented.
\end{document}
그래도 난 이걸로 끝이야
그것이 내가 기대하는 것입니다(정리 환경이 끝난 직후에 noindent를 사용하여 얻었습니다).
답변1
\documentclass[12pt,a4paper]{scrreprt}
\usepackage{amsthm}
\usepackage{etoolbox}
\newtheorem{defn}{Definition}
\AfterEndEnvironment{defn}{\noindent\ignorespaces}
\begin{document}
\begin{defn}
Some definition.
\end{defn}
This sentence isn't indented.
\end{document}
그러나 이것은 직관에 어긋납니다. 정의(또는 다른 정리와 유사한 구조) 뒤의 문장은 논리적으로 새 단락을 시작하므로 첫 번째 줄은 새 단락의 다른 첫 번째 줄로 처리되어야 합니다.
답변2
다음을 패치하여 단일 정리 유형 기반으로 이 문제를 해결할 수 있습니다 \end<name>
.
\documentclass{article}
\usepackage{etoolbox}
\usepackage{amsthm}
\newtheoremstyle{abcd}% name
{}% Space above, empty = `usual value'
{}% Space below
{\itshape}% Body font
{}% Indent amount (empty = no indent, \parindent = para indent)
{\bfseries}% Thm head font
{.}% Punctuation after thm head
{.5em}% Space after thm head: \newline = linebreak
{}% Thm head spec
\theoremstyle{abcd}
\newtheorem{defn}{Definition}
\makeatletter
\patchcmd{\enddefn}{\@endpefalse}{}{}{}
\makeatother
\begin{document}
\begin{defn}
Some definition
\end{defn}
This sentence shouldn't be indented.
\begin{defn}
Some definition
\end{defn}
This sentence should be indented.
\end{document}
스타일 선택은 영향을 미치지 않습니다.
동일한 동작을 얻으려면모두정리 환경에서는 의 정의를 변경합니다 \@endtheorem
.
\documentclass{article}
\usepackage{amsthm}
\makeatletter
\def\@endtheorem{\endtrivlist}
\makeatother
\newtheoremstyle{abcd}% name
{}% Space above, empty = `usual value'
{}% Space below
{\itshape}% Body font
{}% Indent amount (empty = no indent, \parindent = para indent)
{\bfseries}% Thm head font
{.}% Punctuation after thm head
{.5em}% Space after thm head: \newline = linebreak
{}% Thm head spec
\theoremstyle{abcd}
\newtheorem{defn}{Definition}
\begin{document}
\begin{defn}
Some definition
\end{defn}
This sentence shouldn't be indented.
\begin{defn}
Some definition
\end{defn}
This sentence should be indented.
\end{document}
또 다른 예는 두 정리 환경이 서로 뒤따를 때 원하지 않는 공간을 추가하지 않음을 보여줍니다.
\documentclass{scrbook}
\usepackage{amsthm}
\makeatletter
\def\@endtheorem{\endtrivlist}
\makeatother
\theoremstyle{plain}
\newtheorem{thm}{Theorem}[chapter]
\newtheorem*{thm*}{Theorem}
\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}
No indentation. 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}
Indentation. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.
\end{document}