Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'd like to modify the spacing between items in the itemize environment. This post shows how to modify a specific itemize environment (\addtolength{\itemsep}{0.5\baselineskip}). However, I'd like to do it globally for the entire document. This post suggests the enumitem package. However, I get an error in beamer when i use this package (just declaring it). Any suggestions? I'm currently using the addtolength method on all my itemize environments. I'd like a global solution. Thanks.

share|improve this question
add comment

3 Answers 3

up vote 5 down vote accepted

In most documents, you can do this, which avoids the use of extra packages.

\let\tempone\itemize
\let\temptwo\enditemize
\renewenvironment{itemize}{\tempone\addtolength{\itemsep}{0.5\baselineskip}}{\temptwo}

(Stufazi suggested a neater way of doing this in his answer, which I will use below.)

However, I think that the frame environment in beamer resets the properties of itemize. You could do something like this, but it will prevent frame's optional arguments from working.

\documentclass{beamer}
\let\oldframe\frame
\renewcommand{\frame}{%
\oldframe
\let\olditemize\itemize
\renewcommand\itemize{\olditemize\addtolength{\itemsep}{100pt}}%
}
%
\begin{document}
\begin{frame}
\begin{itemize}
\item The first.
\item The second.
\item The third.
\end{itemize}
\end{frame}
%
\begin{frame}
\begin{itemize}
\item The fourth.
\item The fifth.
\item The sixth.
\end{itemize}
\end{frame}
%
\end{document}

Alternatively, you could try this, but I can't guarantee that it won't break something else.

\documentclass{beamer}
\newlength{\wideitemsep}
\setlength{\wideitemsep}{\itemsep}
\addtolength{\wideitemsep}{100pt}
\let\olditem\item
\renewcommand{\item}{\setlength{\itemsep}{\wideitemsep}\olditem}
%
\begin{document}
\begin{frame}
\begin{itemize}
\item The first.
\item<2-> The second.
\item<3-> The third.
\end{itemize}
\end{frame}
%
\begin{frame}[shrink=50]
\begin{itemize}
\item The fourth.
\item The fifth.
\item The sixth.
\end{itemize}
\end{frame}
%
\end{document}

It might be safer to define your own list environment based on itemize and use this in future; thus

\newenvironment{wideitemize}{\itemize\addtolength{\itemsep}{100pt}}{\enditemize}

This would avoid the necessity for hacks that have unwanted side effects.

share|improve this answer
    
this did not work for me in beamer. –  Vinh Nguyen Apr 29 '11 at 19:43
    
@Vinh Nguyen --- my apologies. I have edited my answer. –  Ian Thompson Apr 30 '11 at 10:35
    
thanks it works. I don't have enough rep to mark the check. Sorry –  Vinh Nguyen Apr 30 '11 at 14:10
    
This solution sort of breaks other frame options. For example, I have a bibliography frame that extends multiple slides: \begin{frame}[allowframebreaks]{References} \bibliographystyle{apa} \bibliography{/home/vinh/Documents/Literature/bibliography} \end{frame} The "allowframebreaks" shows up as text and so the option is not used. Suggestions? –  Vinh Nguyen Apr 30 '11 at 15:27
    
@Vinh --- tried again! –  Ian Thompson Apr 30 '11 at 17:37
add comment

Just put the two line in your foredocument (change the 100pt to any value you want):

\let\OLDitemize\itemize
\renewcommand\itemize{\OLDitemize\addtolength{\itemsep}{100pt}}

And if next time you write your document using the enumitem package (recommended!), you could

\setitemize{itemsep=100pt}
share|improve this answer
    
I second the recommendation for the enumitem package. –  Michael Ummels Apr 28 '11 at 9:49
2  
@Michael enumitem does not work with beamer as I've described. @Stufazi this did not work for me. I placed it right after \documentclass{beamer} –  Vinh Nguyen Apr 29 '11 at 19:39
add comment

After diving a bit into beamer's source files, I think that I've found the best way to implement this without breaking other options or advanced features of the itemize or frame environments. The solution is to define a new frame option like:

\makeatletter
\define@key{beamerframe}{wide}[30pt]{%
  \def\beamer@cramped{\itemsep #1\topsep0.5pt\relax}}
\makeatother

So that one can later write:

\begin{frame}[wide]
% ...
\end{frame}

to get “wider”, more spacey, versions of all the itemize, enumerate and description environments used in the frame. This is actually just a copy from another squeeze option already defined by beamer, so I'm guessing this would be the “proper” way to implement this without breaking anything.


Set as default

One would also want, probably, an option to make this the default for all frames. Unfortunately beamer does not seem to support setting default frame options. The following is a bit of a hack, but I'm hoping it not to break anything. Throw all of this code in a style file (say beamer-extra.sty):

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamer-extra}[2013/08/22 Some extra beamer features]
\RequirePackage{etoolbox}

% A command to set default frame options:
%   \defaultframeoptions{<options>}  % append some more defaults options
%   \defaultframeoptions*{<options>} % clear past defaults, set some new
\def\beamer@extra@frameoptions{}
\def\beamer@extra@setframeoptions#1%
  {\appto\beamer@extra@frameoptions{\setkeys{beamerframe}{#1}}}
\def\defaultframeoptions{\@ifstar
  {\def\beamer@extra@frameoptions{}\beamer@extra@setframeoptions}
  {\beamer@extra@setframeoptions}}
\define@key{beamerframe}{environment}%
  {\def\beamer@frameenvironmentsubst{#1}\beamer@extra@frameoptions}

% A new frame option for wider items
\define@key{beamerframe}{wide}[30pt]{%
  \def\beamer@cramped{\itemsep #1\topsep0.5pt\relax}}

And then use it like:

\documentclass{beamer}
\usepackage{beamer-extra}
\defaultframeoptions{wide=15pt}

\begin{document}
\begin{frame}
\frametitle{Example}
\begin{itemize}
\item One
\item Two
\item Three
\end{itemize}
\end{frame}
\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.