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 ofitemjoin
before the last item. So, withbefore=\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.
- the description is immediately followed by
afterlabel
and no breaking is allowed there; - breaking is allowed after
itemjoin
; - spaces are all stretchy
- 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.
.
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}