是否可以导航到下一帧的最后一张幻灯片?
有一个命令\hyperlinkframestartnext
可以跳转到下一页的第一张幻灯片。我需要一个像这样的命令\hyperlinkframeendnext
。
这个问题在压缩文本.tex。不幸的是,那里提出的解决方案不起作用:
\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}
答案1
只需要修改一行即可:
\expandafter\hyperlink{\csname frame@\the\@tempcnta @end\endcsname}}
尽管我更喜欢
\def\hyperlinkframeendnext#1{\bgroup
\@tempcnta=\c@framenumber%
\ifnum\@tempcnta<\inserttotalframenumber%
\advance\@tempcnta by 1%
\fi%
\hyperlink{\csname frame@\the\@tempcnta @end\endcsname}{#1}
\egroup}