0

I want to link to a section frame from another frame. \hyperref[label]{Text} should do the job but it links to the first frame instead.

My MWE (using XeLaTeX):

\documentclass[aspectratio=43]{beamer}
\usetheme[progressbar=frametitle]{metropolis}
\usepackage{fontspec}  

\begin{document}
\frame[plain,noframenumbering]{\maketitle}

\begin{frame}{TOC}
  \tableofcontents[hideallsubsections, sections={1-2}]       
  \hyperref[specialLink]{Special Link to Three}
  \tableofcontents[hideallsubsections, sections={4}]             
\end{frame}

\section{One}

\section{Two}

\section{Three}\label{specialLink}

\section{Four}

\end{document}

Update: Tried @samcarter's answer but the link now points between the first and second slide of a section. Updated MWE below:

\documentclass[aspectratio=43]{beamer}
\usetheme[progressbar=frametitle]{metropolis}
\usepackage{fontspec}  

\begin{document}
\frame[plain,noframenumbering]{\maketitle}

\begin{frame}{TOC}
  \tableofcontents[hideallsubsections, sections={1-2}]       
  \hyperlink{specialLink}{Special Link to Three}
  \tableofcontents[hideallsubsections, sections={4}]             
\end{frame}

\section{One}

\section{Two}

\section{Three}\label{specialLink}

\frame{a}
\frame{b}
\frame{c}
\frame{d}

\section{Four}

\end{document}
yoshegg
  • 27

1 Answers1

2

The correct syntax is \hyperlink{label}{link text}

% !TeX TS-program = xelatex

\documentclass[aspectratio=43]{beamer} \usetheme[progressbar=frametitle]{moloch}% modern fork of the metropolis theme \usepackage{fontspec}

\begin{document} \frame[plain,noframenumbering]{\maketitle}

\begin{frame}{TOC} \tableofcontents[hideallsubsections, sections={1-2}]
\hyperlink{specialLink}{link text} \tableofcontents[hideallsubsections, sections={4}]
\end{frame}

\section{One}

\section{Two}

{ \addtobeamertemplate{section page}{\label{specialLink}}{} \section{Three} }

\begin{frame} test \end{frame}

\begin{frame} test2 \end{frame}

\section{Four}

\end{document}