我使用\setlist{wide}
该软件包enumitem
取消垂直(普通)列表中某项的后续行的缩进。此无缩进规则是出版商的指导方针,我无法更改。
问题是当我写一个排队列出标签和项目内容之间有时会出现多余的空格。(请参阅 MWE:“1.”和“The first thing...”之间有明显的额外空格。)
我怎样才能摆脱这个多余的空间?
梅威瑟:
\documentclass{article}
\usepackage[inline]{enumitem}
\setlist{wide}
\begin{document}
This is an inline enumeration.
\begin{enumerate*}
\item The first thing to enumerate. There should not be excessive space
between the number and the content.
\item The second thing to enumerate.
\item The third thing to enumerate.
\end{enumerate*}
\end{document}
答案1
内联列表不使用与通常列表相同的水平参数——它们使用afterlabel
、\itemjoin
和\itemjoin*
。
\documentclass{scrartcl}
\usepackage[inline]{enumitem}
\begin{document}
This is an inline enumeration.
\begin{enumerate*}[afterlabel=\hspace{2pt}, itemjoin=\quad]
\item The first thing to enumerate. There should not be excessive space
between the number and the content.
\item The second thing to enumerate.
\item The third thing to enumerate.
\end{enumerate*}
\end{document}
答案2
下列的哈维尔·贝佐斯的评论,我整理了以下解决方案(参见下面的 MWE)。wide
列表选项仅适用于enumerate
和。定义了itemize
两个内联列表inlineenum
和。inlineitem
梅威瑟:
\documentclass{article}
\usepackage{enumitem}
\newlist{inlineenum}{enumerate*}{1}
\setlist*[inlineenum]{mode=unboxed,label=(\arabic*)}
\newlist{inlineitem}{itemize*}{1}
\setlist*[inlineitem]{label=\textbullet}
\setlist[enumerate,itemize]{wide}
\begin{document}
This is an inline enumeration.
\begin{inlineenum}
\item The first thing to enumerate. There should not be excessive space
between the number and the content.
\item The second thing to enumerate.
\item The third thing to enumerate.
\end{inlineenum}
And this is an inline itemization.
\begin{inlineitem}
\item The first thing to itemize. There should not be excessive space
between the number and the content.
\item The second thing to itemize.
\item The third thing to itemize.
\end{inlineitem}
\end{document}
评论。如果你使用的文档类已经默认实现了“宽”垂直列表,并且不需要的广泛功能enumitem
,那么你可以使用该paralist
包来实现内联列表inparaenum
,并inparaitem
使用
\usepackage[olditem, oldenum]{paralist}