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'm trying to use Beamer to create a presentation however I've got a problem when trying to use \pause to create an overlay.

The following is the code I'm working with...

\documentclass{beamer}
\usepackage{lmodern}

\title[Gene Gain and Loss in the White Rust Pathogen]{Gene Gain and Loss during Evolution of Obligate Parasitism in the White Rust Pathogen of \textit{Arabidopsis thaliana}}
\subtitle[]{\scriptsize Eric Kemen, Anastasia Gardiner, Torsten Schultz-Larsen, Ariane C. Kemen, 
\\Alexi L. Balmuth,
Alexandre Robert-Seilaniantz, Kate Bailey, Eric Holub,\\ David J. Studholme, Dan MacLean,
Jonathan D. G. Jones}
\author[Ben]{Ben}
\date[30/01/2013]{30$^\text{th}$ January 2013}
\institute{Imperial College London}

\usetheme{Dresden}
\usecolortheme{beaver}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}
\frametitle{Study Background}

\section{Study Background}
\begin{itemize}
\item It has been proposed, but not shown, that obligate biotrophy results from:
\begin{enumerate}
\item Reduced selection for maintenance of biosynthetic pathways \pause
\item Gain of mechanisms to evade host recognition or suppress host defence \pause 
\end{enumerate}
\item Previous research on powdery mildew fungus \textit{Blumeria graminis} or downy mildew oomycete \textit{Hyaloperonospora arabidopsidis} reveals a close correlation between the parasitism and massive gene losses in primary and secondary metabolism
\end{itemize}
\end{frame}

\section{Study Methodology}
\begin{frame}
\frametitle{Study Methodology}

\end{frame}

\section{Study Results}
\begin{frame}
\frametitle{Study Results}

\end{frame}

\section{Author's Discussion}
\begin{frame}
\frametitle{Author's Discussion}

\end{frame}

\section{Conclusions}
\begin{frame}

\frametitle{Conclusions}
\framesubtitle{Implications, and Future Directions}
\end{frame}

\end{document}

After using the \pause commands in the "Study Background" slide I get the same section appended to the header of each slide for each pause.. more visually I mean this

Unnecessary addition of section headers

Any idea how to rectify this so there's just one section header as I suspect should be the case?

share|improve this question
1  
The \section command should go outside the frame environment. As it is, it is being called for each slide in the frame so TeX thinks that your document has 3 sections called "Study Background". –  Andrew Stacey Jan 29 '13 at 12:48
    
Oh dear, I'm constantly making silly mistakes, thanks a lot! –  Ben Jan 29 '13 at 12:53
1  
Simple mistake that is easy to make but hard to spot. That's good that that worked (I posted as a comment as I wasn't completely sure). –  Andrew Stacey Jan 29 '13 at 12:58
add comment

1 Answer

up vote 5 down vote accepted

By putting the \section command inside the frame environment you are ensuring that it is executed for each overlay of that frame. The use of the \pause command then ensures that this is done more than once. So LaTeX thinks that you have three sections called "Study Background" because that particular \section command is executed three times.

It is possible to adapt a LaTeX command to be more "overlay aware" in the sense that it only has its desired effect once per frame - the usual use of this is with counters that need to be hold their value across each overlay. But in this case the simpler solution is the better one: simply move the \section command out of the frame environment (as you have with the later \section commands).

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.