当我想在证明环境中枚举时,我通常使用命令enumerate
或\item[label]
。
第一个看起来很不错,因为它会自动计数。但是,当我想同时推导两个部分的证明,并因此想要写出类似 (i-ii) 的内容时,它也会很麻烦。另外,我不喜欢它对齐文本的方式。
对于第二个,解决了这两个问题,但有一个问题。如果我在证明的开头使用它,它将从新行开始,而不是在单词 Proof 之后。有什么方法可以解决这个问题,或者我可以做些什么来改进命令enumerate
。这是我的示例代码
\documentclass[11pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{graphicx}
\newtheorem{thm}{Theorem}
\begin{document}
\begin{thm}
The following statements are true
\begin{enumerate}
\item
\label{thm:1}
$1+1=2$;
\item
\label{thm:2}
$2+2=4$;
\end{enumerate}
\end{thm}
\begin{proof}
In order to divide the proof into two parts, I use \emph{enumerate}
\begin{enumerate}
\item This is a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long proof.
This is a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long proof.
\item This is a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long proof.
This is a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long proof.
\end{enumerate}
Or \emph{item} with label option
\item[\ref{thm:1}.]
This is a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long proof.
This is a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long proof.
\item[\ref{thm:2}.]
This is a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long proof.
This is a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long proof.
\end{proof}
I prefer the second one as it can deal with the case when I want to combine the proof. However, it has one drawback that it can only start at the begining of a line.
\begin{proof}
\item[\ref{thm:1} - \ref{thm:2}] For \emph{item} with label option.
\end{proof}
\begin{proof}
\begin{enumerate}
\item \emph{enumerate} \qedhere
\end{enumerate}
\end{proof}
\end{document}
结果如下
答案1
对于第二种情况,我建议定义描述环境的克隆,方便使用包进行定制enumitem
。同样,对于第一种情况,定义一个 colne enumerate
。所以我定义了一个proofenum
和proofdescr
环境。我还将输入编码更改为utf8
:
\documentclass[11pt, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[showframe]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{graphicx}
\usepackage{enumitem}
\newtheorem{thm}{Theorem}
\newlist{proofenum}{enumerate}{1}
\setlist[proofenum]{label=\arabic*., wide=0pt, leftmargin=*}
\newlist{proofdescr}{description}{1}
\setlist[proofdescr]{font=\normalfont, leftmargin=0pt, style=sameline}
\begin{document}
\begin{thm}
The following statements are true
\begin{enumerate}
\item
\label{thm:1}
$1+1=2$;
\item
\label{thm:2}
$2+2=4$;
\end{enumerate}
\end{thm}
\begin{proof}
In order to divide the proof into two parts, I use \emph{enumerate}
\begin{proofenum}
\item This is a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long proof.
This is a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long proof.
\item This is a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long proof.
This is a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long proof.
\end{proofenum}
Or \emph{item} with label option
\begin{proofdescr}
\item[\ref{thm:1}.]
This is a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long proof.
This is a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long proof.
\item[\ref{thm:2}.]
This is a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long proof.
This is a very very very very very very very very very very very very very very very very very very very very very very very very very very very very long proof.
\end{proofdescr}
\end{proof}
I prefer the second one as it can deal with the case when I want to combine the proof. However, it has one drawback that it can only start at the beginning of a line.
\begin{proof}
\begin{proofdescr}
\item[\ref{thm:1} - \ref{thm:2}] For \emph{item} with label option.
\item[\ref{thm:1} - \ref{thm:2}] For \emph{item} with label option.
\end{proofdescr}
\end{proof}
\begin{proof}
\begin{proofenum}
\item \emph{enumerate}
\item \emph{enumerate}\qedhere
\end{proofenum}
\end{proof}
\end{document}