I have a diagram as an image. There are described different components which are later described and marked with \label tags.

Can I ref link different areas/sections of one image to different \label tags? Or do I have to combine the diagram out of different images and ref them each?

I am using the package hyperref at the moment.

\documentclass[11pt, a4paper, oneside]{article}



% something like    \refInsidePicture{area1}{fromX}{toX}{fromY}{toY}
%                   \refInsidePicture{area2}{fromX}{toX}{fromY}{toY}
%                   \refInsidePicture{area3}{fromX}{toX}{fromY}{toY}
%                   \refInsidePicture{area4}{fromX}{toX}{fromY}{toY}
\section{area1 explained} \label{area1}
\section{area2 explained} \label{area2}
\section{area3 explained} \label{area3}
\section{area4 explained} \label{area4}
  • Yes you can. Can you provide us with a minimal working example (MWE) that shows the community exactly what you mean?
    – Werner
    Jul 29 '14 at 6:00
  • If all you want is to link, use \hyperlink and \hypertarget. \label and \ref are intended to keep track of counters. Jul 30 '14 at 12:50
  • @John Kormylo Thank you. I looked into the \hyperlink and \hypertarget docs and I do think that it is not what I searched. I do want something like the <area> tag from HTML. HTML area: [stackoverflow.com/questions/18560097/… Jul 31 '14 at 8:40
  • Consider \hypertarget{area1}{\makebox[2in]{\rule{0pt}(1in}}. This will target an area 2 inches wide by 1 inch tall. Now all you need is to use \raisebox to overlay the areas onto the image. Jul 31 '14 at 13:51

It seems \hypertarget aims for the baseline, so I had to move the areas below the baseline.

\documentclass[11pt, a4paper, oneside]{article}



% better too small than too big



\raisebox{0pt}[0pt]{\usebox{\tempbox}}% overlay

\hyperlink{area1}{upper left}
\hyperlink{area2}{upper right}
\hyperlink{area3}{lower left}
\hyperlink{area4}{lower right}

  • Fascinating. Thank you. When I switch the \hypertarget and \hyperlink commands it is exactly what I wanted to accomplish. Jul 31 '14 at 18:07
  • @pizza_exclamationMark, AH! Makes more sense that way. Jul 31 '14 at 20:46

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.