0

How can I make a multi-line description label with the description following the label instead of under the label, on a new line?

I currently use:

\usepackage{enumitem}
:
\setlist[description]{leftmargin=0em}
:
\begin{description}
  \item [{\parbox[t]{1\linewidth}{Optimization of molecular methods and
  statistical procedures for forensic fingerprinting of microbial
  soil communities}}]
  description of this item
\end{description}

Which gives me multiline but (of course) the text comes on a new line underneath the label.

Desired result is:

Optimization of molecular methods and statistical procedures for forensic fingerprinting of microbial soil communities description of this item

  • 1
    Welcome to TeX SX! Would you mind posting a fully compilable, albeit minimal, document? – Bernard Aug 8 '16 at 20:03
  • Isn't it what style sameline does? – Christoph Frings Aug 8 '16 at 20:12
  • @ChristophFrings Thanks, that does the trick! – John Bokma Aug 9 '16 at 1:18
0

As @Christoph Frings says, this partly what style=sameline does. You are also working too hard in that you do not need to put the label into a \parbox, as the enumitem package will take care of this for you. In fact, using the \parbox forces the line break that you don't want!

With these two changes your MWE produces:

enter image description here

Here is the full code:

\documentclass{article}
\usepackage{enumitem}
\begin{document}

\setlist[description]{leftmargin=0em,style=sameline}
\begin{description}
  \item [Optimization of molecular methods and statistical procedures
  for forensic fingerprinting of microbial soil communities]
  description of this item
\end{description}
\end{document}
  • @JohnBokma The normal way to thank is to give a green tick:) – Andrew Aug 9 '16 at 2:12
  • done, apologies for my n00b (ab)use of stackexchange (first post). Will read up later this week to avoid such mishaps in the future. – John Bokma Aug 9 '16 at 21:53

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.