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.

Is there a neat way to push the first line of an item in a description environment over to the right so that it is flush with the second line of the item?

I'm trying to define a LaTeX list environment that lines up with my quotes. The list items will be named, rather than numbered, and so I've been trying to use a description environment to do this. What I would like to get is this:

  Here is some regular text. Note the regular para-
graph indenting.

    Here is some text inside a default quote envir-
    onment.

Here is some regular text.

    Apples: Here is the first item.

    Oranges: Here is the second item. It wraps on-
    to a second line, and is flush with the first
    line about oranges.

Here is some more regular text.

I'm struggling to get this result. I've been playing around with enumitem, but without success (possibly my own fault - I've never been able to get my head around the enumitem spacing commands). If it comes to it, I can get the result using quote environments rather than any kind of list, but that's obviously not ideal.

Any suggestions greatly appreciated.

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

A suggestion with enumitem. The indent-length of 2\parindent is perhaps a little large, but that can of course be changed.

\documentclass{article}

\usepackage[textwidth=20em,showframe]{geometry} % yes, I borrowed this from Qrrbrbirlbel
\usepackage{enumitem}
\newlist{Description}{description}{1}
\setlist[Description]{labelindent=2\parindent,leftmargin=2\parindent}

\begin{document}
Here is some regular text.
Note the regular paragraph indenting.
\begin{quote}
    Here is some text inside a
    default quote environment.
\end{quote}
Here is some regular text.
\begin{Description}
    \item[Apples:] Here is the first item.

    \item[Oranges:] Here is the second item.
    It wraps onto a second line, and is
    flush with the first
    line about oranges.

    More paragraphing.
\end{Description}
Here is some more regular text.
\end{document}

enter image description here

share|improve this answer
    
That works too. I'm not really sure how I missed that; I thought I'd tried every combination of enumitem options. Thanks! Incidentally, using \leftmargin rather than \parindent in the enumitem options gives the correct indent. –  Steven Mar 16 '13 at 6:52
add comment

Something like this?

Code

\documentclass{article}

\usepackage[textwidth=20em,showframe]{geometry}
\newenvironment{Description}{\list{}{%
    \let\makelabel\descriptionlabel    % this comes from the original description environment
    \setlength{\rightmargin}{\leftmargin}% this comes from the original quote environment
    \setlength{\labelwidth}{0pt}%          this is new
    }}{\endlist}

\begin{document}
Here is some regular text.
Note the regular paragraph indenting.
\begin{quote}
    Here is some text inside a
    default quote environment.
\end{quote}
Here is some regular text.
\begin{Description}
    \item[Apples:] Here is the first item.

    \item[Oranges:] Here is the second item.
    It wraps onto a second line, and is
    flush with the first
    line about oranges.

    More paragraphing.
\end{Description}
Here is some more regular text.
\end{document}

Output

enter image description here

share|improve this answer
    
Just like that. Many thanks. –  Steven Mar 16 '13 at 6:41
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.