# How can I customize the “go to slide number” navigation symbol

I am using a reduced version of the navigation symbols bar that only includes \insertslidenavigationsymbol. My presentation only shows the frame numbers (instead of slide numbers) because I use many overlays and the number of slides grows too large. The problem is that if someone in the public ask me to go to a specific frame number (since this is the number they will see), then the navigation button doesn't take me to frame I want to go.

Is there a way to customize the \insertslidenavigationsymbol option so that it takes me to a frame number instead of a slide number?

In the following example you will see that if you go to slide 3 using the navigation symbol, it will take you to page 3 in frame 2 (this is the expected behavior, I guess). However, I want it to go to frame 3 instead. Any ideas? I tried with \insertframenavigationsymbol but that one only let me go to previous/next frame, not to a specific frame number.

\documentclass[compress]{beamer}

\useoutertheme[subsection=false]{miniframes}

{
\defbeamertemplate{footline}{frame number and last}{%
}

\setbeamertemplate{footline}[frame number and last]{}

\begin{document}
\begin{frame}{This is frame 1}
\onslide<1-2>{Some text\\}
\onslide<2>{\invisible<1>{
Some more text}}
\end{frame}
\begin{frame}{This is frame 2}
This is frame 2
\end{frame}
\begin{frame}{This is frame 3}
This is frame 3
\end{frame}

\end{document}

-

You can insert \insertframenavigationsymbol instead of \insertslidenavigationsymbol in your navigation symbols template:

\documentclass[compress]{beamer}

\useoutertheme[subsection=false]{miniframes}

{
\defbeamertemplate{footline}{frame number and last}{%
}

\setbeamertemplate{footline}[frame number and last]{}

\begin{document}
\begin{frame}{This is frame 1}
\onslide<1-2>{Some text\\}
\onslide<2>{\invisible<1>{
Some more text}}
\end{frame}
\begin{frame}{This is frame 2}
This is frame 2
\end{frame}
\begin{frame}{This is frame 3}
This is frame 3
\end{frame}

\end{document}


If you want to keep the same (Acrobat) pop-up menu provided by slide navigation symbols, you can use the following code:

\documentclass[compress]{beamer}
\usepackage{tikz}

\useoutertheme[subsection=false]{miniframes}
\makeatletter
\begin{pgfpicture}{0pt}{-1.5pt}{20pt}{5.5pt}
\pgfuseobject{beamerframenavstrong}%
\pgfuseobject{beamerframenavlight}%
\end{pgfpicture}\kern-20pt%
}
\makeatother

{
\defbeamertemplate{footline}{frame number and last}{%
}

\setbeamertemplate{footline}[frame number and last]{}

\begin{document}
\begin{frame}{This is frame 1}
\onslide<1-2>{Some text\\}
\onslide<2>{\invisible<1>{
Some more text}}
\end{frame}
\begin{frame}{This is frame 2}
This is frame 2
\end{frame}
\begin{frame}{This is frame 3}
This is frame 3
\end{frame}
\foreach \x in {4,...,10}{
\begin{frame}{This is frame \x}
This is frame \x
\end{frame}
}
\end{document}


Note: the correct back link should be \hyperlinkframestartprev but this macro is not defined by beamer...

-
I tried that initially as mentioned in the question. However, that only let me move to previous or next frame, but not to a specific frame number (I can't enter the frame number to which I want to go) – Sandra C. Jul 27 '12 at 21:32
@SandraC. What kind of interface do you want? A list of numbers? A pop-up menu? A text field with a goto button? – Paul Gaborit Jul 27 '12 at 21:36
It will be the last one. Exactly as the text field that appears when \insertslidenavigationsymbol is activated – Sandra C. Jul 27 '12 at 21:41
Thanks @PolGab. It indeed activates the pop up menu exactly how I want it. The problem is that it keeps going to the page number instead of the frame number :-/ – Sandra C. Jul 27 '12 at 22:38
@SandraC. I don't understand your problem... Here, with Adobe Reader 9 (Linux version) and with TeXLive 2012, the popup said "Go To Page -- Page: xx of 3 (4)". If xx is 3, Adobe Reader jumps to "page 3 (4 of 4)" and this page is frame 3. – Paul Gaborit Jul 27 '12 at 23:03

The following solution uses JavaScript to jump to the specified frame. First the starting page numbers of each frame are remembered (in macro \FrPg@List). At the end of the document these data are written as JavaScript object FrameList. Also a function GoToFrame is defined that first asks the user for the frame that he wants to visit. After some validation of the answer the page number is calculated and the frame is viewed by a destination name that beamer sets for each page (Navigation + page number). If the user uses a frame number less than the first frame, then the very first page is selected. If the frame number is too large, then the starting page of the last frame is used.

\documentclass[compress]{beamer}

\usepackage{atbegshi}
\usepackage{ltxcmds}
\usepackage{atveryend}

\makeatletter
\def\FrPg@List{}
\def\FrPg@Max{-2147483647}
\AtBeginShipout{%
\fi
\expandafter
\number\value{page}%
}%
\ifx\FrPg@List\ltx@empty
\xdef\FrPg@List{%
}%
\else
\xdef\FrPg@List{%
\FrPg@List
}%
\fi
}{}%
}
\AtVeryEndDocument{%
\immediate\pdfobj{(%
var FrameList={\FrPg@List};%
var FrameMax=\FrPg@Max;%
function GoToFrame(){%
var frame=app.response({%
% cQuestion:"Which frame?",%
cTitle:"Go To  Frame",%
cLabel:"Frame:"%
});%
if(frame==null)return;%
var result=frame.match(/%
^%
\ltx@backslashchar\ltx@backslashchar d+%
\$%
/);%
if(result==null){%
return;%
}%
var page=FrameList[frame];
if(page==null&&frame>FrameMax)%
page=FrameList[FrameMax];%
if(page==null){%
if(frame<1){%
return;%
}%
app.alert("Frame "+frame+"' not found!");%
return;%
}%
}%
)}%
\immediate\pdfobj{%
<<%
/S/JS%
/JS \the\pdflastobj\space 0 R%
>>%
}%
\immediate\pdfobj{%
<<%
/Names[(\FrPg@Script)\the\pdflastobj\space0 R]%
>>%
}%
\pdfnames{%
/JavaScript \the\pdflastobj\space0 R%
}%
}
\begin{Form}[]
\end{Form}
\begin{pgfpicture}{0pt}{-1.5pt}{20pt}{5.5pt}
\pgfuseobject{beamerslidenavstrong}%
\pgfuseobject{beamerslidenavlight}%
\end{pgfpicture}\kern-20pt%
\PushButton[
borderwidth=0,
bordercolor=white,
onclick=GoToFrame();
}

\useoutertheme[subsection=false]{miniframes}
}

\defbeamertemplate{footline}{frame number and last}{%
}

\setbeamertemplate{footline}[frame number and last]{}

\begin{document}
\makeatletter
\begin{frame}{This is frame 1}
\onslide<1-2>{Some text\\}
\onslide<2>{\invisible<1>{
Some more text}}
\end{frame}
\begin{frame}{This is frame 2}
This is frame 2
\end{frame}
\begin{frame}{This is frame 3}
This is frame 3
\end{frame}

\end{document}
`
-
Hi Heiko. I haven't been able yet to test your answer. It keeps giving me errors for the atveryend package. I downloaded it and put it in the Miktex installation but still haven't been able to make it work. – Sandra C. Jul 30 '12 at 16:08
I tried you answer but it doesn't seem to work. I get the following error: ! Undefined control sequence. <argument> ... {framenumber}}\fi \ltx@IfUndefined {FrPg@\number \value {fram... l.119 \end{frame} Any ideas of what is going on? – Sandra C. Aug 1 '12 at 3:45