beamer parttoc com links clicáveis

beamer parttoc com links clicáveis

Tento gerar um conjunto de peças com links clicáveis. eu encontreiesse, mas infelizmente não gera hiperlinks. Encontrei a seguinte sugestão que gera links clicáveis, mas todos esses links referem-se ao próprio parttoc.

\documentclass{beamer}
\usepackage[ngerman]{babel}
\usepackage{blindtext}

\newcommand{\dummyFrame}[1][1]{\begin{frame}{Test}\blindtext[#1]\end{frame}}
\usepackage{hyperref}


% for the list of parts
\makeatletter
\AtBeginPart{%
    \addtocontents{toc}{%
        \protect\beamer@partintoc{\the\c@part}{\beamer@partnameshort}{\the\c@page}%
    }%
    %    \setcounter{framenumber}{0}
    \frame{\partpage}
}
%% number, shortname, page.
\providecommand\beamer@partintoc[3]{%
    \ifnum\c@tocdepth=-1\relax
    % requesting onlyparts.
    \makebox[6em]{Einheit #1:} \textcolor{green!30!blue}{\hyperlink{#2}{#2}}
    \par
    \fi
}
\define@key{beamertoc}{onlyparts}[]{%
    \c@tocdepth=-1\relax
}
\makeatother%




\begin{document}
    \begin{frame}{Inhaltsübersicht}
        \tableofcontents[onlyparts]
    \end{frame}

\part{MyPart One}
    \dummyFrame
    
\part{MyPart Two}
    \dummyFrame
    \dummyFrame
    
\part{MyPart Three}
    \dummyFrame
    \dummyFrame
    
\end{document}

Como posso fazer com que esses links apontem para o quadro certo? Agradecemos antecipadamente por qualquer sugestão

Responder1

Você pode dar rótulos aos quadros das peças que você pode usar como destinos de link:

\documentclass{beamer}
\usepackage[ngerman]{babel}
\usepackage{blindtext}

\newcommand{\dummyFrame}[1][1]{\begin{frame}{Test}\blindtext[#1]\end{frame}}
\usepackage{hyperref}


% for the list of parts
\makeatletter
\AtBeginPart{%
    \addtocontents{toc}{%
        \protect\beamer@partintoc{\the\c@part}{\hyperlink{part-\thepart}{\beamer@partnameshort}}{\the\c@page}%
    }%
    %    \setcounter{framenumber}{0}
    \frame[label=part-\thepart]{\partpage}
}
%% number, shortname, page.
\providecommand\beamer@partintoc[3]{%
    \ifnum\c@tocdepth=-1\relax
    % requesting onlyparts.
    \makebox[6em]{Einheit #1:} \textcolor{green!30!blue}{#2}
    \par
    \fi
}
\define@key{beamertoc}{onlyparts}[]{%
    \c@tocdepth=-1\relax
}
\makeatother%


\begin{document}
    \begin{frame}{Inhaltsübersicht}
        \tableofcontents[onlyparts]
    \end{frame}

\part{MyPart One}
    \dummyFrame
    
\part{MyPart Two}
    \dummyFrame
    \dummyFrame
    
\part{MyPart Three}
    \dummyFrame
    \dummyFrame
    
\end{document}

informação relacionada