2

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 – Phelype Oleinik Mar 18 '20 at 15:55
  • @PhelypeOleinik Thank you for noticing. I changed to scrartcl. – tvk Mar 18 '20 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 '20 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 '20 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. – Javier Bezos Mar 18 '20 at 17:43
3

Inline lists do not use the same horizontal parameters as usual lists – they use afterlabel, \itemjoinanditemjoin*.

\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 '20 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 '20 at 17:08
  • It looks like a bug, in my opinion. – Bernard Mar 18 '20 at 17:18
  • That's probably true. Thank you! – tvk Mar 18 '20 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, inparaenum and inparaitem are defined.

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}

MWE:

solution

\documentclass{article}

\usepackage{enumitem}
\setlist[enumerate,itemize]{wide}

\newlist{inparaenum}{enumerate*}{1}
\setlist[inparaenum]{label=(\arabic*)}

\newlist{inparaitem}{itemize*}{1}
\setlist[inparaitem]{label=\textbullet}

\begin{document}

This is an inline enumeration. 
\begin{inparaenum}
    \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{inparaenum}

And this is an inline itemization. 
\begin{inparaitem}
    \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{inparaitem}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.