12

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 description environment in which the first line of each item (where the item title is) is aligned to same left-margin as the the surrounding text and all lines below it are indented by the "normal" amount.

For example:

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.

cxw
  • 275
  • 1
  • 3
  • 12
Matthias
  • 4,051

2 Answers2

10

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
Werner
  • 603,163
7

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}

Peter Grill
  • 223,288