如何在嵌套枚举环境中删除带有默认标签的添加空间

如何在嵌套枚举环境中删除带有默认标签的添加空间

使用默认标签系统时,我想删除嵌套enumerate环境前添加的空格。请注意,我想全局进行此更改,而不是对每个环境都进行此更改。以下是 MWE,说明了我想要的内容。

\documentclass{article}
\usepackage{enumerate}

\newcommand\insertitem[1]{\item{#1}}

\begin{document}
\begin{enumerate}
\item
\begin{enumerate}[(a)]
\item
This is the first enumerate, with the ``custom'' labels.
This is how I would like mt enumerate environments to look in general
\end{enumerate}
\end{enumerate}

\begin{enumerate}
\item
\begin{enumerate}
\item
This is my second enumerate, with the default labels.
Note the extra space between the 1. and (a).
I would like to change this globally to have the same spacing as the first enumerate environment.
\end{enumerate}
\end{enumerate}
\end{document}

有人知道怎么做吗?我试过\leftmargin\itemsep等等,但没有成功。

答案1

不知何故 ”枚举项« 更好地完成工作。

\documentclass{article}
\usepackage{enumitem}

\begin{document}
  \begin{enumerate}
    \item
      \begin{enumerate}[label=(\alph*)]
        \item This is the first enumerate, with the ``custom'' labels. This is how I would like mt enumerate environments to look in general
      \end{enumerate}
  \end{enumerate}

  \begin{enumerate}
    \item
      \begin{enumerate}
        \item This is my second enumerate, with the default labels. Note the extra space between the 1. and (a). I would like to change this globally to have the same spacing as the first enumerate environment.
      \end{enumerate}
  \end{enumerate}
\end{document}

也许这就是原因 »枚举« 已被该包取代。


在此处输入图片描述

答案2

如果使用以下选项加载该包,它enumitem可以模拟语法:enumerateshortlabels

\documentclass{article}
\usepackage[shortlabels]{enumitem}

\newcommand\insertitem[1]{\item{#1}}

\begin{document}
\begin{enumerate}
\item
\begin{enumerate}[(a)]
\item
This is the first enumerate, with the ``custom'' labels.
This is how I would like mt enumerate environments to look in general
\end{enumerate}
\end{enumerate}

\begin{enumerate}
\item
\begin{enumerate}
\item
This is my second enumerate, with the default labels.
Note the extra space between the 1. and (a).
I would like to change this globally to have the same spacing as the first enumerate environment.
\end{enumerate}
\end{enumerate}
\end{document}

代码输出

答案3

虽然我不推荐这样做,但是如果您无法切换到该enumitem软件包,您可以通过在序言中添加此行来解决您的问题:

\setlength{\labelsep}{1em}

这样你修改后的 MWE

\documentclass{article}
\usepackage{enumerate}

\newcommand\insertitem[1]{\item{#1}}

\setlength{\labelsep}{1em}

\begin{document}
\begin{enumerate}
\item
\begin{enumerate}[(a)]
\item
This is the first enumerate, with the ``custom'' labels.
This is how I would like mt enumerate environments to look in general
\end{enumerate}
\end{enumerate}

\begin{enumerate}
\item
\begin{enumerate}
\item
This is my second enumerate, with the default labels.
Note the extra space between the 1. and (a).
I would like to change this globally to have the same spacing as the first enumerate environment.
\end{enumerate}
\end{enumerate}
\end{document} 

产量

在此处输入图片描述

相关内容