1

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

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

% !TeX TS-program = 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}]   
  \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}
7
  • This links to the last frame of the section.
    – yoshegg
    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.
    – yoshegg
    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.
    – yoshegg
    Jul 8 '18 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.