0

I have too many sections in my presentation such that the left-hand-side navigation bar is full and only shows the first sections in Fig. 2, initial situation in Fig. 1. Pseudocode

  • clean the left-hand-hand side navigation bar when exceed the threshold and start a new one there when on sufficient page
  • this feature occurs with Beamer Berkeley appendix so it is possible also with the main document

Code which problem shown in Fig. 2

\documentclass{beamer}
\usetheme{Berkeley} 
\logo{\includegraphics{logo.png}}
\usepackage{hyperref}
% https://tex.stackexchange.com/a/346486/13173
\newenvironment{slide}[1]
{\begin{frame}[environment=slide,allowframebreaks]
\frametitle{\insertsection-#1}
}
{\end{frame}}
% fragile only if code
% allowframebreaks not by default 

\begin{document} 
\title{Sensory system. Primary sensory modalities. Cortical modalities. Kinds of sensory disturbances. Spinal cord disorders. Spinal cord transverse and partial lesion. Cauda equina damage.}
\author{Leo}

\section{Cortical modalities}
\begin{slide}{basics} 
    More refined aspects of sensation ...
\end{slide}

\section{Cortical modalities}
\begin{slide}{basics} 
    More refined aspects of sensation ...
\end{slide}

\section{Cortical modalities 2}
\begin{slide}{basics} 
    More refined aspects of sensation ...
\end{slide}

\section{Cortical modalities 3}
\begin{slide}{basics} 
    More refined aspects of sensation ...
\end{slide}

\section{Cortical modalities 4}
\begin{slide}{basics} 
    More refined aspects of sensation ...
\end{slide}

\end{document}

Fig. 1 Situation at the first page, Fig. 2 Situation at Section 6 wheere the navbar has not changed, Fig. 3 Samcarter's answer output + one slide addition but without \part{} - fails on sufficient page count

enter image description here enter image description here enter image description here

Output: the left-hand-side navigation bar is not refreshed when the amount of sections exceed its capacity on suffcient enough page

Testing Samcarter's proposal

I include one slide before Samcarter's body so I get the wrong output in Fig. 3. Solution: Eventually correct output by just adding \part{} in the place where the new navbar is wanted.

TeXLive: 2016
OS: Debian 8.7

  • 1
    Your code cannot be compiled. Please make a compilable document that does not rely on files we don't have access to. – user36296 Jun 1 '17 at 16:08
  • 1
    Why do you list the headlines of all the sections in the title? Just leave the title away if you don't use a title slide. – Tiuri Jun 1 '17 at 16:11
  • 1
    Well, but by having all the sections in your document, you already get a full list of sections in the sidebar. Plus, it is displayed properly. – Tiuri Jun 1 '17 at 16:18
2

You could manually split the sidebar into smaller chunks that fit in the available space using \part{}.

\documentclass{beamer}

\usetheme{Berkeley} 
\logo{\includegraphics[width=1cm]{example-image}}
%\usepackage{hyperref}

\usepackage{xpatch}
\makeatletter
\patchcmd\beamer@@tmpl@frametitle{\insertframetitle}{\insertsection-\insertframetitle}{}{}
\makeatother

\begin{document} 
\title{Sensory system. Primary sensory modalities. Cortical modalities. Kinds of sensory disturbances. Spinal cord disorders. Spinal cord transverse and partial lesion. Cauda equina damage.}
\author{Leo}

\section{Cortical modalities}
\begin{frame}{basics} 
    More refined aspects of sensation ...
\end{frame}

\section{Cortical modalities 1}
\begin{frame}{basics} 
    More refined aspects of sensation ...
\end{frame}

\section{Cortical modalities 2}
\begin{frame}{basics} 
    More refined aspects of sensation ...
\end{frame}

\part{}
\section{Cortical modalities 3}
\begin{frame}{basics} 
    More refined aspects of sensation ...
\end{frame}

\section{Cortical modalities 4}
\begin{frame}{basics} 
    More refined aspects of sensation ...
\end{frame}

\end{document}

enter image description here

(don't load hyperref, beamer already does this for you)

  • 1
    @LéoLéopoldHertz준영 The solution is independent of your misuse of the slide environment - I just don't want to condone allowframebreaks as default. – user36296 Jun 1 '17 at 16:54
  • @LéoLéopoldHertz준영 It is the exact same output with slide. – user36296 Jun 1 '17 at 16:57
  • 1
    @LéoLéopoldHertz준영 Yes, place \part{} where you want the break points – user36296 Jun 1 '17 at 16:57
  • I confirm your proposal works only with the addition \part{}! - - I think the automatic approach for this is difficult, but manual is a good one. - - Why do you use xpatch package? – Léo Léopold Hertz 준영 Jun 1 '17 at 17:01
  • 1
    @LéoLéopoldHertz준영 With xpatch I add the section name to the framtitle - which is the way you displayed it in your original code. – user36296 Jun 1 '17 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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