I have a document with two sets of tables. The first set, numbered 1 to 5, are in the main body of the text. The second, numbered 1 to 3, are in an appendix.
When I use \ref
to link to one of the tables in the appendix, the hyperlink in the PDF file links to the corresponding table in the main section (so a link to appendix table 1 links to main table 1). This warning message is provided:
pdfTeX warning (ext4): destination with the same identifier (name{table.1})
has been already used, duplicate ignored
Clearly this is a counter problem: when I reset the table counter in the appendix, there are two tables with a counter of 1 and hyperref just points to the first one.
Related problems have been discussed on this forum, and a number of discussions can be found online, but I haven't been able to figure out a solution to this particular problem. (It seems more straightforward to fix the problem for page numbers.) Also, I get the sense that the aliascnt
package could work here, but I can't figure out how to make it work.
Best Answer
Indeed, the problem comes from link anchors not having unique names. To provide those unique names, you can appropriately redefine
\theHtable
to guarantee that it will expand to a unique value (despite the counter resetting); for example: