General ⇒ [Solved] Force a linebreak in label of item / list envir...
[Solved] Force a linebreak in label of item / list envir...
\begin{list}
\item[forcehere a \\ linebreak] Some text right of the label
\item[another label] Some other text
\end{list}
Latex just ignores all kind of unproper behaviour in a list environment like \\ or \linebreak.
Thanks a lot for help!
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
[Solved] Force a linebreak in label of item / list envir...
Consequently, you have to put the argument of \item inside a \parbox, which admits line breaks:
Code: Select all
\begin{description}
\item[{\parbox[t]{0.2\linewidth}{force here \\ a linebreak}}] Some text right of the label
\item[another label] Some other text
\end{description}
Adapt the width of \parbox to your needs. Observe that, whenever you use the first optional argument of \parbox ([t] in this case), you have to enclose \parbox in braces. Remember that, inside an optional argument, brackets cannot directly appear, but "protected" by braces, that is, instead of \item[... [...]...], one has to write \item[{...[...]...}]
Re: Force a linebreak in label of item / list environment
your example works!
One addition: I have to write the item content also in a parbox, or the linebreak in the item-label affects also the item content.
For example:
\item[{\parbox[t]{0.2\linewidth}{force here \\ a linebreak}}] \parbox[t]{1\linewidth}{Some text right of the label}