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.

How do I adjust the length between nested lists? For example, in the following, I would like to adjust the distance where it states "distance here"

\begin{itemize}
    \item one
    %% distance here
    \begin{itemize}
         \item
    \end{itemize}
    %% distance here
    \item two
\end{itemize}

UPDATE: I forgot to mention I am using beamer, and it appears traditional methods can go wrong in beamer, as frame defines its own definition of itemize.

share|improve this question
    
You can use \begin{itemize}\addtolength{\itemsep}{-0.5\baselineskip}. See this link about tweaklist for more options. –  Peter Grill Jun 14 '11 at 0:05
    
@Peter Grill: but changing \itemsep will affect the vertical spacing between items, and Vinh Nguyen (if I understand the question correctly) needs to increase the vertical spacing before the first and after last items of the inner itemize. –  Gonzalo Medina Jun 14 '11 at 1:32
1  
This would help: Is there a picture showing all the lengths used in lists? –  Leo Liu Jun 14 '11 at 4:36
add comment

3 Answers 3

up vote 9 down vote accepted

You shouldn't use enumitem with beamer. This will probably break all the beamer settings for lists (e.g. overlays, alerts etc). Use either simply vspace (for a local solution) or the responsible beamer template. And next time show a complete example instead of a code snippet. The class is a crucial information.

\documentclass{beamer}
\begin{document}
\begin{frame}

\begin{itemize}
        \item one
        %% distance here
        \begin{itemize}
             \item
        \end{itemize}
        %% distance here
        \item two
    \end{itemize}

\end{frame}

\begin{frame}

\begin{itemize}
        \item one
        \vspace{1cm}
        \begin{itemize}
             \item
        \end{itemize}
        \vspace{1cm}
        \item two
    \end{itemize}

\end{frame}


\begin{frame}
\setbeamertemplate{itemize/enumerate subbody begin}{\vspace{1cm}}
\setbeamertemplate{itemize/enumerate subbody end}{\vspace{1cm}}
\begin{itemize}
        \item one
        %% distance here
        \begin{itemize}
             \item
        \end{itemize}
        %% distance here
        \item two
    \end{itemize}

\end{frame}

\end{document}
share|improve this answer
    
Thanks! I used placed the setbeamertemplate commands in the preamble so that its effects are global in the document. –  Vinh Nguyen Jun 14 '11 at 17:38
add comment

The vertical space that you want to modify is given by the sum of the lengths \topsep, and \parskip; the enumitem package offers you a simple mechanism to control these (and some other attributes) of the list-like environments:

\documentclass{article}
\usepackage{enumitem}

\begin{document}

\begin{itemize}
        \item one
        \begin{itemize}[topsep=20pt]
             \item
        \end{itemize}
        \item two
    \end{itemize}

\end{document}

If you want to suppress all the vertical spacing in a list you can say something like

\usepackage{enumitem}
...
\begin{itemize}[nolistsep]
  \item
\end{itemize}

EDIT: an example with beamer:

\documentclass{beamer}
\usepackage{enumitem}

\begin{document}

\begin{frame}
Normal spacing
\begin{itemize}
        \item one
        \begin{itemize}
             \item First subitem
             \item Second subitem
        \end{itemize}
        \item two
    \end{itemize}
Increased spacing
\begin{itemize}
        \item one
        \begin{itemize}[topsep=20pt]
             \item First subitem
             \item Second subitem
        \end{itemize}
        \item two
    \end{itemize}
\end{frame}

\end{document}

The result:

However, using enumitem with beamer is not the best choice. See Ulrike's answer for a proper solution with beamer.

share|improve this answer
    
I forgot to mention that I'm doing this in Beamer, and enumitem does not work there (I don't see bullets). Also, as seen here, the frame environment has its own definition of itemize. What to do... –  Vinh Nguyen Jun 14 '11 at 1:30
    
@Vinh Nguyen: yes, you forgot crucial information. Can you please add to your question that you are using beamer? –  Gonzalo Medina Jun 14 '11 at 1:34
    
@Vinh Nguyen: in fact, I just tested my example code using beamer instead of article and my code works (see my updated answer in a few minutes). If it is not working for you, please add a minimal working example illustrating your problem. –  Gonzalo Medina Jun 14 '11 at 1:36
    
@Gonzalo Medina Thank you for your help. Your working example is fine. Although the spacing does seem to work, as mentioned in my comments, the bullets disappear (try without enumitem). I would like to preserve the bullets in the lists. Thank you so much. –  Vinh Nguyen Jun 14 '11 at 4:42
    
@Vihn Nguyen: see Ulrike's answer for a proper solution with beamer. –  Gonzalo Medina Jun 14 '11 at 12:05
show 1 more comment

Ulrike's solution for a global change isn't working for me. Putting these lines

\setbeamertemplate{itemize/enumerate subbody begin}{\vspace{1cm}}
\setbeamertemplate{itemize/enumerate subbody end}{\vspace{1cm}}

either within a frame or in the preamble is doing nothing. (I can provide details about my configuration, file, etc., but not sure what's relevant.) In any event, I have found other (almost complete) solutions, although not as ... beamerly.

Solution 1: Put this in the preamble:

% space between items:
\newlength{\wideitemsep}
\setlength{\wideitemsep}{\itemsep}\addtolength{\wideitemsep}{3pt}
% reconfigure itemize lists:
\let\olditem\item
\renewcommand{\item}{%
\setlength{\itemsep}{\wideitemsep}%
\olditem}

Drawback (or advantage): Although the items are farther apart, lines of text before an after the list are still very close. (I found this idea at http://blog.nguyenvq.com/2011/05/01/spacing-between-items-in-itemize-or-enumerate-environments-lists/.)

Solution 2: Almost the same thing, but this also adds space before the list:

\let\olditem\item
\renewcommand{\item}{%
\olditem\vspace{4pt}}

However, it does not add space after the list. I'd like to find a global way to do that. I've experimented with some of the other list parameters without success using this sort of method, which makes sense: The only effect you can have by redefining \item will be local to a particular item, in general.

share|improve this answer
    
If you indent your code with four spaces, it'll be put into a code block. There is also a button that looks like {} in the editor which will do this to selected text when you click on it. –  qubyte Feb 13 '12 at 5:25
    
Thanks Mark. I am indeed new here. I actually tried both! It didn't seem to work either way. Don't know why. (Maybe because I used both four spaces and {}?) I'm glad Werner edited it. –  Mars Feb 14 '12 at 19:18
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.