![如何在嵌套枚举环境中删除带有默认标签的添加空间](https://linux22.com/image/278045/%E5%A6%82%E4%BD%95%E5%9C%A8%E5%B5%8C%E5%A5%97%E6%9E%9A%E4%B8%BE%E7%8E%AF%E5%A2%83%E4%B8%AD%E5%88%A0%E9%99%A4%E5%B8%A6%E6%9C%89%E9%BB%98%E8%AE%A4%E6%A0%87%E7%AD%BE%E7%9A%84%E6%B7%BB%E5%8A%A0%E7%A9%BA%E9%97%B4.png)
使用默认标签系统时,我想删除嵌套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
可以模拟语法:enumerate
shortlabels
\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}
产量