LaTeX example - enumerate and itemize line spacing

LaTeX line spacing FAQ: How can I control the line spacing in itemize and enumerate tags?

What I did was to create my own LaTeX command, and then use that command instead of the traditional enumerate tag. (This works just as well for the itemize tag.)

The LaTeX example below shows how to create your own command named packed_enum. After you define this command, just use it instead of enumerate or itemize, and your line spacing will essentially be reduced to single line spacing.

Note that this problem does not occur when you're generating LaTeX HTML documents, but does rear it's ugly head when you're generating LaTeX PDF documents. The default line spacing is just too large for my purposes.

Without any further ado, here is a complete Latex source code example that shows how to define and use a new tag to condense lines in enumerate lists.

\documentclass[letterpaper,11pt]{report}

\newenvironment{packed_enum}{
\begin{enumerate}
  \setlength{\itemsep}{1pt}
  \setlength{\parskip}{0pt}
  \setlength{\parsep}{0pt}
}{\end{enumerate}}

\begin{document}

\chapter{Movies I need to watch}

Here is a short list of movies I need to watch some day:

\begin{packed_enum}
   \item The Longest Day
   \item Kill Bill 1
   \item Kill Bill 2
   \item Pretty much every other movie created in the last 30 years. :)
\end{packed_enum}

\end{document}
Permalink

Very nice. Thanks.

Permalink

works like a charm

Permalink

You can also use \itemsep and \parskip to adjust the line spacing.

\begin{enumerate}
\itemsep 1pt
\parskip 0pt
\item First
\item Second
\item Third
\item \ldots
\end{enumerate}

Permalink

This will change how the standard itemize and enumerate works and give both a smaller spacing.


\let\olditemize=\itemize
\def\itemize{
\olditemize
\setlength{\itemsep}{-1ex}
}
\let\oldenumerate=\enumerate
\def\enumerate{
\oldenumerate
\setlength{\itemsep}{-1ex}
}

Not my code, but i can't remember where i got it from.

Permalink

Thanks for that. Works a treat :D

Permalink

Thank you, very helpful. — Bas Dirks

Add new comment

The content of this field is kept private and will not be shown publicly.

Anonymous format

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul type> <ol start type> <li> <pre>
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.