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.

Maybe it's my terrible lack of sleep but I can't get my head around enumitem's horizontal spacing parameters.

What I want is a decription enviroonment in which the first line of each item (where the item title is) is aligned to same left-margin as the the serrounding text and all lines below it are indented by the "normal" amount.

Like so;

--------
Some test

**Some Item** item description
   continues here on indented line

**Another Item** item description
   continues here on indented line
--------

Can anyone show me how to get this result with enumitem's 5-10 spacing parameters (labelmargin,itemindent, labelsep,labelwidth,labelindent, ...)?

MWE:

\documentclass{article}

\usepackage{parskip} %to disable paragraph indentation but still keep paragraphs separated (with \parskip)
\setlength{\parskip}{2.75ex plus 0.5ex minus 0.2ex}

\usepackage{enumitem}

\usepackage{lipsum}  

\begin{document}

\lipsum[1]
\begin{description}%[WHAT SHOULD I PUT HERE?]
\item Some Item: item description
   continues here on indented line
   when the description is long

\item Another Item: item description
   continues here on indented line
   when the description is long
\end{description}
\end{document}

With this code the "item titles" are slightly indented, which is what I don't want.

share|improve this question

2 Answers 2

up vote 8 down vote accepted

Perhaps some explanation of what's going would be helpful. showframe was used to highlight the text block boundaries, while lipsum provides dummy text, Lorem Ipsum style.

Consider the following MWE:

enter image description here

\documentclass{article}
\usepackage{showframe}% http://ctan.org/pkg/showframe
\usepackage{enumitem}% http://ctan.org/pkg/enumitem
\usepackage{lipsum}  % http://ctan.org/pkg/lipsum
\begin{document}
\lipsum[1]
\begin{description}
\item Some Item: item description
   continues here on indented line
   when the description is long

\item Another Item: item description
   continues here on indented line
   when the description is long
\end{description}
\end{document}

You notice the gap between the left margin and the first heading. This is because \item in the description environment actually typesets a label "heading" in bold. This <heading> is given by the optional argument to \item[<heading>]. If you specify nothing (no optional argument), the regular gap between the "heading" and the "item body" (or the length \labelsep) is inserted. To remove this, you could use

enter image description here

% similar to the above MWE
\begin{description}
\item \hskip-\labelsep Some Item: item description
   continues here on indented line
   when the description is long

\item Another Item: item description
   continues here on indented line
   when the description is long
\end{description}
% similar to the above MWE

This, however, defeats the purpose of an itemized list (which description is), since there is no "item" or "heading". Another way to obtain the formatting you're after, is to use enumitem and format an itemize environment without any label:

enter image description here

% similar to the above MWE
\begin{itemize}[label=,itemindent=-2.5em,leftmargin=2.5em]
\item Some Item: item description
   continues here on indented line
   when the description is long

\item Another Item: item description
   continues here on indented line
   when the description is long
\end{itemize}
% similar to the above MWE

This indents the entire itemize environment by 2.5em (given by leftmargin), "undents" only the itemindent (the first line indent) by the same amount, and typeset no label (label=).

However, if your main aim is to remove the typesetting from the item heading itself, rather format it using enumitem and use the structure that the list was intended for:

enter image description here

% similar to the above MWE
\begin{description}[format=\normalfont]
\item[Some Item:] item description
   continues here on indented line
   when the description is long

\item[Another Item:] item description
   continues here on indented line
   when the description is long
\end{description}
% similar to the above MWE
share|improve this answer
    
+1 great! By this explanation you solved my enumitem-problem, too! Thank! –  Stephen Feb 12 '12 at 15:01

I seem to get the behavior you describe without adjusting any parameters:

enter image description here

Notes:

  • The [showframe] option was used with the geometry package to see the frame.
  • The lipsum package was used to provide dummy text.

Code:

\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{enumitem}
\usepackage{lipsum}

\begin{document}
\begin{description}
\item [Lipsum 1] \lipsum[1]

\item [Lipsum 2] \lipsum[2]
\end{description}
\end{document}
share|improve this answer
    
Nope, put some text above it and you will see that the item titles are slightly indented. –  Matthias Dec 20 '11 at 1:27
    
I added a MWE in my question, based on your code. –  Matthias Dec 20 '11 at 1:32
    
Have updated the MWE, and also correctly used [] to specify the item title and you can see that there is no indentation. –  Peter Grill Dec 20 '11 at 1:44

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.