2

I make my first attempt on a beamer template. I created a simple graphic with my company logo and some fields as header (background for title). Now I would like to use the logo as home button. In other words once I click it, it goes to the toc.

To I'd like to create an empty box overlaying the logo, since I don't want to link the entire graphic or split it up into two graphics.

Within my style file I set the graphic the folling way:

\setbeamertemplate{background}{%
     \ifnum\c@framenumber=0%
          \includegraphics[width=\paperwidth,keepaspectratio]{/u1/Berichte2/theme/title.pdf}
     \else%
          \includegraphics[width=\paperwidth,keepaspectratio]{/u1/Berichte2/theme/header.pdf}
      \fi}

Now I tried to put minipage, mbox, makebox, framebox, ... into the Background environment which didn't throw me any errors but didn't do draw anything eather. If I put it somewhere else it complains about missing \begin{document}

Any help how to accomplish this would be greatly appreciated.

  • Not having access to your images, about how big are they with respect to the screen? Where do you want the links placed? – John Kormylo Aug 11 '15 at 19:19
2

This creates an invisible link box in the center of the frame. You can tell where it is when the cursor changes. (Not on the image here, which is only a .png copy.)

\documentclass{beamer}
\usepackage{hyperref}

\makeatletter
\setbeamertemplate{background}{%
  \rlap{\hspace{0.25\paperwidth}\hyperlink{test}{\rule[0.25\paperheight]{0.5\paperwidth}{0.5\paperheight}}}%
     \ifnum\c@framenumber=0%
       \includegraphics[width=\paperwidth,height=\paperheight]{example-image-a}%
     \else%
       \includegraphics[width=\paperwidth,height=\paperheight]{example-image-b}%
     \fi}
\makeatother

\begin{document}
\begin{frame}
test frame
\end{frame}

\begin{frame}
\hypertarget{test}{test target}
\end{frame}
\end{document}

beamer frame

This one puts a white visible link box over the image.

\documentclass{beamer}
\usepackage{hyperref}

\makeatletter
\setbeamertemplate{background}{%
     \ifnum\c@framenumber=0%
       \includegraphics[width=\paperwidth,height=\paperheight]{example-image-a}%
     \else%
       \includegraphics[width=\paperwidth,height=\paperheight]{example-image-b}%
     \fi
     \hspace{-0.75\paperwidth}\hyperlink{test}{\color{white}\rule[0.25\paperheight]{0.5\paperwidth}{0.5\paperheight}}%
    }
\makeatother

\begin{document}
\begin{frame}
test frame
\end{frame}

\begin{frame}
\hypertarget{test}{test target}
\end{frame}
\end{document}

link on top

  • Perfect. Thank you, this works like a charm. Now I only have to find a way to make the box white. – magu_ Aug 11 '15 at 21:04
  • You wanted it on top? No problem. – John Kormylo Aug 12 '15 at 2:43
  • I didn't articulate that good enough, the thing is that my background image is semi-transparent. So if I now underlay it with something black I can see it. What I did is exchange transparent with white and all done. But thank you for adjusting your answer for me. – magu_ Aug 12 '15 at 3:06

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.