[Tex/LaTex] Separate Beamer navigation bar for some portions of presentation

beamernavigationsectioning

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.

Best Answer

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

Related Question