Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Does anybody know if this is possible using TikZ?

I'm trying to create links over a picture that i have layed on the background of a frame or at least placing them on some nodes in a TikZ code.

share|improve this question
1  
Can you include a MWE for that frame only? –  percusse Apr 29 '13 at 22:54
    
How do include the picture though? –  user28552 Apr 29 '13 at 22:58

1 Answer 1

up vote 3 down vote accepted

Yes, it's possible. You can use the \hyperlink, \hypertarget mechanism provided by hyperref together with some TikZ \nodes. In the following example, the \invlink command receives three mandatory arguments:

\invlink{<xshift>}{<yshift>}{<name>}

where the lengths <xshift> and <yshift> allow you to specify the horizontal and vertical shifting from the (current page.center) node, and <name> is the string that will be used for linking to the corresponding target. To have a large area for the links, I used a \phantom rule. Both the image and the links will be placed in the background canvas; in my example I used the frame titles for the \hypertargets, but you can use any other element.

\documentclass{beamer}
\usepackage{tikz}

\newcommand\invlink[3]{%
  \node at ([xshift=#1,yshift=#2]current page.center) 
  {\hyperlink{#3}{\phantom{\rule{1cm}{10pt}}}};
}

\begin{document}

{
\setbeamertemplate{background canvas}{%
  \includegraphics[height=\paperheight,width=\paperwidth,keepaspectratio]{ctanlion}%
\begin{tikzpicture}[remember picture,overlay]
\invlink{0pt}{0pt}{A}
\invlink{60pt}{60pt}{B}
\invlink{-60pt}{-60pt}{C}
\end{tikzpicture}%
  }
\begin{frame}
Some test text
\end{frame}
}

\begin{frame}
\frametitle{\hypertarget{A}{Test frame A}}
test
\end{frame}

\begin{frame}
\frametitle{\hypertarget{B}{Test frame B}}
test
\end{frame}

\begin{frame}
\frametitle{\hypertarget{C}{Test frame C}}
test
\end{frame}

\end{document}

CTAN lion drawing by Duane Bibby.

share|improve this answer
    
is there any way to make the links temporarily visible? –  user28552 Apr 30 '13 at 18:14
    
@user28552 use some "real" contents for the second argument of \hyperlink. –  Gonzalo Medina Apr 30 '13 at 18:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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