Home > LaTeX > Using Hyperref, Graphicx, and Algorithm together

Using Hyperref, Graphicx, and Algorithm together

April 21st, 2009 Leave a comment Go to comments

In LaTeX, the hyperref package can be challenging to work with. It is well known that the hyperref package must be loaded last, BUT when using the algorithm package as well things get tricky. algorithm must be loaded after hyperref 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) before hyperref 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.

Categories: LaTeX Tags:
  1. harpun
    May 3rd, 2010 at 10:40 | #1

    Great! It did the trick. Thanks! :D

  1. No trackbacks yet.