share
TeX - LaTeXHow to remove the whitespace BEFORE itemize/enumerate?
[+221] [7] user541686
[2012-12-08 03:22:52]
[ spacing enumerate itemize ]
[ https://tex.stackexchange.com/questions/86054/how-to-remove-the-whitespace-before-itemize-enumerate ]

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?

[+237] [2012-12-08 03:28:05] Werner [ACCEPTED]

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 [1] for more details on this and perhaps creating your own list environment that has these predefined settings.

[1] http://mirror.ctan.org/macros/latex/contrib/enumitem/enumitem.pdf

(3) Bonus question: Do you happen to know if there's any way to change the default value for the whole document? :) - user541686
@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
@Mehrdad As Werner have mentioned, you can define a new environment say Itemize with \newenvironment{Itemize}{\begin{itemize}[noitemsep,topsep=0p‌​t]}{\end{itemize}}. But I would go for Werner's solution. - hpesoj626
(1) Instead of \setlist[itemize]{noitemsep, topsep=0pt} you can also say \setlist{nosep}, which kills all vertical spacing. - Roald
(21) Is this answer still valid? I didn't work for me. - piepi
(3) @piepi: Yes. You must be doing something different. For example, using the beamer class (or something else). - Werner
How does this work with the enumerate command? The square-bracket notation will take 'topsep=0pt' as the bullet point design. - benroth
(3) Please mention that you are using the package enumitem. Just copying the itemize block won't work. - Thomas
(2) @Thomas: You'll see that I have \usepackage{enumitem} in the preamble, so that means that I am "using the package enumitem." - Werner
(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
What would be the default values of topsep and bottomsep? Or where to check them, for that matter? - Daneel Olivaw
@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
(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
Same question as @Lucas actually. Did you found an answer? - Daneel Olivaw
@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
@Werner I may have missed your point, but here is by MWE: github.com/lucasreddinger/etc/tree/master/stackexchange.tex/‌​… - Lucas
@Lucas: two years late, but tex.stackexchange.com/questions/619914/… probably answers your question. The short answer is LaTeX forces the separation before and after to be the same, so you cannot get rid of one and not the other, unless you do some sort of "hack". - Willie Wong
1
[+19] [2016-10-13 21:14:41] Peter Flynn

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.


(1) This answer doesn't make sense... parskip doesn't provide a nosep option. - Werner
Are you meaning enumitem rather than parskip? But it's not a package option anyway. - egreg
(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
Plus, yes, the first parskip should read enumitem. I need more coffee, sorry. - Peter Flynn
can you edit your answer with these corrections? Might reduce your downvotes. - Joel
(1) So how do I suppress the space above and below lists if I am using parskip? - incandescentman
(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
@PeterFlynn Not working :/ - leonheess
(1) You'd need to provide more information than 'not working'. What I suggested works fine in a default 'article' type document - Peter Flynn
@incandescentman based on tex.stackexchange.com/a/328066/185167 you can do something like \setlist{nosep, before={\parskip=0pt}} - wfsch
2
[+17] [2015-05-26 08:52:09] PLG

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.


Can you please check the link, looks suspicious, it redirects me to a scam website - Mohsen Sichani
Broken link indeed. You will have to Google "Compact lists paralist". - PLG
(2) This is incompatible with beamer - Spenhouet
3
[+11] [2022-09-30 19:46:40] jxy

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

\usepackage{enumitem}
...
\setlist{nosep,topsep=-\parskip}

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


(1) 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
Thank you! This is the "correct" answer for how to deploy enumerate or itemize as an integral part of a paragraph. - MRule
4
[+7] [2019-04-21 11:16:30] Michael Andersen

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


This makes the vertical spacing after the environment inconsistent. - Phelype Oleinik
(5) This is the only thing that worked for me with beamer - Spenhouet
(2) Is there another option to get rid of the space above itemize / enumerate? - mhellmeier
An extra environment according to texfaq.org/FAQ-complist together with \vspace{-0.5\topsep} and \nointerlineskip before and after worked for me with beamer. Nice thing: no additional package needed. - mfg
5
[+5] [2021-01-28 11:33:21] Abdelhak Elfengour

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

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

When I try this, the text noitemsep,topsep=-8pt is appearing verbatim at each item, instead of being used to adjust the spacings. - Della
(1) @Della you need to import enumitem - robertspierre
(2) jxy's answer is the more robust version of this using topsep=-\parskip - jw5801
6
[-1] [2024-01-31 21:09:52] 101kt.rant

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


7