jbezos / enumitem

Customize enumerate, itemize and description
MIT License
48 stars 5 forks source link

style=multiline doesn't behave identical to its documented equivalent #28

Closed schtandard closed 2 years ago

schtandard commented 3 years ago

According to page 12 of the documentation, style=multiline should be equivalent to style=standard,align=parleft,labelwidth=!. However, the following MWE show a difference between both.

\documentclass{article}

\usepackage{geometry}
\usepackage{enumitem}

\begin{document}

\begin{description}[
      style=multiline,
      align=right, leftmargin=!, labelwidth=4cm]
    \item[a label too wide for the given labelwidth] text
\end{description}

\begin{description}[
      style=standard, align=parleft, labelwidth=!,
      align=right, leftmargin=!, labelwidth=4cm]
    \item[a label too wide for the given labelwidth] text
\end{description}

\end{document}

image

The first list produces an Infinite glue shrinkage error (unexpected output), the second doesn't.

While this example isn't really a useful application of the package, it is a real world example from a tex.sx question.

jbezos commented 2 years ago

The error comes from an internal optimization for the multiline style, which assumes a \parbox. Anyway, what you are doing is essentially setting style=multiline, just to unsetting it (because right is a single-line horizontal box). If you need a \parbox’ed label with a different internal alignment, the solution is the one in tex.sx.

jbezos commented 2 years ago

Documented in development.