131

In Latex, how do I eliminate the space inserted before itemize?

\begin{itemize} % produces lots of vertical space
\item ...
\item ...
\end{itemize}
Alexandru
  • 25,070
  • 18
  • 69
  • 78
  • 6
    I'm voting to close this question as off-topic because it's better-suited on [tex.se]. – Werner Mar 02 '18 at 17:03
  • https://tex.stackexchange.com/questions/115907/how-do-i-remove-white-space-above-itemize-command-in-beamer-using-enumitem?noredirect=1&lq=1 – PatrickT Apr 27 '18 at 07:33
  • There are correct answers to this question in https://tex.stackexchange.com/q/86054/157031. (Link shared by PatrickT is also on point) – Cyriac Antony Jun 25 '19 at 05:46

7 Answers7

127

The way to fix this sort of problem is to redefine the relevant list environment. The enumitem package is my favourite way to do this sort of thing; it has many options and parameters that can be varied, either for all lists or for each list individually.

Here's how to do (something like) what it is I think you want:

\usepackage{enumitem}
\setlist{nolistsep}

or

\usepackage{enumitem}
\setlist{nosep}
Will Robertson
  • 62,540
  • 32
  • 99
  • 117
  • 2
    Perfect. Just as easy as the answer of [Stefano Borini], _but_ this solution works even if there are nested lists. Thank you. – devsnd May 16 '12 at 17:15
  • 30
    Even if I set the options to [topsep=0px,partopsep=0px] the vertical space before the list is still there - hence IMHO this answer does not work. – Robert Nov 01 '12 at 15:00
  • 2
    @Robert, why not use a negative number? This works for me: `\begin{enumerate}[topsep=-5px,partopsep=0px] ...` – zkurtz Mar 19 '15 at 20:43
  • 1
    @Robert: According to the enumitem docs, the vertical space before and after a list is given by `\parsep + \topsep [+ \partopsep]`, so you either have to set `\topsep` or `\partopsep` to a negative number to compensate for any positive value of `\parsep`. – balu Jan 11 '20 at 17:02
  • 1
    You can set list parameters globally: `\setlist[itemize]{topsep=-0.2cm}` (see Global settings in documentation of the enumitem package: https://www.ctan.org/pkg/enumitem). – scrutari Apr 24 '21 at 13:52
87

Try \vspace{-5mm} before the itemize.

Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
Stefano Borini
  • 138,652
  • 96
  • 297
  • 431
64
  • Use \vspace{-\topsep} before \begin{itemize}
  • Use \setlength{\parskip}{0pt} \setlength{\itemsep}{0pt plus 1pt} after \begin{itemize}
  • And for the space after the list, use \vspace{-\topsep} after \end{itemize}
\vspace{-\topsep}
\begin{itemize}
  \setlength{\parskip}{0pt}
  \setlength{\itemsep}{0pt plus 1pt}
  \item ...
  \item ...
\end{itemize}
\vspace{-\topsep}
alper
  • 2,919
  • 9
  • 53
  • 102
PeaGon
  • 757
  • 5
  • 2
  • 7
    Nice! Unfortunately enumitem is incompatible with beamer, so I like package-independent methods. `topsep` was too aggressive for me, so I went with \vspace{-0.5\topsep}` – craq Jan 12 '15 at 10:24
  • Doing this for every `itemize` is painful... – Yan King Yin Apr 02 '21 at 11:05
23

The cleanest way for you to accomplish this is to use the enumitem package (https://ctan.org/pkg/enumitem). For example,

enter image description here

\documentclass{article}
\usepackage{enumitem}% http://ctan.org/pkg/enumitem
\begin{document}
\noindent Here is some text and I want to make sure
there is no spacing the different items. 
\begin{itemize}[noitemsep]
  \item Item 1
  \item Item 2
  \item Item 3
\end{itemize}
\noindent Here is some text and I want to make sure
there is no spacing between this line and the item
list below it.
\begin{itemize}[noitemsep,topsep=0pt]
  \item Item 1
  \item Item 2
  \item Item 3
\end{itemize}
\end{document}

Furthermore, if you want to use this setting globally across lists, you can use

\usepackage{enumitem}% http://ctan.org/pkg/enumitem
\setlist[itemize]{noitemsep, topsep=0pt}

However, note that this package does not work well with the beamer package which is used to make presentations in Latex.

user3613932
  • 1,219
  • 15
  • 16
  • As noted (and corrected) elsewhere, the recent versions of enumitem include a [nosep] option which is designed to remove space above and below the list as well as between the items...but it does not do this if you are also using the parskip package. Herbert Voß posted a solution to this on c.t.t. — \setlist{partopsep=-\parskip,parsep=0pt} – Peter Flynn Oct 23 '16 at 21:51
  • When I add `leftmargin=*` it generated newline again, would it be possible to prevent it? – alper Jan 14 '22 at 17:50
12

The "proper" LaTeX ways to do it is to use a package which allows you to specify the spacing you want. There are several such package, and these two pages link to lists of them...

0xC0000022L
  • 20,597
  • 9
  • 86
  • 152
Stobor
  • 44,246
  • 6
  • 66
  • 69
7
\renewcommand{\@listI}{%
\leftmargin=25pt
\rightmargin=0pt
\labelsep=5pt
\labelwidth=20pt
\itemindent=0pt
\listparindent=0pt
\topsep=0pt plus 2pt minus 4pt
\partopsep=0pt plus 1pt minus 1pt
\parsep=0pt plus 1pt
\itemsep=\parsep}
Nemo157
  • 3,559
  • 19
  • 27
Alexey Malistov
  • 26,407
  • 13
  • 68
  • 88
  • 4
    This reduces a lot of the whitespace around the list, but fails to remove some of the whitespace immediately above and below the list itself. – jevon Jul 13 '11 at 05:03
  • This does not work for me... it throws an error unless the code is put inside `\begin{document}`, and even after doing that, it leaves a mysterious `istI` at the beginning of the title page of the PDF. – Yan King Yin Apr 02 '21 at 11:04
  • Where should I put it? – alper Jan 14 '22 at 18:03
7

I'm very happy with the paralist package. Besides adding the option to eliminate the space it also adds other nice things like compact versions of the itemize, enumerate and describe environments.

Fabian Steeg
  • 44,988
  • 7
  • 85
  • 112
  • 1
    Specifically, Fabian is referring to asparaitem, asparaenum and asparadesc and to other things like compactittem, compactenum and compactdesc. aspara does create a new paragraph still. This is still slightly annoying if you're putting them in a table without a preceding paragraph, as I am, but I suspect that there's a less ugly hack to fix this. – Avery Richardson Jan 30 '12 at 12:09