3

I have some spacing troubles using inline lists from the enumitem package. I know that the way this is used in the example is not elegant typesetting, but it is only to demonstrate the problem.

If I use the standard list for an inline description list (1), then it appears that the space between the label and the item text is stretchy, while after the complete item is processed it is not.

I have tried using the example for setting the options from the manual (2), which doesn't change much. What is also curious is the large space between ttfamily and truetype. I don't know where this is coming from.

I have tries setting a different label and item separator, but a strange breakable space appears, see (3).

I have also tried using unboxed mode, which is kind of what I would expect (4). However, my issue here is that I expected something different than what is written in the manual (p. 9):

An additional key is itemjoin*, which, if set, is used instead of itemjoin before the last item. So, with before=\unskip{: }, itemjoin={{; }}, itemjoin*={{, and }} the following punctuation between items is used:
Blah blah: (a) one; (b) two; (c) three, and (d) four. Blah blah
itemjoin is ignored in vertical mode (i.e., in mode unboxed and just after a quote, a displayed list and the like).

In the example, itemjoin={{, }} is not ignored, and I am starting to believe that the star is missing in that manual. Is this a typo in the manual?

In (5) I tried to simulate what I would expect. I know it looks weird, but that is because of the chosen example. In reality, the label would be rather short, and the following text a bit longer. It does however demonstrate what I want, i.e.

  1. the description is immediately followed by afterlabel and no breaking is allowed there;
  2. breaking is allowed after itemjoin;
  3. spaces are all stretchy
  4. ends with the last line being flushed to the left.

How do I have to set the options for the inline lists so that I achieve the above example?

The enumerate (6) and itemize (7) versions also have a little weird spacing, but visually that is probably mitigated by the small labels. I would, however, expect the same behaviour as with description list, it's just not really an issue here, compare spaces around 1..

output of mwe

And here is the corresponding MWE:

\documentclass[a5paper, twocolumn]{article}

\usepackage[inline]{enumitem}[2011/08/28]

\begin{document}

\section{Inline description list}

Testing a few inline lists with different options.

(1)\\
With the environment \texttt{description*} the list will be
set as a single paragraph.
For example:
\begin{description*}[font={\ttfamily}]
\item[bfseries] \textbf{bold};
\item[itshape]  \textit{italics};
\item[ttfamily] \texttt{truetype}.
\end{description*}

(2)\\
Setting manual options (example from manual) results in weird spacing
\begin{description*}[font={\ttfamily}, before=\unskip{: }, itemjoin={{; }}, itemjoin*={{, and }}]
\item[bfseries] \textbf{bold}
\item[itshape]  \textit{italics}
\item[ttfamily] \texttt{truetype}
\end{description*}

(3)\\
Trying a different label separator for the list:
\begin{description*}[font={\ttfamily}, itemjoin={{, }}, afterlabel={{:\nobreakspace}}, after={{.}}]
\item[bfseries] \textbf{bold}
\item[itshape]  \textit{italics}
\item[ttfamily] \texttt{truetype}
\end{description*}

(4)\\
Trying a different label separator for the list, and unboxing:
\begin{description*}[mode=unboxed, font={\ttfamily}, itemjoin={{, }}, afterlabel={{:\nobreakspace}}, after={{.}}]
\item[bfseries] \textbf{bold}
\item[itshape]  \textit{italics}
\item[ttfamily] \texttt{truetype}
\end{description*}

(5)\\
Trying manually:
\texttt{bfseries}:~\textbf{bold}, \texttt{itshape}:~\textit{italics}, \texttt{it}:~Do not use that one, \texttt{ttfamily}:~\texttt{truetype}.

(6)\\
For comparison, the list with the \texttt{enumerate*} environment looks quite okay:
\begin{enumerate*}
\item \textbf{bold};
\item \textit{italics};
\item \textit{it};
\item \texttt{truetype}.
\end{enumerate*}

(7)\\
For comparison, the list with the \texttt{itemize*} environment has also some weird spaces:
\begin{itemize*}
\item \textbf{bold};
\item \textit{italics};
\item \textit{it};
\item \texttt{truetype}.
\end{itemize*}

\end{document}

1 Answer 1

2

You are correct about the typo in the enumitem manual: If you added, say, itemjoin*={{, and }} to your 4th example, then the following appears in the .log file:

Package enumitem Warning: itemjoin* discarded in mode unboxed

Without specifying itemjoin*=<string>, no warning messages are generated. In fact, the paragraph immediately after your cited paragraph states that

Page 9: … [U]se an alternative “mode”, which you can activate with mode=unboxed (the default is mode=boxes). With it floats may be used freely, but misplaced \items are not catched and itemjoin* is ignored …

However, your 4th example works perfect fine and it already meets all four of your requirements:

\documentclass[a5paper, twocolumn]{article}
\usepackage[inline]{enumitem}[2011/09/28]%[2011/08/28]
\begin{document}

\section{Inline description list}

Testing a few inline lists with different options.

(4)\\
Trying unboxing:
\begin{description*}[mode=unboxed, font={\ttfamily}, itemjoin={{, }}, afterlabel={{:\nobreakspace}}, after={{.}}]
\item[bfseries] \textbf{bold}
\item[itshape]  \textit{italics}
\item[it] Do not use that one
\item[ttfamily] \texttt{typewriterfont}%\texttt{truetype}
\end{description*}

(5)\\
Trying manually:
\texttt{bfseries}:~\textbf{bold},
\texttt{itshape}:~\textit{italics},
\texttt{it}:~Do not use that one,
\texttt{ttfamily}:~\texttt{typewriterfont}.%\texttt{truetype}.

\end{document}

description lists

You must log in to answer this question.

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