减少枚举列表中的水平空间

减少枚举列表中的水平空间

为了细分更长的定理证明,我使用了两个使用enumitem:定义的列表环境,pfsteps分别用于编号步骤和pfparts标记部分。

水平空间问题

1)在pfsteps枚举列表中,水平空间似乎有点太多步骤编号后面的冒号 — 比普通文本中冒号后面的空间更大。2
) 在pfsteps枚举列表和pfparts描述列表中,“证明”和列表的第一个标签之间的水平空间肯定太多了。

问题

问题 1) 可以通过使用类似于for\hspace{-1pt}定义中冒号后的注释行来解决。但是有没有更好的方法来减少这个空间?labelpfsteps

pfsteps对于和pfparts列表环境,问题 2) 如何修复。

样本来源

\documentclass[12pt]{memoir}

\usepackage{amsthm}

% Indent ``Proof.''
\usepackage{xpatch}
\newlength{\normalparindent}
\AtBeginDocument{\setlength{\normalparindent}{\parindent}}
\xpatchcmd{\proof}{\hskip\labelsep}{\hskip\labelsep\hskip\normalparindent}{}{}

\let\oldproofname=\proofname
\renewcommand{\proofname}{\sffamily\bfseries{\oldproofname}}


\usepackage{enumitem}

\newlist{pfsteps}{enumerate}{3}
\setlist[pfsteps,1]{%
  %label=\sffamily{Step {\arabic*}:\hspace{-1pt}},
  label=\sffamily{Step {\arabic*}:},
  ref=\normalfont{\arabic**},
  wide,itemsep=0pt,topsep=0pt
}

\newlist{pfparts}{description}{1}
\setlist[pfparts,1]{%
  font=\normalfont\textsf,
  itemindent=0pt,
  wide,
  itemsep=0pt,topsep=2pt,
}

\begin{document}

Proof using \verb!pfsteps! enumerate list.

\begin{proof}

\begin{pfsteps}

\item do this first. The way to begin is to start at the very beginning and use the definitions involved to get going.

\item do this next. After the initial step, we proceed by showing something interesting next.

\item conclude with this. That's it! \qedhere

\end{pfsteps}

\end{proof}

\bigskip

Proof using \verb!pfparts! description list.

\begin{proof}

\begin{pfparts}

\item[Sufficiency.] First we show that the stated condition is sufficient for the conclusion to hold.

\item[Necessity.] To conclude the proof we show that the stated condition is a necessary condition for the conclusion. \qedhere

\end{pfparts}

\end{proof}

\bigskip

For comparison, a proof that is not divided into steps or parts.

\begin{proof}

Here is the proof of the main result.
%
\end{proof}


\end{document}

输出

在下面显示的输出中,红色箭头指向过多的空间。(为了进行比较,绿色箭头指向“证明”后的正常空间。)

列表中的水平空间过多

答案1

标签项(步骤)之前的空间由控制labelindent,标签与文本之间的空间由控制labelsep——选择一些适合您的值,我给出的值只是猜测。

\documentclass[12pt]{memoir}

\usepackage{amsthm}

% Indent ``Proof.''
\usepackage{xpatch}
\newlength{\normalparindent}
\AtBeginDocument{\setlength{\normalparindent}{\parindent}}
\xpatchcmd{\proof}{\hskip\labelsep}{\hskip\labelsep\hskip\normalparindent}{}{}

\let\oldproofname=\proofname
\renewcommand{\proofname}{\sffamily\bfseries{\oldproofname}}


\usepackage{enumitem}

\newlist{pfsteps}{enumerate}{3}
\setlist[pfsteps,1]{%
  %label=\sffamily{Step {\arabic*}:\hspace{-1pt}},
  label=\sffamily{Step {\arabic*}:},
  ref=\normalfont{\arabic**},
  wide,itemsep=0pt,topsep=0pt,
  labelindent=0pt,
  labelsep=0.5ex,
}

\newlist{pfparts}{description}{1}
\setlist[pfparts,1]{%
  font=\normalfont\textsf,
  itemindent=0pt,
  wide,
  itemsep=0pt,topsep=2pt,
  labelindent=0pt,
  labelsep=0.5ex,
}

\begin{document}

Proof using \verb!pfsteps! enumerate list.

\begin{proof}

\begin{pfsteps}

\item do this first. The way to begin is to start at the very beginning and use the definitions involved to get going.

\item do this next. After the initial step, we proceed by showing something interesting next.

\item conclude with this. That's it! \qedhere

\end{pfsteps}

\end{proof}

\bigskip

Proof using \verb!pfparts! description list.

\begin{proof}

\begin{pfparts}

\item[Sufficiency.] First we show that the stated condition is sufficient for the conclusion to hold.

\item[Necessity.] To conclude the proof we show that the stated condition is a necessary condition for the conclusion. \qedhere

\end{pfparts}

\end{proof}

\bigskip

For comparison, a proof that is not divided into steps or parts.

\begin{proof}

Here is the proof of the main result.
%
\end{proof}


\end{document}

相关内容