4

Is it possible to navigate to the last slide of the next frame?

There is a command \hyperlinkframestartnext to jump to the first slide on the next page. I need a command like \hyperlinkframeendnext.

The question was discussed in comp.text.tex. Unfortunately, the solution proposed there doesn't work:

\documentclass[12pt]{beamer}
\usepackage[utf8]{inputenc}

\makeatletter
\newcounter{@countingframe}%
\setcounter{@countingframe}{0}%
\def\beamer@framepages#1#2{%
  \ifnum\c@page<#1%
  \else%
    \ifnum\c@page>#2%
    \else%
      \gdef\beamer@startpageofframe{#1}%
      \gdef\beamer@endpageofframe{#2}%
    \fi%
  \fi%
  \stepcounter{@countingframe}%
  \expandafter\xdef\csname frame@\the@countingframe @end\endcsname{Navigation#2}}

% define \hyperlinkframeendnext, which will point to the final slide
% of the next frame (or the current frame if it's the last one in the
% presentation)
\def\hyperlinkframeendnext{%
  \@tempcnta=\c@framenumber%
  \ifnum\@tempcnta<\inserttotalframenumber%
    \advance\@tempcnta by 1%
  \fi%
  \expandafter\hyperlink\csname frame@\the\@tempcnta @end\endcsname}
\makeatother

\setbeamertemplate{navigation symbols}{\scriptsize\hyperlinkframeendprev{ $\vartriangleleft$ }\hyperlinkframestart{ $\vartriangle$ }\hyperlinkframeend{ $\triangledown$ }\hyperlinkframeendnext{ $\vartriangleright$ }}

\begin{document}

\begin{frame}
  1\pause 2\pause 3
\end{frame}

\begin{frame}
  A\pause B\pause C
\end{frame}

\end{document}
4
  • Hi! It would be a bit easier to solve the problem if you included a minimal example that shows the issue. Anyway, this is an interesting question!
    – yo'
    Commented Sep 19, 2015 at 19:27
  • I added a not working example, based on the suggestion in comp.text.tex
    – user85873
    Commented Sep 19, 2015 at 19:30
  • Just to make sure I understand your problem correctly: when you click on the first slide, you want to jump to the "ABC" slide, while this example jumps to "123"? Commented Sep 20, 2015 at 10:09
  • Yes, when I click on the ">"-navigation-button, I want do jump to the "ABC" slide (which is the last slide on the second frame).
    – user85873
    Commented Sep 20, 2015 at 13:33

1 Answer 1

2

You only need to correct one line:

\expandafter\hyperlink{\csname frame@\the\@tempcnta @end\endcsname}}

although I am more comfortable with

\def\hyperlinkframeendnext#1{\bgroup
  \@tempcnta=\c@framenumber%
  \ifnum\@tempcnta<\inserttotalframenumber%
    \advance\@tempcnta by 1%
  \fi%
  \hyperlink{\csname frame@\the\@tempcnta @end\endcsname}{#1}
\egroup}
5
  • Thank you! It works for a small test presentation but in my main presentation I get the error "TeX capacity exceeded, sorry [main memory size=3000000]. \end{frame}"
    – user85873
    Commented Sep 20, 2015 at 17:57
  • That error message generally means an infinite loop, which may or be related. Commented Sep 20, 2015 at 21:36
  • So do you think the code above is wrong? I did some additional tests. I deleted all files like .nav, .aux, etc. and recompiled. Then I get a lot of error messages "undefined control sequence \end{frame}" and "Empty destination name,(hyperref) using `UNDEFINED'". Then I recompiled again without deleting the aux files. That leads to the error message "TeX capacity exceeded".
    – user85873
    Commented Sep 21, 2015 at 13:49
  • Without the main presentation I can't really test, but I now think maybe \@tempcnta might be the problem. Commented Sep 21, 2015 at 15:50
  • I understand that! Unfortunately, I'm not allowed to publish or send the presentation.
    – user85873
    Commented Sep 22, 2015 at 18:11

You must log in to answer this question.