Using Hyperref, Graphicx, and Algorithm together | Shawn Lankton Online
In LaTeX, the
hyperref
package can be challenging to work with. It is well known that thehyperref
package must be loaded last, BUT when using thealgorithm
package as well things get tricky.algorithm
must be loaded afterhyperref
BUT, 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
float
package (which is normally loaded by other more high-level packages) beforehyperref
like 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.