1

This question is related to this answer: https://tex.stackexchange.com/a/69525/13552.

The documentation for enumitem (on page 7 in Version 3.5.2 2011-09-28) says that

nextline: if the label does not fit in the margin, the text continues in the next line, otherwise it is placed in a box of width \leftmargin − \labelsep, i.e., the item body never sticks into the left margin. Sets labelwidth=!.

My goal would be to get all text to continue onto the next line regardless of the label's width.

Example

\documentclass{article}
\usepackage{enumitem}
%\setlist[description]{style=nextline} % Optional Global Setup

\begin{document}
\begin{description}[style=nextline] % Local Setup
  \item [Green] The color green.
  \item [Red] The color red.
  \item [Yellow] The color yellow.
\end{description}
\end{document}
  • I'm confused. Isn't that what happens in your example code? – Gonzalo Medina Aug 20 '15 at 16:07
  • @GonzaloMedina True. I need to find a way to replicate a scenario where the label DOES fit into the margin at least once in a minimal example. Nonetheless, the issue is still there. – Jonathan Komar Aug 20 '15 at 16:28
  • If you change \item [Green] The color green. to \item [G] The color g. in your example code. one can see the effect you want to avoid. – Gonzalo Medina Aug 20 '15 at 18:42
1

Set leftmargin to 0pt so nothing can fit there and the new line is forced:

\documentclass{article}
\usepackage{enumitem}
%\setlist[description]{style=nextline,leftmargin=0pt} % Optional Global Setup

\begin{document}
\begin{description}[style=nextline,leftmargin=0pt] % Local Setup
  \item [Green] The color green.
  \item [Red] The color red.
  \item [Yellow] The color yellow.
\end{description}
\end{document}

enter image description here

Another option, allowing you to have indentation for the description texts is to set labelwidth to 0pt (with style=nextline this always forces a new line), and then control other lengths such as leftmargin and itemindent:

\documentclass{article}
\usepackage{enumitem}
\setlist[description]{style=nextline,labelwidth=0pt,leftmargin=30pt,itemindent=\dimexpr-20pt-\labelsep\relax} % Optional Global Setup

\begin{document}
\noindent
Some test text
\begin{description}[style=nextline,labelwidth=0pt,leftmargin=30pt,itemindent=\dimexpr-20pt-\labelsep\relax] % Local Setup
  \item[Green]The color green.
  \item[Red] The color red.
  \item[Yellow] The color yellow.
\end{description}
\end{document}

enter image description here

  • Thanks. Actually I thought about that, but it is not aesthetically pleasing. +1 for working solution though! Maybe I will end up going for this option if I cannot find a better solution. – Jonathan Komar Aug 20 '15 at 17:17
  • @macmadness86 What would you consider an "aesthetically pleasing" solution? Please explain clearly what you want to achieve. – Gonzalo Medina Aug 20 '15 at 17:26
  • Exactly the same indentation as the default description list with style=nextline enabled. More importantly, I think the ability to control indentation is important and should not be sacrificed. – Jonathan Komar Aug 20 '15 at 17:37
  • @macmadness86 I see your point. Please see my updated answer. – Gonzalo Medina Aug 20 '15 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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