显示和超链接隐藏页面的按钮

显示和超链接隐藏页面的按钮

正如标题所说,我想创建一个按钮,它可以触发指向页面的超链接,但也显示隐藏层。我Ocgx2从@alexG 找到了很多隐藏/显示层的解决方案,但我找不到一个解决方案,我的按钮是 hyperref 和 showocg 函数合二为一。

\documentclass[10pt,a4paper]{beamer}
\usepackage[scaled]{helvet}
\usepackage{lipsum}%blindtext
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[absolute,overlay]{textpos} %Positioning
\usepackage[pdftex]{graphicx,subfigure,curves,epsf,rotating}
\usepackage[ngerman,english]{babel}
\usepackage[RGB]{xcolor}%Colours
%%%%%%%%%%%%%%%%% FARBEN %%%%%%%%%%%%%%%%%%%%%%%%%%%%
\definecolor{RWTHBLAU}{RGB}{0,84,159}
\definecolor{RWTHGELB}{RGB}{246,168,0}
\definecolor{RWTHGRUEN}{RGB}{87,171,39}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tikz} %tikzpciture enviroment
\tikzstyle{blockB} = [rectangle, draw, fill={RWTHBLAU}, text=white!40, text width=5em, text centered, rounded corners, minimum height=2.5em]
\tikzstyle{blockGe} = [rectangle, draw, fill={RWTHGELB}, text=white!40, text width=5em, text centered, rounded corners, minimum height=2.5em]
\tikzstyle{blockGr} = [rectangle, draw, fill={RWTHGRUEN}, text=white!40, text width=5em, text centered, rounded corners, minimum height=2.5em]
\usepackage{ocgx2} %ocgx2 for different layers
\usepackage[hidelinks]{hyperref} %allows to add hyperlinks and cross reference in-text
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\section*{Aufgabe 1}
\begin{flushleft}
\textbf{Aufgabe 1}
\end{flushleft}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Exercises and Hints %%%%%%%%%%%%%%%%%%%%%
\textbf{Overview}
\lipsum{1}
\newpage
%%%%%%%%%%%%%%%%%%%%%%% Exercise 1 %%%%%%%%%%%%%%
\textbf{Exercise 1}
\lipsum{2}
%%%%%%%%%%%%%%%%%% Buttons %%%%%%%%%%%%%%%%%%%%
\begin{textblock}{5}(1,14) 
\begin{tikzpicture}[node distance=2.3cm, auto]
\node[blockGe]                      (Overview){\hyperlink{page.1}{\text{Overview}}};;
\node[blockB,right of=Overview]     (Hint1){{\showocg[onmouseall]{Auf1Hin1}{\hyperlink{page.3}\text{Hint 1}}}}; % If i put hyperref in showocg, hyperref wont work.
\node[blockB,right of=Hint1]     (Hint2){\hyperlink{page.4}{\showocg[onmouseall]{Auf1Hin2}{\text{Hint2}}}}; %if i put showocg in hperref showocg wont work
\node[blockB,right of=Hint2     (Hint3){\hyperlink{page.5}{\text{Hint 3}}};
\node[blockGr,right of=Hint3]      (Solution){\hyperlink{page.6}{\text{Solution}}};
\end{tikzpicture}
\end{textblock}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\begin{ocg}{Aufgabe1-Hinweis 1}{Auf1Hin1}{0}
\textbf{hint1}
\lipsum{3}
\end{ocg}
%%%%%%%%%%%%%%%%%%
\newpage
\begin{ocg}{Aufgabe1-Hinweis 2}{Auf1Hin2}{0}
\textbf{hint2}
\lipsum{4}
\end{ocg
%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\textbf{hint3}
\lipsum{5}
%%%%%%%%%%%%%%%%%%%%
\newpage
\textbf{Solutions}
\lipsum{6}
%%%%%%%%%%%%%%%%%%%
\end{document}

相关内容