2

Basic question, but I'm just seeking out how to prevent line breaking when using description. I'm very new to latex, so I'm unsure of how it works. The code I have is here.

\begin{description}  
\item[Lane 1]NEB 1kb Ladder  
\item[Lane 2](Single Digest) pET-41a/EGFP Recombinant plasmid  
\item[Lane 3](Double Digest) pET-41a/EGFP Recombinant plasmid  
\item[Lane 4](Undigested) pET-41a/EGFP Recombinant plasmid 

I aplogize, to clarify what I mean by line breaking, I mean that I want to prevent the spacing inbetween each item in the list.

2

Have a look at the enumitem package. The manual will tell you how to get the spacing right. It's to do with the label size, I suspect.

\documentclass{article}


\usepackage[inline]{enumitem}

\begin{document}

\begin{description*} \item[Lane 1]NEB 1kb Ladder; \item[Lane 2](Single Digest) pET-41a/EGFP Recombinant plasmid; \item[Lane 3](Double Digest) pET-41a/EGFP Recombinant plasmid; \item[Lane 4] (Undigested) pET-41a/EGFP Recombinant plasmid.  
\end{description*}
\end{document}
0

Inline description* of enumitem (JPI answer) is ugly because the huge space after labels and the lack of hyphenation of the items have little sense in this mode:

ugly solution

In this case, is better paralist:

mwe4

\documentclass{article}
\usepackage[alwaysadjust]{paralist}
\begin{document}
\begin{inparadesc}
\item[Lane 1.] NEB 1kb Ladder,
\item[Lane 2.] (Single Digest) pET-41a/EGFP Recombinant plasmid, 
\item[Lane 3.] (Double Digest) pET-41a/EGFP Recombinant plasmid and
\item[Lane 4.] (Undigested) pET-41a/EGFP Recombinant plasmid.  
\end{inparadesc}
\end{document}

But, in this case ,as the label have a counter, it is better return to enumitem and use enumerate*, and moreover, control what goes between items, and include " and " between the two last items automatically. I left in red all that is included automatically (of course, remove colors for a real work):

mwe2

Or if you prefer end the item punctuation manually, or not include any, then another option is define your own environment (same output that above using paralist) without using enumitem, o may be intented as with some vertical separastion:

mwe3

\documentclass{article}
\usepackage{xcolor}
\parskip 1em
\usepackage[inline]{enumitem}
\newcounter{descinline}

\def\ditem{\addtocounter{descinline}{1}\textbf{Lane \arabic{descinline}}.~}
\begin{document}

\begin{description*}[leftmargin=*,labelsep=*]
\item[Lanes 1]NEB 1kb Ladder; 
\item[Lane 2](Single Digest) pET-41a/EGFP Recombinant plasmid; 
\item[Lane 3](Double Digest) pET-41a/EGFP Recombinant plasmid; 
\item[Lane 4] (Undigested) pET-41a/EGFP Recombinant plasmid.  
\end{description*}

\begin{enumerate*}[label={\textcolor{red}{\bfseries
Lane\,\arabic*:}}, itemjoin={\textcolor{red}{, }} ,
itemjoin*={\textcolor{red}{ ,\ and\ }}]
\item NEB 1kb Ladder
\item (Single Digest) pET-41a/EGFP Recombinant plasmid
\item (Double Digest) pET-41a/EGFP Recombinant plasmid
\item (Undigested) pET-41a/EGFP Recombinant plasmid.  
\end{enumerate*}

\newenvironment{descinline}{\setcounter{descinline}{0}}{}   
\begin{descinline}%
\ditem NEB 1kb Ladder.  
\ditem (Single Digest) pET-41a/EGFP Recombinant plasmid,   
\ditem (Double Digest) pET-41a/EGFP Recombinant plasmid and   
\ditem (Undigested) pET-41a/EGFP Recombinant plasmid.
\end{descinline}

\renewenvironment{descinline}{\setcounter{descinline}{0}
\list{}{\setlength{\leftmargin}{4em}}\item[]\relax}{\endlist}   
\begin{descinline}%
\ditem NEB 1kb Ladder,  
\ditem (Single Digest) pET-41a/EGFP Recombinant plasmid,   
\ditem (Double Digest) pET-41a/EGFP Recombinant plasmid and  
\ditem (Undigested) pET-41a/EGFP Recombinant plasmid.
\end{descinline}

\end{document}

Or, why reinvent the weel? There are aslo inparaenum (the ouput is the same that inparadesc, but labels are now typed automatically)

\documentclass{article}
\usepackage[alwaysadjust]{paralist}
\begin{document}
\begin{inparaenum}[\bfseries {Lane}~1.]
\item NEB 1kb Ladder,
\item (Single Digest) pET-41a/EGFP Recombinant plasmid, 
\item (Double Digest) pET-41a/EGFP Recombinant plasmid and
\item (Undigested) pET-41a/EGFP Recombinant plasmid.  
\end{inparaenum}
\end{document}

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.