4

I use \setlist{wide} with the package enumitem to unindent a subsequent line in an item in vertical (normal) lists. This no indentation rule is a publisher guideline that I cannot change.

The problem is when I write an inline list extra space between the label and the content of an item sometimes emerges. (Please see the MWE: there is apparent extra space between "1." and "The first thing...".)

How can I get rid of this extra space?

MWE:

extra space example

\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}
12
  • 1
    The problem is reproducible with article Mar 18, 2020 at 15:55
  • @PhelypeOleinik Thank you for noticing. I changed to scrartcl.
    – tvk
    Mar 18, 2020 at 16:03
  • Why not article? And do you really need to use \setlist{wide}? The output looks fine without this option.
    – frougon
    Mar 18, 2020 at 16:05
  • 1
    See the contact link on the right side of the page. In there is a mailto form, there enumitem is one of the package options (Javier manages several packages)
    – daleif
    Mar 18, 2020 at 17:29
  • 1
    According to the manual, with wide, “the items look like ordinary paragraphs”, so this setting is not meant for inline lists. Just define inline lists with \newlist, and restrict wideto those list types requiring it. Mar 18, 2020 at 17:43

2 Answers 2

4

Inline lists do not use the same horizontal parameters as usual lists – they use afterlabel, \itemjoin and \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} 

enter image description here

4
  • Thank you for the answer. I do need to retain \setlist{wide} for formatting vertical (normal) lists per publisher guidelines. I'm updating the question to make this clear. If I add \setlist{wide} to your code, the extra space appears again.
    – tvk
    Mar 18, 2020 at 17:02
  • 1
    Yes, I've just seen that, and even iwithout \setlist, just writing \begin[enumerate[wide] for a specific normal list before. Note there exist other packages which manage inline lists, so you might remove the `[inline] option until the problem is solved.
    – Bernard
    Mar 18, 2020 at 17:08
  • It looks like a bug, in my opinion.
    – Bernard
    Mar 18, 2020 at 17:18
  • That's probably true. Thank you!
    – tvk
    Mar 18, 2020 at 17:22
2

Following Javier Bezos's comment, I put together the following solution (see the MWE below). The wide list option is only applied to enumerate and itemize. Two inline lists, inlineenum and inlineitem are defined.

MWE:

solution

\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}

Remark. If you use a document class that already implements "wide" vertical lists by default and you do not need the extensive features of enumitem, you may just use the paralist package to implement the inline lists inparaenum and inparaitem with

\usepackage[olditem, oldenum]{paralist}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .