我经常将长篇校样分成小段,以便于阅读和理解。我通过添加fbox
“第 X 部分:...”来实现这一点。然而,这种方法并不总是奏效:方框和校样的相应部分可以通过分页符来分割,如下面代码所示。
\documentclass{article}
\usepackage{amsthm}
\usepackage{lipsum}
\parskip 12pt
\parindent 0pt
\newtheorem{theorem}{Theorem}
\begin{document}
\lipsum[1-4]
\begin{theorem}
This is my theorem.
\end{theorem}
\begin{proof}
Let's cut this long proof into little pieces.
\fbox{Part 1: firstly}
This is part 1.
\fbox{Part 2: secondly}
This is part 2.
\end{proof}
\end{document}
有没有办法可以防止这种情况发生?是否有可能创建一个新的环境来防止分裂,并使添加这样的子证明更容易(我厌倦了\fbox{Part X: ...}
重新输入)?我正在寻找允许我输入的东西
\begin{proof}
Let's cut this long proof into little pieces.
\begin{subproof}{Title of subproof 1}
(subproof 1)
\end{subproof}
\begin{subproof}{Title of subproof 2}
(subproof 2)
\end{subproof}
\end{proof}
这将导致
或许校样中的零件编号可以帮助自动对子证明进行编号。
答案1
您可以使用与章节标题相同的机制:
\documentclass{article}
\usepackage{amsthm}
\usepackage{lipsum}
\newtheorem{theorem}{Theorem}
\makeatletter
\newcommand{\proofpart}[2]{%
\par
\addvspace{\medskipamount}%
\noindent\emph{Part #1: #2}\par\nobreak
\addvspace{\smallskipamount}%
\@afterheading
}
\makeatother
\begin{document}
\lipsum[1-4]
\begin{theorem}
This is my theorem.
\end{theorem}
\begin{proof}
Let's cut this long proof into little pieces.
\proofpart{1}{firstly}
This is part 1.
\proofpart{2}{secondly}
This is part 2.
\proofpart{3}{thirdly}
This is part 3.
\end{proof}
\end{document}
抱歉,但我无法忍受看到非零 parskip 文档,我觉得这浪费纸张,对清晰度和可读性没有任何帮助。
“第 1 部分:首先”周围的框架很刺眼,我建议只使用斜体,就像“证明”一样。老实说,我不会在证明部分标题后添加换行符,但这是个人喜好。
自动对校样部件进行编号的变体。
\documentclass{article}
\usepackage{amsthm,xpatch}
\usepackage{lipsum}
\newtheorem{theorem}{Theorem}
\makeatletter
\newcounter{proofpart}
\xpretocmd{\proof}{\setcounter{proofpart}{0}}{}{}
\newcommand{\proofpart}[1]{%
\par
\addvspace{\medskipamount}%
\stepcounter{proofpart}%
\noindent\emph{Part \theproofpart: #1}\par\nobreak\smallskip
\@afterheading
}
\makeatother
\begin{document}
\lipsum[1-4]
\begin{theorem}
This is my theorem.
\end{theorem}
\begin{proof}
Let's cut this long proof into little pieces.
\proofpart{firstly}
This is part 1.
\proofpart{secondly}
This is part 2. \lipsum*[1]
\proofpart{thirdly}
This is part 3. \lipsum*[1]
\end{proof}
\end{document}
答案2
如果证明部分不需要描述,则可以使用该enumitem
包并使用此代码:
\documentclass{article}
\usepackage{amsthm}
\usepackage{lipsum}
\usepackage{enumitem}
\newtheorem{theorem}{Theorem}
\begin{document}
\lipsum[1]
\begin{theorem}
This is my theorem.
\end{theorem}
\begin{proof}
Let's cut this long proof into little pieces.
\begin{enumerate}[label={{Part} \arabic*.}, leftmargin=*]
\item This is part 1.
\item This is part 2.
\item This is part 3.
\end{enumerate}
\end{proof}
\end{document}