[pdftex] Hyperref and resetting counters...

Heiko Oberdiek oberdiek at ruf.uni-freiburg.de
Sat Jan 6 00:44:40 CET 2001


At 13:29 05.01.2001 -0800, Jody M. Klymak wrote:
>
>I want two figures to have the same figure number w/o subnumbering, so I
>simply decrease the figure counter:
>
>\begin{figure*}[htbp]
>  \begin{center}
>    \includegraphics{fig1}
>  \end{center}
>    \caption{Blah blah blah}
>\label{fig:fig21}
>\end{figure*}
>
>\addtocounter{figure}{-1}
>
>\begin{figure*}[htbp]
>  \begin{center}
>    \includegraphics{fig2}
>  \end{center}
>    \caption{Continued.}
>\label{fig:fig2}
>\end{figure*}

>ERROR: pdfTeX warning (ext4): destination with the same identifier
>(name{figure.5})

hyperref uses "\theHfigure" for building the
destination name for figures. So you can locally
rename the value it for the second figure with
the same number:

\begin{figure}
  \caption{hello}
\end{figure}
\addtocounter{figure}{-1}
\begin{figure}
  \renewcommand{\theHfigure}{cont.\arabic{figure}}%
\end{figure}

Yours sincerely
  Heiko <oberdiek at ruf.uni-freiburg.de>

PS: If you want to avoid the extra vertical space,
    introduced by the center environment, you can
    use \centering instead.



More information about the pdftex mailing list