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}

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

\section{One}

\section{Two}

\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}

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

\section{One}

\section{Two}

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

\section{Four}

\end{document}


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

% !TeX TS-program = xelatex

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

\begin{document}

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

\section{One}

\section{Two}

{
\section{Three}
}

\begin{frame}
test
\end{frame}

\begin{frame}
test2
\end{frame}

\section{Four}

\end{document}

• This links to the last frame of the section. Jul 8 '18 at 17:23
• @yoshegg Works fine for me Jul 8 '18 at 17:26
• I was wrong, it points to somewhere between the first and second slide of a section. See my updated question for updated MWE. Jul 8 '18 at 17:32
• @yoshegg With the position of your label it links to the first frame after the label. The section frame is already finished at the position you used the label. Jul 8 '18 at 17:44
• Okay, I understand, I have to put it in front of the relevant \section. Now my pdf reader puts the text of the section slide on top, instead of the top of the section slide. Jul 8 '18 at 17:48