196

I'm somewhat of a LaTeX noob, and this is driving me completely nuts.

When I type

\documentclass{article}
\usepackage{enumitem}

\begin{document}
    Some text
    \begin{itemize}[noitemsep]
        \item Item 1
        \item Item 2
        \item Item 3
    \end{itemize}
\end{document}

I don't want the space which appears in between the text "Some text" and the itemization to be there:

screenshot

When I search around on Google all I see is tons of long, complicated advice on this site, StackOverflow, forums, etc. on how to not fix the problem ("parskip is evil", etc.), or tons of vague/confusing answers on what package to look at, with no actual example for me to learn from.

So while this question is already asked many times, I have never found a single concrete answer to this question.

The question couldn't be simpler: How do I "properly" get rid of this extra space?

user541686
  • 9,547

7 Answers7

215

That space is governed by topsep. Set it to 0pt.
You can customize itemize/enumerate environments very easily using the enumitem package.

enter image description here

\documentclass{article}
\usepackage{enumitem}% http://ctan.org/pkg/enumitem
\begin{document}
\noindent Some text
\begin{itemize}[noitemsep]
  \item Item 1
  \item Item 2
  \item Item 3
\end{itemize}
\bigskip\bigskip
Some text
\begin{itemize}[noitemsep,topsep=0pt]
  \item Item 1
  \item Item 2
  \item Item 3
\end{itemize}
\end{document}

To set this globally, use

\usepackage{enumitem}
\setlist[itemize]{noitemsep, topsep=0pt}

See section 5 Global settings (p 9) of the enumitem documentation for more details on this and perhaps creating your own list environment that has these predefined settings.

Werner
  • 603,163
  • 2
    Bonus question: Do you happen to know if there's any way to change the default value for the whole document? :) – user541686 Dec 08 '12 at 03:32
  • @Mehrdad: I've added a reference to a global setting, specific to itemize. You can also create your own list with these settings, if need be. – Werner Dec 08 '12 at 03:39
  • @Mehrdad As Werner have mentioned, you can define a new environment say Itemize with \newenvironment{Itemize}{\begin{itemize}[noitemsep,topsep=0pt]}{\end{itemize}}. But I would go for Werner's solution. – hpesoj626 Dec 08 '12 at 03:48
  • Instead of \setlist[itemize]{noitemsep, topsep=0pt} you can also say \setlist{nosep}, which kills all vertical spacing. – Roald Nov 27 '16 at 15:57
  • 15
    Is this answer still valid? I didn't work for me. – piepi Feb 04 '18 at 05:33
  • 3
    @piepi: Yes. You must be doing something different. For example, using the beamer class (or something else). – Werner Feb 05 '18 at 16:15
  • How does this work with the enumerate command? The square-bracket notation will take 'topsep=0pt' as the bullet point design. – benroth Sep 24 '19 at 08:11
  • 2
    Please mention that you are using the package enumitem. Just copying the itemize block won't work. – Thomas Apr 21 '20 at 11:19
  • 1
    @Thomas: You'll see that I have \usepackage{enumitem} in the preamble, so that means that I am "using the package enumitem." – Werner Apr 21 '20 at 15:18
  • 1
    It cannot reduce the top sep space (beyond a certain minimum) even if I set it to negative value. But it is good enough. I think this is the best and simplest answer so far. – Yan King Yin Apr 02 '21 at 12:04
  • What would be the default values of topsep and bottomsep? Or where to check them, for that matter? – Daneel Olivaw Nov 15 '21 at 15:26
  • @DaneelOlivaw: This depends on the font size you load. If, for example, you load \documentclass{article}, the default font size is 10pt, with the list parameters \@listi set in size10.clo. There's also size11.clo and size12.clo if you load one of the default classes with either 11pt or 12pt options. – Werner Nov 15 '21 at 18:10
  • 1
    He only asked how to remove the space before the list; your solution removes the space before and after. I cannot find a similar option in the package documentation. Do you happen to know of a proper option? (I can append the list with \vspace{-\baselineskip} or whatever, but I consider that a hack.) Thanks! – Lucas Jan 19 '22 at 06:07
  • Same question as @Lucas actually. Did you found an answer? – Daneel Olivaw Mar 02 '22 at 15:55
  • @DaneelOlivaw: Consider this example. It has 2 pages that line up perfectly vertically. The first page uses a list with noitemsep and topsep=0pt (which is equivalent to nosep) and the second page sets a similar list as a bunch of \paragraphs. Without investigating, I think the bottom gap is just whatever you have for itemsep, so not necessarily \baselineskip. – Werner Mar 02 '22 at 20:29
  • @Werner I may have missed your point, but here is by MWE: https://github.com/lucasreddinger/etc/tree/master/stackexchange.tex/q-86054-how-to-remove-the-whitespace-before-itemize-enumerate – Lucas Mar 04 '22 at 02:35
15

The enumitem package now provides [nosep] to suppress the space above and below lists as well as the space between items. However, this option does not suppress the space above and below the list if you are also using the parskip package in your document.

Peter Flynn
  • 2,870
  • 1
    This answer doesn't make sense... parskip doesn't provide a nosep option. – Werner Oct 13 '16 at 21:20
  • Are you meaning enumitem rather than parskip? But it's not a package option anyway. – egreg Oct 13 '16 at 21:27
  • 1
    Sorry, I was not as explicit as I should have been: the [nosep] option in the enumitem package does not work if you are also using the parskip package in the document. – Peter Flynn Oct 23 '16 at 21:17
  • Plus, yes, the first parskip should read enumitem. I need more coffee, sorry. – Peter Flynn Oct 23 '16 at 21:48
  • can you edit your answer with these corrections? Might reduce your downvotes. – Joel Feb 16 '17 at 19:03
  • 1
    So how do I suppress the space above and below lists if I am using parskip? – incandescentman Feb 14 '18 at 08:49
  • 1
    You have to do it manually: \kern-\parskip\begin{itemize} then your \items and then \end{itemize}\kern-\parskip. I am assuming there is a typographical reason why you want to do this: if you use parskip then you presumably expect space above and below lists. It looks a little weird having space between paragraphs but not before and after lists. – Peter Flynn Feb 15 '18 at 20:30
  • @PeterFlynn Not working :/ – leonheess Dec 30 '19 at 19:45
  • 1
    You'd need to provide more information than 'not working'. What I suggested works fine in a default 'article' type document – Peter Flynn Jan 04 '20 at 12:13
14

An alternative to this is to just use:

\usepackage{paralist}

And the compactitem environment:

\begin{compactitem} 
    \item This is entry number one, compact 
    \item This is entry number two, compact 
\end{compactitem}

to see more on this, check: Compact lists with paralist.

PLG
  • 1,202
7

In some cases you might need to add \nointerlineskip after an itemize environment to get rid of spacing below.

6

Between an itemize environment and its preceding text, a length, \parskip, also adds to that space. Enumitem package does not control it. To completely eliminate that space without changing \parskip, you can use

\setlist{nosep,topsep=-\parskip}

to offset that space globally. You may also set it per-environment.

jxy
  • 161
  • This answer is very helpful!

    You can also set-up a key to use which does this if you only want it for some lists:

    \SetEnumitemKey{noparskip}{nosep, topsep=-\parskip}

    – jw5801 Jun 27 '23 at 07:28
5

This worked for me, add minus topsep=-8pt

\begin{itemize}[noitemsep,topsep=-8pt]
0

For people that still can't figure it out, just do the dumb-down straight-to-the-point method \vspace*{-#mm} underneath the item for example, enter image description here