[Tex/LaTex] Wrong line break in description environment after a long label

descriptionline-breaking

I encountered an issue with my description environments: If I use a label that almost is as long as the text width, the explanatory text afterwards is not wrapped correctly.

I am using the mdwlist package with the description* environment, but the problem is reproducible also with the normal description environment (see example below).

Searching for similar problems did not help me so far, because most topics deal with labels that are longer than the text width, which can be treated with the \desclabelwidth command of mdwlist.

What I found so far is that there is the command \desclabelwidth to control the width of the label, and \labelsep to control the width of the separator after the label. Now I think my problem is that the text in the first line after the label is longer than \textwidth\desclabelwith\labelsep. Is there any way to control this width, or do you know any other way to circumvent the problem?

EDIT: I found my problem has to do with my BCOR settings – I set the value to 15mm, then the problem occurs also with short words.

Many thanks!

Here my minimal working example – the word "text" does not fit into the line and in my opinion could as well go into the next one. Instead, I get this warning:

Overfull \hbox (12.03125pt too wide) in paragraph at lines 9–10

\documentclass[BCOR=15mm]{scrbook}

\begin{document}

  \chapter{Issues with descriptions}

  \begin{description}
    \item[A normal label.] A text with short words, nicely wrapped. One two three four five six seven eight nine ten.
    \item[A very long label that is almost as long as the text width, but not quiet.] A text with short words, not so nicely wrapped. One two three four five six seven eight nine ten.
  \end{description}

\end{document}

Output of the code shown below

Best Answer

You've found a very unfortunate combination: there's no possibility to hyphenate "text" and breaking the line after "A" would make the line underfull.

A reason for this is that the text in the description label is typeset in a box, so it doesn't participate in the possible stretching of spaces to justify the line.

With the enumitem package we can change this behavior, by "unboxing" the label. Such an adjustment is not necessary (neither desirable) if the label is short; when it's very long it may be.

If you say

\documentclass[BCOR=15mm]{scrbook}
\usepackage{enumitem}
\begin{document}

\chapter{Issues with descriptions}

\begin{description}[style=unboxed]
\item[A normal label.] A text with short words, nicely wrapped. One two
three four five six seven eight nine ten.
\item[A very long label that is almost as long as the text width, but not quite.] A text
with short words, not so nicely wrapped. One two three four five six
seven eight nine ten.
\end{description}

\end{document}

then the label text will participate in the distribution of spaces in the line and the overfull problem will disappear.

enter image description here

Related Question