latexbeamercross-reference

reference between slides in Beamr


I have a code as below. I would like to create \ref{} between item 1 in the second and third slides. So whenever someone clicks item1 in the second slide jumps to the third slide and vice versa.

\documentclass[]{beamer}
\usetheme{Madrid}

\usenavigationsymbolstemplate{}

\title{Main Title} 
\author{Jane Doe}
\institute{University A}
\date{\today}

\begin{document}
    
    \begin{frame}
        \titlepage % Print the title page as the first slide
    \end{frame}
    
    \begin{frame}
        \frametitle{First Page}
        \begin{exampleblock}{Example}
            This is an example which will be used later.
        \end{exampleblock}
    \end{frame}
    
    \begin{frame}[label={important}]
        \frametitle{Second Page}
        \begin{itemize}
            \item Item 1
            \item Item 2 
        \end{itemize}
    \end{frame}
    
    \begin{frame}
        \frametitle{Third Page}
        \begin{itemize}
        \item Item 1
        \item Item 2
        \end{itemize}
    \end{frame}
    
\end{document} 

Solution

  • \documentclass[]{beamer}
    \usetheme{Madrid}
    
    \usenavigationsymbolstemplate{}
    
    \title{Main Title} 
    \author{Jane Doe}
    \institute{University A}
    \date{\today}
    
    \begin{document}
        
        \begin{frame}
            \titlepage % Print the title page as the first slide
        \end{frame}
        
        \begin{frame}
            \frametitle{First Page}
            \begin{exampleblock}{Example}
                This is an example which will be used later.
            \end{exampleblock}
        \end{frame}
        
        \begin{frame}[label={important}]
            \frametitle{Second Page}
            \begin{itemize}
                \item \hyperlink{foo}{Item 1}
                \item Item 2 
            \end{itemize}
        \end{frame}
        
        \begin{frame}[label={foo}]
            \frametitle{Third Page}
            \begin{itemize}
            \item \hyperlink{important}{Item 1}
            \item Item 2
            \end{itemize}
        \end{frame}
        
    \end{document}