The links and destinations are added by package hyperref. Because destinations need
different names, the names are composed by the counter name and the counter value.
But having a symbolic destination name is indeed a useful feature. Therefore I have
implemented such a feature in hyperref 2012/07/28 v6.82u. It is enabled by package
destlabel. Later it cannot be enabled using
For a better understanding of the destination name stuff in hyperref I have written
a section to the hyperref manual that I here quote for convenience.
Options for destination names
Destinations names (also anchor, target or link names) are internal
names that identify a position on a page in the document. They
are used in link targets for inner document links or the bookmarks,
Usually anchor are set, if
\refstepcounter is called.
Thus there is a counter name and value. Both are used to
construct the destination name. By default the counter value
follows the counter name separated by a dot. Example for
the fourth chapter:
This scheme is used by:
\autoref displays the description label for the
reference depending on the counter name.
\hyperpage is used by the index to get
page links. Page anchor setting (
pageanchor) must not
be turned off.
It is very important that the destination names are unique,
because two destinations must not share the same name.
The counter value
\the<counter> is not always unique
for the counter. For example, table and figures can be numbered
inside the chapter without having the chapter number in their
number. Therefore hyperref has introduced
that allows a unique counter value without messing up with
the appearance of the counter number. For example, the number
of the second table in the third chapter might be printed
2, the result of
\thetable. But the
table.2.4 is unique because it
\theHtable that gives
2.4 in this case.
Often the user do not need to set
for standard cases (chapter, \dots) are provided. And after hyperref
is loaded, new counters with parent counters also define
\theH<counter> automatically, if
\numberwithin of package amsmath are used.
Usually problems with duplicate destination names can be solved
by an appropriate definition of
\theH<counter>. If option
hypertexnames is disabled, then a unique artificial
number is used instead of the counter value. In case of page
anchors the absolute page anchor is used. With option
the page anchors use the arabic form. In both latter cases
for index links is affected and might not work properly.
If an unnumbered entity gets an anchor (starred forms of
chapters, sections, …) or
\phantomsection is used,
then the dummy counter name
section* and an artificial
unique number is used.
If the final PDF file is going to be merged with another file, than
the destination names might clash, because both documents might
page.1. Also hyperref
sets anchor with name
Doc-Start at the begin of the document.
This can be resolved by redefining
Package hyperref calls this macro each time, it uses a destination name.
The macro must be expandable and expects the destination name
as only argument. As example, the macro is redefined to add
a prefix to all destination names:
docA the destination name
Destination names can also be used from the outside in URIs(, if the
driver has not removed or changed them), for example:
However using a number seems unhappy. If another chapter is added
before, the number changes. But it is very difficult to pass
a new name for the destination to the anchor setting process that
is usually deep hidden in the internals. The first name of
label after the anchor setting seems a good approximation:
destlabel checks for each
\label, if there is
a new destination name active and replaces the destination
name by the label name. Because the destination name is already in use
because of the anchor setting, the new name is recorded in the
file and used in the subsequent LaTeX run. The renaming is done by
a redefinition of
\HyperDestNameFilter. That leaves the old
destination names intact (e.g., they are needed for
This redefinition is also available as
thus that an own redefinition can use it.
The following example also adds a prefix for all destination names:
The other case that only files prefixed that do not have a corresponding
\label is more complicate, because
the unmodified destination name as argument. This is solved by an
expandable string test (
\pdfstrcmp of pdfTeX
\strcmp of XeTeX, package pdftexcmds also supports LuaTeX):
destlabel destinations can also named manually,
if the destination is not yet renamed:
Hint: Anchors can also be named and set by