I would like to create relative overlays in beamer with a different notation than the existing one. The following code gives satisfying results.
\documentclass{beamer}
\usepackage{pgfkeys}
\newcommand\getspec[1]{\pgfkeysvalueof{/#1/spec}}
\begin{document}
\begin{frame}{}
\pgfkeyssetvalue{/1st item/spec}{1-2}
\pgfkeyssetvalue{/2nd item/spec}{2}
\begin{itemize}
\item<\getspec{1st item}> Content
\item<\getspec{2nd item}> More content
\end{itemize}
\end{frame}
\end{document}
Because keys in pgfkeys are local to the current group the following code throws an error Missing number, treated as zero., because after the first frame-environment is left, the value of the key 1st item is set to something like an empty string.
\documentclass{beamer}
\usepackage{pgfkeys}
\newcommand\getspec[1]{\pgfkeysvalueof{/#1/spec}}
\begin{document}
\begin{frame}{}
\pgfkeyssetvalue{/1st item/spec}{1-2}
\pgfkeyssetvalue{/2nd item/spec}{2}
\begin{itemize}
\item<\getspec{1st item}> Content
\item<\getspec{2nd item}> More content
\end{itemize}
\end{frame}
\begin{frame}{}
\begin{itemize}
\item<\getspec{1st item}> Content
\end{itemize}
\end{frame}
\end{document}
I would like to adapt the code of getspec to give a more useful error message. Something like this label has not been defined for the current frame would be nice.
This is related to Relative Order of Overlays in Beamer and to external link.
\pgfkeysifdefined.. Anyway, thanks! – Heinrich Ody Feb 13 '17 at 08:53