3

I have an image like this which I have included with an \includegraphics command.

enter image description here

I want each of the circles to be a link to a different part of the document. I.e. clicking on the blue circle should take the user to \label{blue}, clicking on the green circle should take the user to \label{green}, etc.

The links may be URLs as well, instead of links to places within the documents. What i'm getting at is something similar to Map/Area in HTML (http://www.w3schools.com/tags/tag_area.asp)

Why? Because the images in question are generated by software, as a result the "maps" can be generated by the software too. Subfigures are not an option since the figures cannot be broken apart.

4

Here's a version with tikz nodes overlaying an image and placing \hyperlinks with \nameref{...} to the sections:

The node positions are up to the user!

enter image description here

\documentclass[oneside]{article}


\usepackage{blindtext}
\usepackage{tikz}
\usepackage{graphicx}


\newcommand{\namereflink}[1]{%
  \nameref{#1}%
% Or use
%  \hyperlink{section.\getrefnumber{#1}}{\nameref*{#1}}%
% Or use
%  \hyperlink{section.\getrefnumber{#1}}{\phantom{}}%  Difficult to detect!!!!
}

\usepackage{hyperref}

\begin{document}

\begin{center}
\begin{tikzpicture}[scale=4]
  \hypersetup{hidelinks}
  \node[inner sep=1pt] (MYCENTER) at (0,0) {\includegraphics[scale=1]{ente.jpg}};
  \node (BLUEEDGE) at (-1,1)    {\nameref{sec:blue}}; % For example
  \node (GREENEDGE) at (1,1)    {};
  \node  (REDEDGE) at (-1,-1)   {};
  \node  (ORANGEEDGE) at (1,-1) {};
  \draw[help lines, step=0.25] (MYCENTER) (REDEDGE) grid (GREENEDGE); %Only for help purposes
  \node  (BLUE)   at (-0.5,0.5)  {\namereflink{sec:blue}};
  \node  (GREEN)  at (0.25,0.5)   {\namereflink{sec:green}};
  \node  (RED)    at (-0.25,-0.25) {\namereflink{sec:red}};
  \node  (ORANGE) at (1,-0.25)  {\namereflink{sec:orange}};

  \shade[ball color=blue] (BLUEEDGE) circle (0.5);
  \shade[ball color=green] (GREENEDGE) circle (0.5);
  \shade[ball color=red] (REDEDGE) circle (0.5);
  \shade[ball color=orange] (ORANGEEDGE) circle (0.5);
\end{tikzpicture}
\end{center}

\clearpage

\section{Blue} \label{sec:blue}

\blindtext[5]


\section{Red} \label{sec:red}

\blindtext[5]

\section{Green} \label{sec:green}

\blindtext[5]

\section{Orange} \label{sec:orange}

\blindtext[5]

And a normal link to \ref{sec:blue}

\end{document}

The code for the real image

\documentclass[oneside]{article}


\usepackage{blindtext}
\usepackage{tikz}
\usepackage{graphicx}


\newcommand{\namereflink}[1]{%
%  \nameref{#1}%
% Or use
%  \hyperlink{section.\getrefnumber{#1}}{\nameref*{#1}}%
% Or use
  \hyperlink{section.\getrefnumber{#1}}{\phantom{#1}}%  Difficult to detect!!!!
}

\usepackage{hyperref}

\begin{document}

\begin{center}
\begin{tikzpicture}[scale=1]
  \hypersetup{hidelinks}
  \node  (MYCENTER) at (0,0) {\includegraphics[scale=1]{sourceimage.jpg}};
  \node  (BLUE)   at (-1,1)  {\namereflink{sec:blue}};
  \node  (GREEN)  at (1,1)   {\namereflink{sec:green}};
  \node  (RED)    at (-1,-1)  {\namereflink{sec:red}};
  \node  (ORANGE) at (1,-1)  {\namereflink{sec:orange}};
\end{tikzpicture}

\end{center}

\clearpage

\section{Blue} \label{sec:blue}

\blindtext[5]


\section{Red} \label{sec:red}

\blindtext[5]

\section{Green} \label{sec:green}

\blindtext[5]

\section{Orange} \label{sec:orange}

\blindtext[5]

And a normal link to \ref{sec:blue}

\end{document}
|improve this answer|||||
  • 1
    Awesome. Really well make example too! – kabZX Apr 22 '16 at 16:34
  • @kabZX: You're welcome. But perhaps you should generate the image with TikZ etc, not using an \includegraphics way. – user31729 Apr 22 '16 at 18:20

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.