下面的源代码解释并说明了这个问题:如何修改propertylist
以允许它使用[labelindent=0pt]
列表开始时的选项和[resume]
恢复列表时的选项。
\documentclass{article}
\usepackage{amsthm}
\usepackage{enumitem}
\newlist{proplis}{enumerate}{1}
\newenvironment{propertylist}[1]{%
\setlist[proplis,1]{%
wide,leftmargin=*,label=\upshape(#1\arabic*)}\begin{proplis}%
\upshape}
{\end{proplis}}
\newcommand*{\textsfdot}[1]{\textsf{#1.}}
\newlist{pfpartsperiod}{description}{1}
\setlist[pfpartsperiod,1]{%
font=\normalfont,
itemindent=0pt,
wide,
itemsep=0pt,topsep=2pt,
format={\normalfont\textsfdot}
}
\begin{document}
This is how \verb!propertylist! works:
\begin{propertylist}{P}
\item Property one.
\item Property two.
\end{propertylist}
Options \verb!labelindent=0pt! and \verb!resume! for an \verb!enumitem! lists prevents extra space after ``\emph{Proof.} '' as in:
\begin{proof}
%
\begin{pfpartsperiod}[labelindent=0pt]
\item[Sufficiency] The condition suffices because of thi.
\end{pfpartsperiod}
\begin{pfpartsperiod}[resume]
\item[Necessity] The condition is also necessary since that.
\end{pfpartsperiod}
%
\end{proof}
%
\noindent\textbf{How can these options be used}, instead, with \verb!propertylist!, as in the following?
\begin{proof}
%
\begin{propertylist}{P}[labelindent=0pt]
\item Property one.
\end{propertylist}
\begin{propertylist}{P}[resume]
\item Property two.
\end{propertylist}
%
\end{proof}
\end{document}
答案1
您希望\begin{propertylist}{P}
能够将括号中的参数传递给proplis
,但这只有\begin{proplis}
在最后的定义中的项目。\upshape
相反,您有。
但实际上您必须使用“内部”形式\proplis
才能resume
工作,因为否则它无法处理要从中恢复的正确环境名称。
\documentclass{article}
\usepackage{amsthm}
\usepackage{enumitem}
\newlist{proplis}{enumerate}{1}
\newenvironment{propertylist}[1]{%
\setlist[proplis,1]{%
wide,
leftmargin=*,
label=\upshape(#1\arabic*),
}%
\upshape
\proplis}
{\endproplis}
\newcommand*{\textsfdot}[1]{\textsf{#1.}}
\newlist{pfpartsperiod}{description}{1}
\setlist[pfpartsperiod,1]{%
font=\normalfont,
itemindent=0pt,
wide,
itemsep=0pt,topsep=2pt,
format={\normalfont\textsfdot}
}
\begin{document}
This is how \verb!propertylist! works:
\begin{propertylist}{P}
\item Property one.
\item Property two.
\end{propertylist}
Options \verb!labelindent=0pt! and \verb!resume! for an \verb!enumitem!
lists prevents extra space after ``\emph{Proof.} '' as in:
\begin{proof}
%
\begin{pfpartsperiod}[labelindent=0pt]
\item[Sufficiency] The condition suffices because of thi.
\end{pfpartsperiod}
\begin{pfpartsperiod}[resume]
\item[Necessity] The condition is also necessary since that.\qedhere
\end{pfpartsperiod}
%
\end{proof}
%
\noindent\textbf{How can these options be used}, instead, with
\verb!propertylist!, as in the following?
\begin{proof}
%
\begin{propertylist}{P}[labelindent=0pt]
\item Property one.
\end{propertylist}
\begin{propertylist}{P}[resume]
\item Property two.\qedhere
\end{propertylist}
%
\end{proof}
\end{document}
我使用它\qedhere
是因为我受不了悬垂的墓碑。