# Beamer: Navigation bar jumping to last slide of first frame

I am using the Frankfurt-theme in beamer. When I use the navigation bar the presentation "jumps" to the first slide of that section (showing only "A" in the presentation, see mwe). However, usually I am using the navigation bar after a presentation. Therefore, it would be preferable that the presentation jumps to the last slide of the first frame (e.g. showing "AB" in the presentation, see mwe). Is there a way to achieve that effect? And how?

\documentclass[xcolor=dvipsnames,onlyslideswithnotes,t]{beamer}
\setbeamertemplate{footline}[frame number]
\usetheme{Frankfurt}

\begin{document}
\section{Jump}
\begin{frame}
A \pause
B
\end{frame}

\begin{frame}
CD
\end{frame}

\section{Hide}
\begin{frame}
EF
\end{frame}

\end{document}


(Note: The question Beamer: how to navigate to the last slide of next frame seems to be related to my question.)

• have you tried \mode<handout>? – naphaneal Apr 10 '16 at 14:45
• I just tried it in the mwe that doesn't compile when \mode<handout>is used. And I tried it in my presentation that does compile but shows the problem stated above. – Philip Apr 10 '16 at 18:15
• Maybe my answer to Only show last overlay per slide after presentation's end could be helpful. – dexteritas Jun 16 '18 at 13:22
• It is perhaps worth noting that you could already get to the last page of a different frame by double-clicking the corresponding dot for the reasons described in Symol 1's answer (assuming you're in presentation mode or single page view; otherwise the dot may not be at the same spot after the first click). – Circumscribe Feb 3 '19 at 22:42

This behavior is controlled by (beamerbasenavigation.sty line 734-741)

\def\beamer@link(#1/#2){%
\def\beamer@goto{{Navigation#1}}% default: first slide of frame
\ifnum\c@page<#2%
\ifnum\c@page<#1\else% go to last slide of frame, on all slides of
% the frame, except for the last one
\fi\fi%


Here is the logic in human language: Say there is a frame that spans across pages 5, 6, 7, 8 and you click the hyperlink dot.

• At page 1-4, you will be brought to page 5.
• At page 5-7, you will be brought to page 8.
• At page 8-end, you will be brought to page 5.

You can redefine this macro to achieve your logic, for instance

\def\beamer@link(#1/#2){%
\ifnum\c@page<#1%
\else%
\fi%
}

• At page 1-4, you will be brought to page 5.
• At page 5-end, you will be brought to page 8.

One more example

\makeatletter
\ifnum\c@page<#1%
\else\ifnum\c@page<#2
\else\ifnum\c@page=#2%
\else%
\fi\fi\fi%
}

• At page 1-4, you will be brought to page 5.
• At page 5-7, you will be brought to the next page.
• At page 8, you will be brought to page 5.
• at page 9-end, you will be brought to page 8.

This one allows you to cycle through the frame by smashing the hyperlink dot.

Playing code

\documentclass[xcolor=dvipsnames,onlyslideswithnotes,t]{beamer}
\setbeamertemplate{footline}[frame number]
\usetheme{Frankfurt}

\usepackage{tikz}

\begin{document}

\section{Jump}

\makeatletter
\ifnum\c@page<#1%
\else\ifnum\c@page<#2
\else\ifnum\c@page=#2%
\else%
\fi\fi\fi%
}

\frame{
\vfill
first frame
page 1 \pause
page 2 \pause
page 3 \pause
page 4
}

\frame{
\vfill
second frame
page 5 \pause
page 6 \pause
page 7 \pause
page 8
}

\frame{
\vfill
third frame
page 9 \pause
page 10 \pause
page 11 \pause
page 12
}

\part{visualization}

\frame{
\vfill
\centering
\tikz[xscale=.8]{
\draw
\foreach\p in{1,...,12}{
(\p,2)node[circle](Frompageno\p){\p}
}
\foreach\p in{5,6,7,8}{
}
;
\foreach\p in{1,...,12}{
\c@page\p\relax

• @UlrikeFischer OP says after a presentation ... jumps to the last slide so I implement page12 -> page8 while keeping page1 -> page 5 because it happens when OP wants to skips some frames. – Symbol 1 Feb 7 '19 at 19:42
• But anyway, do you think \def\beamer@link(#1/#2){\hyperlink{Navigation#2}} is what OP want? – Symbol 1 Feb 7 '19 at 19:43