355

What is the best way to change the amount of vertical space between items in list environments (globally or locally)?

Werner
  • 603,163
Mark Meckes
  • 17,791

4 Answers4

358

The easiest way to do this is to use the enumitem package.

\documentclass{article}
\usepackage{lipsum} % for dummy text
\usepackage{enumitem}
\setlist{nosep} % or \setlist{noitemsep} to leave space around whole list

\begin{document}
\lipsum[1]
\begin{enumerate}
\item foo
\item bar
\end{enumerate}
\lipsum[2]
\end{document}

The enumitem package also allows you to set the list spacing for a particular type or level of list, or for any particular individual list:

\setlist[2]{noitemsep} % sets the itemsep and parsep for all level two lists to 0
\setenumerate{noitemsep} % sets no itemsep for enumerate lists only
\begin{enumerate}[noitemsep] % sets no itemsep for just this list
...
\end{enumerate}

The nosep parameter removes all vertical spacing within and around the list; the noitemsep parameter removes spacing from items but leaves space around the whole list.

You can also set any of the spacing parameters to exact values, either globally (using \setlist) or locally, using the optional argument [...] after the beginning of the environment:

\begin{itemize}[topsep=8pt,itemsep=4pt,partopsep=4pt, parsep=4pt]
\item Some text
\item Some text
\end{itemize}

To see how all of these parameters work, see the following question:

The package also allows complete control over all other aspects of the list formatting too.

Alan Munn
  • 218,180
  • 45
    This is probably the best package for the job. It accepts key value arguments so you could say \begin{enumerate}[itemsep=1pt, topsep=12pt, partopsep=0pt] etc, maybe you should expand a bit in your answer. – yannisl Feb 09 '11 at 16:01
  • 1
    @Yiannis The question did ask for a global change. But I've added some other examples along the lines of what you suggest. Thanks. – Alan Munn Feb 09 '11 at 16:11
  • 2
    Without using this package I can specify the type of item numbering as an optional parameter, e.g. \begin{itemize}[(i)]. How do I do this while using enumitem? Right now I get an error: missing endcsname. – Will May 23 '12 at 04:00
  • 3
    @Will The syntax you suggest is that of the enumerate package. You can emulate that package with enumitem by loading it with the [shortlabels] option (i.e. \usepackage[shortlabels]{enumitem}) But the recommended way is to use the label key: \begin{enumerate}[label={(\roman*)}]. See the enumitem documentation for more information. – Alan Munn May 23 '12 at 04:06
  • nolistsep is nosep in newer versions of enumitem – Andrew Swann Jun 12 '14 at 09:20
  • It would be useful if the answer gave examples of how to use properties like itemsep, topsep, etc (as per @YiannisLazarides' comment). That seems germane to the original question. – Roly Aug 27 '17 at 11:48
  • I do not understand: where do you actually set the new value? – gented Jul 09 '18 at 12:35
  • @gented I've added an example (see also Yiannis' comment), and a link that shows how all of the parameters work. – Alan Munn Jul 09 '18 at 12:58
  • I still don't get how to set it globally... Eg, to 1pt for all lists. – stefanbschneider Sep 21 '21 at 20:06
  • 1
    @CGFoX You can use \setlist in the preamble to set any parameters globally for all lists of a particular type or particular levels of all lists. – Alan Munn Sep 21 '21 at 20:18
151

the least demanding way to do it (no further packages or whatsoever needed) is to define your own environment like this ...

\newenvironment{myitemize}
{ \begin{itemize}
    \setlength{\itemsep}{0pt}
    \setlength{\parskip}{0pt}
    \setlength{\parsep}{0pt}     }
{ \end{itemize}                  } 

... and use it like this ...

\begin{myitemize} 
  \item one 
  \item two 
  \item three 
\end{myitemize}
  • 5
    This works nicely with the moderncv package. (unlike the enumitem solution, where distances are changed even by just loading the package) – srs May 18 '16 at 15:30
  • Doesn't work for me :/ – leonheess Dec 30 '19 at 19:01
  • 1
    @leonheess you may have to add \setlength{\baselineskip}{0pt} to the list of modified lengths from @petermeissner. That worked for me. To my understanding, keeping it inside the itemize environment makes sure this lenght is modified only locally, and not in the whole document. – MetalMathician Aug 16 '22 at 04:48
42

You can use paralist package and use any of its 'compact' lists (compactitem, compactenum, compactdesc).

\documentclass{article}
\usepackage{paralist}
\begin{document}
    Regular itemize
    \begin{itemize}
       \item First
       \item Second
       \item Third
    \end{itemize}

    Compactitem
    \begin{compactitem}
        \item First
        \item Second
        \item Third
    \end{compactitem}
\end{document}

enter image description here

Ignasi
  • 136,588
  • 1
    How do I do the same with enumerate? Is this also included in paralist? EDIT: belive it might be compactenum as mentioned by Herbert – Cutton Eye Mar 18 '18 at 11:54
24

Load package paralist and set

\usepackage{paralist}
  \let\itemize\compactitem
  \let\enditemize\endcompactitem
  \let\enumerate\compactenum
  \let\endenumerate\endcompactenum
  \let\description\compactdesc
  \let\enddescription\endcompactdesc
  \pltopsep=\medskipamount
  \plitemsep=1pt
  \plparsep=1pt

or load package enumitem and \setlist{nosep}