Using Hyperref, Graphicx, and Algorithm together | Shawn Lankton Online
In LaTeX, the
hyperrefpackage can be challenging to work with. It is well known that thehyperrefpackage must be loaded last, BUT when using thealgorithmpackage as well things get tricky.algorithmmust be loaded afterhyperrefBUT, doing the following error if figures are used at the same time with pdfTeX:
ERROR: pdfTeX warning (ext4): destination with the same identifier (name{figure.1})The solution is to load the
floatpackage (which is normally loaded by other more high-level packages) beforehyperreflike so:
\usepackage{amsmath,amsymb,graphicx,subfigure,etc.,etc.}
\usepackage{float}
\usepackage{hyperref}
\usepackage{algorithm}
The other solution is to not use pdfLaTeX, and use regular LaTeX instead.