TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using pgfplots with externalize because my document has a lot of plots which causes problems with memory limitation in LaTeX. In one of my plots I have a reference to an equation. In the file main-figure0.pdf the reference shows up correclty with the hypertext link from the hyperref package. But the hypertext link doesn't show up in the main.pdf file.



\tikzexternalize[shell escape=-shell-escape]


        \node[draw, rectangle] (block) at (0,0) {\ref{eq}};

I compile with:

pdflatex -shell-escape -synctex=1 -src-specials main.tex
pdflatex -shell-escape -jobname "main-figure0" "\def\tikzexternalrealjob{main}\input {main}"
pdflatex -shell-escape -synctex=1 -src-specials main.tex

How do I get the hypertext link to show up in the actual document?

share|improve this question
If only one plot has that issue, you can disable the externalization for this one plot. – T. Verron May 19 '14 at 16:00
I suppose importing hyperlinks by means of an external graphics is unsupported, sorry. Perhaps The comment of @T.Verron should become the answer. – Christian Feuersänger May 20 '14 at 19:41
Thank you @T.Verron. I guess I can live with your solution although it's only some sort of workaround. Could you please make your comment to an answer? – Pronk May 24 '14 at 14:30
Sorry for the delay. ;) – T. Verron May 30 '14 at 10:52
up vote 3 down vote accepted

As far as I know, tikz imports external graphics as pictures, just like what you would do with \includegraphics. Hypertext links are indeed dropped.

If only a few plots include hypertext links, as a workaround, you can disable the externalization for these plots, by adding

\tikzset{external/export next=false}

before each of them.

share|improve this answer
Awesome workaround the hyperref + external + \ref \label situation! – Bibi Jan 6 at 9:25

Your Answer


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.