6

I noticed in this example that the Introduction and Conclusion have their own navigation bars so that their entries are not taking up two extra lines in the main (body) navigation bar throughout the presentation.

I know I can leave them out by specifying a blank short name in the section command like \section[]{My Section Name], but then when you get to those sections, e.g. Conclusion that's been discarded from the navigation bar, you're just shown the last section's nav bar with no highlight.

I'd prefer to do it the way shown in the linked example so that the Conclusion just has its own nav bar that just says "Conclusion."

Is this done with the parts functionality, and if so how? And is there a better way? Unfortunately the above example doesn't include code.

I'm exploring the parts functionality now, but haven't totally nailed it yet. Here's a rough idea of what I've done so far:

\part{Introduction}
\section{Introduction}
(some intro frames)
\part{Body}
(some body sections and frames)
\part{Conclusion}
\section{Conclusion}
(some conclusion frames)

However, my PDF's Bookmarks list now shows the parts Introduction, Body, and Conclusion as the top-level sections which is not quite what I want. I really just want to break up the navigation bar so it's separate for Intro, Body, and Conclusion, without any mention of those actually part names anywhere. So, I feel like I'm heading down the wrong path here.

1 Answer 1

6

Yes, you can use \part and redefine \beamer@part as implemented in the file beamerbasesection.sty to suppress the part bookmarks; the example below shows the necessary modification (basically commenting out one line):

\documentclass{beamer}
\usetheme{Warsaw}

\makeatletter
\long\def\beamer@part[#1]#2{%
  \beamer@savemode%
  \mode<all>%
  \ifbeamer@inlecture%
    \refstepcounter{part}%
    \def\beamer@partname{#2}%
    \def\beamer@partnameshort{#1}%
    \addtocontents{nav}{\protect\headcommand{\protect\partentry{#2}{\the\c@part}}}%
    \xdef\partlink{{Navigation\the\c@page}{\noexpand\beamer@partname}}%
    \xdef\partlinkshort{{Navigation\the\c@page}{\noexpand\beamer@partnameshort}}%
    \beamer@tempcount=\c@page\advance\beamer@tempcount by -1%
    \addtocontents{nav}{\protect\headcommand{%
        \protect\beamer@partpages{\the\beamer@partstartpage}{\the\beamer@tempcount}}}%
    \addtocontents{nav}{\protect\headcommand{%
        \protect\beamer@sectionpages{\the\beamer@sectionstartpage}{\the\beamer@tempcount}}}%
    \addtocontents{nav}{\protect\headcommand{%
        \protect\beamer@subsectionpages{\the\beamer@subsectionstartpage}{\the\beamer@tempcount}}}%
    \beamer@partstartpage=\c@page%
    \beamer@sectionstartpage=\c@page%
    \beamer@subsectionstartpage=\c@page%
    \setcounter{subsection}{0}%
    \def\insertsection{}%
    \def\insertsubsection{}%
    \def\insertsubsubsection{}%
    \def\insertsectionhead{}%
    \def\insertsubsectionhead{}%
    \def\insertsubsubsectionhead{}%
    \def\lastsubsection{}%
    \def\insertpart{\expandafter\hyperlink\partlink}%
    %\Hy@writebookmark{\the\c@section}{#1}{Outline\the\c@part}{1}{toc}%
    \hyper@anchorstart{Outline\the\c@part}\hyper@anchorend%
    \beamer@atbeginpart%
  \fi%
  \beamer@resumemode}%
\makeatother

\begin{document}

\part{Introduction}
\section{Outline}
\begin{frame}
test
\end{frame}

\part{Main}
\section{Models}
\begin{frame}
test
\end{frame}

\section{Power of the model}
\begin{frame}
test
\end{frame}

\section{Limitations of the model}
\begin{frame}
test
\end{frame}

\part{Conclussion}
\section{Appendix}
\begin{frame}
test
\end{frame}

\end{document}

The above modification can be made in a more concise way using the xpatch package to patch \beamer@part:

\documentclass{beamer}
\usetheme{Warsaw}
\usepackage{xpatch}

\makeatletter
\xpatchcmd{\beamer@part}{\Hy@writebookmark{\the\c@section}{#1}{Outline\the\c@part}{1}{toc}}{}{}{}
\makeatother

\begin{document}

\part{Introduction}
\section{Outline}
\begin{frame}
test
\end{frame}

\part{Main}
\section{Models}
\begin{frame}
test
\end{frame}

\section{Power of the model}
\begin{frame}
test
\end{frame}

\section{Limitations of the model}
\begin{frame}
test
\end{frame}

\part{Conclussion}
\section{Appendix}
\begin{frame}
test
\end{frame}

\end{document}

Here are some images for the first frame of each part:

enter image description here

enter image description here

enter image description here

and the bookmarks as shown by Adobe Reader; as you can see, there are no part bookmarks:

enter image description here

6
  • Thanks Gonzalo. I tried your concise version, but it gives me a lot of errors (58 to be precise), the first one being Use of \@pr@videpackage doesn't match its definition. Any thoughts? I will try your longer version and see if I have the same issues.
    – SSilk
    Commented May 5, 2012 at 3:19
  • @SSilk: it could be a problem with older package versions. What version of LaTeX distribution are you using? Commented May 5, 2012 at 3:26
  • MikTeX 2.9, with some packages updated, but not all. I'll try your MWE to make sure it's not a conflict with something else in my code.
    – SSilk
    Commented May 5, 2012 at 3:33
  • Same issues with your concise MWE. Will try updating MikTeX now. Will post back ASAP. Thanks.
    – SSilk
    Commented May 5, 2012 at 3:36
  • I updated all out of date MiTex packages. It compiles now, and most of the functionality I was looking for seems to be there. However, it seems to have messed up some of the labeling functionality. One formula gives me a multiple definition warning, and one of my sections shows up twice, and gives me a warning that a destination with the same identifier has already been used. However, these issues persist if I comment out your code, so there must have been some changes in one or more of the updated packages that created problems with my code. I'll have to look further into this.
    – SSilk
    Commented May 5, 2012 at 4:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .