Suppose I have an appendix in a beamer document, and I'd like to access it from various locations of the main part. Is there a way to make beamer remember where I came from?
To be more specific, consider the following snippet:
\documentclass{beamer}
\usepackage{lipsum}
\newcommand{\ReturnTo}{sec:2}
\begin{document}
\section{A section}\label{sec:1}
\begin{frame}
\frametitle{Some title}
\begin{overlayarea}{\textwidth}{\textheight}
\lipsum[1]\renewcommand{\ReturnTo}{sec:1}
\hfill\hyperlink{sec:AppendixA}{\beamergotobutton{details}}
\end{overlayarea}
\end{frame}
\section{Another section}\label{sec:2}
\begin{frame}
\frametitle{Another title}
\begin{overlayarea}{\textwidth}{\textheight}
\lipsum[2]\renewcommand{\ReturnTo}{sec:2}
\hfill\hyperlink{sec:AppendixA}{\beamergotobutton{details}}
\end{overlayarea}
\end{frame}
\section{And one more section}\label{sec:3}
\begin{frame}
\frametitle{And one more title}
\begin{overlayarea}{\textwidth}{\textheight}
\lipsum[3]\renewcommand{\ReturnTo}{sec:3}
\hfill\hyperlink{sec:AppendixA}{\beamergotobutton{details}}
\end{overlayarea}
\end{frame}
\appendix
\section{Some useful formulae}\label{sec:AppendixA}
\begin{frame}
\frametitle{Some useful formulae}
\begin{overlayarea}{\textwidth}{\textheight}
\begin{eqnarray*}
F_{\mu\nu}F^{\mu\nu}&=& E^2+B^2\\
E&=&m\,c^2\\
\Rightarrow~F_{\mu\nu}F^{\mu\nu}&=& m^2\,c^4+B^2\quad ;-)
\end{eqnarray*}
\hfill\hyperlink{\noexpand\ReturnTo}{\beamergotobutton{back}}
\end{overlayarea}
\end{frame}
\end{document}
Here I want to be able to jump to the appendix from some of the sections, and go back to where I come from. Of course, the snippet does not achieve this, and I understand why. It would potentially work if I could teach beamer to redefine the \ReturnTo command upon clicking one of the \hyperlink{sec:AppendixA}{\beamergotobutton{details}} buttons.
It would be even nicer if I would not have to set the \ReturnTo by hand, but if it was set automatically to the current section. But I'd also like to keep the flexibility to set \ReturnTo by hand.
Notice that I am aware of the \againframe command. However, here I'd really like to enter an appendix, which is a separate section. And my presentation is so long that I cannot show all sections in the head line. Moreover, every section is long, and I may wish to really jump back to a specific slide/frame of a given section.
sec:Appendix:Aand jump from various positions to the same target, how should the hyperlink know to which other positions you want to jump back? Perhaps it is possible with some bare bone\pdf...and JavaScript wizardry – Feb 01 '18 at 17:49\ReturnTomacro would be changed upon clicks on the corresponding button. – Feb 01 '18 at 17:51media9package (which I unfortunately don't understand at all)? That is, could a Java script do the trick? – Feb 01 '18 at 18:35