# How do I remove white space above itemize command in beamer using enumitem

I am new to \LaTeX. I am trying to use solution give on How to remove the whitespace BEFORE itemize/enumerate? to remove vertical space before itemize environment using enumitem and beamer. But I don't get the desired result. Is there a solution to this problem?

It's not a good idea to use the enumitem package with beamer since beamer has its own ways of dealing with the standard list-like environments. Just by loading enumitem when using beamer you loose the special beamer formatting and the overlay-awareness of the list-like components.

To suppress the spacing, you can redefine itemize as implemented by beamer in the file beamerbaselocalstructure.sty. In the following example I show a possible modification, setting \topsep, \partopsep and \itemsep to 0pt (adjust these values according to your needs); the modified lines are signaled with %NEW:

\documentclass{beamer}

\makeatletter
\renewcommand{\itemize}[1][]{%
\beamer@ifempty{#1}{}{\def\beamer@defaultospec{#1}}%
\ifnum \@itemdepth >2\relax\@toodeep\else
\beamer@computepref\@itemdepth% sets \beameritemnestingprefix
\usebeamerfont{itemize/enumerate \beameritemnestingprefix body}%
\usebeamercolor[fg]{itemize/enumerate \beameritemnestingprefix body}%
\usebeamertemplate{itemize/enumerate \beameritemnestingprefix body begin}%
\list
{\usebeamertemplate{itemize \beameritemnestingprefix item}}
{%
\setlength\topsep{0pt}%NEW
\setlength\partopsep{0pt}%NEW
\setlength\itemsep{0pt}%NEW
\def\makelabel##1{%
{%
\hss\llap{{%
\usebeamerfont*{itemize \beameritemnestingprefix item}%
\usebeamercolor[fg]{itemize \beameritemnestingprefix item}##1}}%
}%
}%
}
\fi%
\beamer@cramped%
\raggedright%
\beamer@firstlineitemizeunskip%
}
\makeatother

\begin{document}

\begin{frame}
Some text
\begin{itemize}
\setlength\topsep{0pt}
\setlength\partopsep{0pt}
\item Item 1
\item Item 2
\item Item 3
\end{itemize}
Some text
\end{frame}

\end{document}


Just for comparison, the same list without the modifications:

• Works like a charm :) May 27, 2013 at 5:18
• Is there a way of doing this locally? Say I want to do this for one and only one list? Feb 26, 2014 at 12:49
• @user1729 Sure. The redefinition can be made inside a group to keep its effect local. Comments are not the place to give code, so if you want to, feel free to open a nee question. Feb 26, 2014 at 18:33
• This does sadly not work for me. Sep 8, 2019 at 13:47
• Works like a charm. I don't know much of the code, but just wonder why we need so much code to adjust the padding/margin? Also can we limit the scope to a single frame? Nov 26, 2020 at 6:20

As described in the enumitem documentation, you have two parameters to play with regarding vertical top space: topsep and partopsep.

So, for example, writing this:

\begin{enumerate}[topsep={0pt},partopsep={0pt}]
\item First item
\item Second item
\end{enumerate}


Will produce something like this:

Of course, if you want to play with the separation between items, you can do so by setting itemsep, again, as described in the enumitem documentation (available at the link mentioned above).

• But it doesn't work with beamer May 27, 2013 at 5:12