Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Having a description like this:

\begin{description}
\item[One or several threads are operating concurrently on some data structure, which is bad because and also blablabla.]
\end{description}

How is it possible to avoid that this (admittedly long) tag is written to one line? I want it to line break. Currently it is written to one line and goes outside of the document :(

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

I really think this is not the intended purpose of \item[], but maybe using a \parbox would help:

\begin{description}
\item[\parbox{10em}{One or several threads are operating concurrently
on some data structure, which is bad because and also blablabla.}]
\end{description}
share|improve this answer
2  
I fully agree in both points. However, I would use a length in em or ex, e.g. 10em or 15em or similar. –  Martin Scharrer Jul 27 '11 at 15:18
3  
if used for all, consider redefining \descriptionlabel to hold the \parbox (that is rather useful) –  daleif Jul 27 '11 at 15:27
    
@Martin: fixed! –  Stéphane Gimenez Jul 27 '11 at 16:08
1  
Depending on exactly what the author wants, it might be preferable to set the width of the parbox to \linewidth-\labelindent (or whatever the itemize indentation length is called)... –  Seamus Jul 27 '11 at 16:13
add comment

With enumitem:

\setlist[description]{style=unboxed}

(Syntax for 3.x. With 2.x use \setdescription). By default, LaTeX boxes description labels (in fact, all list labels), and style=unboxed does the obvious thing.

share|improve this answer
1  
Much better than parboxing around, IMHO. –  DevSolar Oct 12 '11 at 16:36
    
This is the easiest and cleanest option, in my humble opinion. I was also having the same issue, and it was totally solved with this solution (I was already using enumitem). –  Vicent Dec 29 '13 at 9:24
add comment

Two solutions that might be better suited to what you actually want to achieve. Just use itemize or use paragraphs instead:

\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{itemize}[label={}]
\bfseries
\item An extremely long description that is written in bold and so on which is long enough to wrap properly
\item Another item
\end{itemize}

Or you could just use paragraphs:

\paragraph{A very long item with lots of words in it and so on and then some normal text}

This text is normal
\end{document}

If you want the indentation as well, there are packages that can help there. (To have a collection of paragraphs indented more...)

share|improve this answer
    
\bf!? You meant \bfseries! –  Martin Scharrer Jul 27 '11 at 16:13
    
@Martin you're right. I forgot the command \bffamily? \bfshape? I always forget these things... –  Seamus Jul 27 '11 at 16:20
    
Yeah, I know. I used to run latexdef textbf all the time to see the name again! :-) (\textbf uses \bfseries internally). –  Martin Scharrer Jul 27 '11 at 16:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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