5

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} 

\setbeamertemplate{navigation symbols}{}

\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.)

4
  • have you tried \mode<handout>?
    – naphaneal
    Apr 10, 2016 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, 2016 at 18:15
  • Maybe my answer to Only show last overlay per slide after presentation's end could be helpful.
    – dexteritas
    Jun 16, 2018 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). Feb 3, 2019 at 22:42

1 Answer 1

5
+125

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
  \def\beamer@goto{{Navigation#2}}% jump to last slide of frame
  \fi\fi%
  \expandafter\hyperlink\beamer@goto}

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%
        \def\beamer@goto{{Navigation#1}}%
    \else%
        \def\beamer@goto{{Navigation#2}}%
    \fi%
    \expandafter\hyperlink\beamer@goto%
}
  • 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
\def\beamer@link(#1/#2){%
    \ifnum\c@page<#1%
        \def\beamer@goto{{Navigation#1}}%
    \else\ifnum\c@page<#2
        \def\beamer@goto{{Navigation\the\numexpr\c@page+1}}%
    \else\ifnum\c@page=#2%
        \def\beamer@goto{{Navigation#1}}%
    \else%
        \def\beamer@goto{{Navigation#2}}%
    \fi\fi\fi%
    \expandafter\hyperlink\beamer@goto%
}
  • 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}
\setbeamertemplate{navigation symbols}{}

\usepackage{tikz}

\begin{document}

\section{Jump}

\makeatletter
\def\beamer@link(#1/#2){%
    \ifnum\c@page<#1%
        \def\beamer@goto{{Navigation#1}}%
    \else\ifnum\c@page<#2
        \def\beamer@goto{{Navigation\the\numexpr\c@page+1}}%
    \else\ifnum\c@page=#2%
        \def\beamer@goto{{Navigation#1}}%
    \else%
        \def\beamer@goto{{Navigation#2}}%
    \fi\fi\fi%
    \expandafter\hyperlink\beamer@goto%
}

\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}

\def\hyperlink#1{\def\gotothisnode{#1}}
\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}{
                (\p,0)node[circle](Navigation\p){\p}
            }
        ;
        \foreach\p in{1,...,12}{
            \c@page\p\relax
            \beamer@link(5/8)
            \draw[-latex](Frompageno\p)--(\gotothisnode);
        }
    }
}

\end{document}
4
  • Nice answer! I'll have to wait until tomorrow until the system allows me to award the bounty. Feb 3, 2019 at 22:21
  • I don't think that this does what the OP wanted. You are not getting to the last slide of a frame always when klicking on the navigation, but only when you are already on rather specific slides. Feb 7, 2019 at 19:25
  • @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, 2019 at 19:42
  • But anyway, do you think \def\beamer@link(#1/#2){\hyperlink{Navigation#2}} is what OP want?
    – Symbol 1
    Feb 7, 2019 at 19:43

You must log in to answer this question.

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