[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#351260: hyperref+float: broken links to floats



Package: tetex-extra
Version: 3.0-13
Severity: normal
Tags: patch

*** Please type your report below this line ***

Pdflatex reports some warnings on the input file below:

! pdfTeX warning (ext4): destination with the same identifier (name{Item.3}) ha
s been already used, duplicate ignored

! pdfTeX warning (dest): name{figure.1} has been referenced but does not exist,
 replaced by a fixed one

These do not disappear if run multiple times.

When compiled with latex (i.e. dvi output) then some links are shown 
incorrect by xdvi:

In the list of figures, clicking on the link to the figure, a 
mnessage displayed in the bottom:

Error: anchor "figure.1" not found.

In the last line, the links 1, 2 point to where expected.  However, 
3 points to the top of the figure instead of the third item of the 
list.  (xdvi shows this by an arrow when clicked on a link.)

All in all, it seems that the following happens:
For some reason the figure gets the identifier "Item.3" instead of 
"figure.1".  This shadows the third item in the list, which should 
have identifier "Item.3".

This explanation justifies the behaviours of pdflatex and xdvi.

Suggested patch:
--- /usr/share/texmf-tetex/tex/latex/hyperref/hyperref.sty	2004-03-14 12:00:23.000000000 +0100
+++ ../hyperref.sty	2006-02-02 18:05:27.000000000 +0100
@@ -3472,7 +3472,10 @@
   \renewcommand{\float@makebox}[1]{%
     \HyOrg@float@makebox{%
       #1\relax
-      \hyper@@anchor{\@currentHref}{\relax}%
+      \begingroup
+        \hyper@makecurrent{\@captype}%
+        \hyper@@anchor{\@currentHref}{\relax}%
+      \endgroup
     }%
   }%
 }{}

The added \hyper@makecurrent macro is meant to fix the identifier of 
the anchor.  The additional \begingroup, \endgroup is for mkaing the 
effect of \hyper@makecurrent local.  (I don't know if this extra 
grouping is needed.)

Last, the patch seems to make the problem disappear: no pdflatex 
errors, links pointing to where they should.

Cheers,

	Gabor Braun

-- Package-specific info:
##################################
minimal input file

\documentclass[a4paper]{article}
\usepackage{float}
\usepackage{hyperref}
\restylefloat{figure}

\begin{document}
\listoffigures
\begin{figure}
  \centering
  \caption{Sample list}
  \label{fig:1}
  Some text before the list
  \begin{enumerate}
  \item\label{item:1} First
  \item\label{item:2} Second
  \item\label{item:3} Third
  \end{enumerate}
\end{figure}
References: \ref{item:1}, \ref{item:2}, \ref{item:3}.
\end{document}

##################################
other files

logfile when run with pdflatex:

This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) (format=pdflatex 2005.12.29)  3 FEB 2006 17:01
entering extended mode
**proba.tex
(./proba.tex
LaTeX2e <2003/12/01>
Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b
ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e
stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis
h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur
kish, ukrainian, nohyphenation, loaded.
(/usr/share/texmf-tetex/tex/latex/base/article.cls
Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
(/usr/share/texmf-tetex/tex/latex/base/size10.clo
File: size10.clo 2004/02/16 v1.4f Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(/usr/share/texmf-tetex/tex/latex/float/float.sty
Package: float 2001/11/08 v1.3d Float enhancements (AL)
\c@float@type=\count87
\float@exts=\toks14
\float@box=\box26
\@float@everytoks=\toks15
\@floatcapt=\box27
)
(/usr/share/texmf-tetex/tex/latex/hyperref/hyperref.sty
Package: hyperref 2003/11/30 v6.74m Hypertext links for LaTeX

(/usr/share/texmf-tetex/tex/latex/graphics/keyval.sty
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks16
)
\@linkdim=\dimen103
\Hy@linkcounter=\count88
\Hy@pagecounter=\count89

(/usr/share/texmf-tetex/tex/latex/hyperref/pd1enc.def
File: pd1enc.def 2003/11/30 v6.74m Hyperref: PDFDocEncoding definition (HO)
)
(/usr/share/texmf-tetex/tex/latex/hyperref/hyperref.cfg
File: hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive and teTeX
)
Package hyperref Info: Hyper figures OFF on input line 1880.
Package hyperref Info: Link nesting OFF on input line 1885.
Package hyperref Info: Hyper index ON on input line 1888.
Package hyperref Info: Plain pages ON on input line 1893.
Package hyperref Info: Backreferencing OFF on input line 1900.

Implicit mode ON; LaTeX internals redefined
Package hyperref Info: Bookmarks ON on input line 2004.
(/usr/share/texmf-tetex/tex/latex/url/url.sty
\Urlmuskip=\muskip10
Package: url 2004/03/15  ver 3.1  Verb mode for urls, etc.
)
LaTeX Info: Redefining \url on input line 2143.
\Fld@menulength=\count90
\Field@Width=\dimen104
\Fld@charsize=\dimen105
\Choice@toks=\toks17
\Field@toks=\toks18
Package hyperref Info: Hyper figures OFF on input line 2618.
Package hyperref Info: Link nesting OFF on input line 2623.
Package hyperref Info: Hyper index ON on input line 2626.
Package hyperref Info: backreferencing OFF on input line 2633.
Package hyperref Info: Link coloring OFF on input line 2638.
\c@Item=\count91
\c@Hfootnote=\count92
)
*hyperref using default driver hpdftex*
(/usr/share/texmf-tetex/tex/latex/hyperref/hpdftex.def
File: hpdftex.def 2003/11/30 v6.74m Hyperref driver for pdfTeX

(/usr/share/texmf-tetex/tex/latex/psnfss/pifont.sty
Package: pifont 2004/09/15 PSNFSS-v9.2 Pi font support (SPQR) 
LaTeX Font Info:    Try loading font information for U+pzd on input line 63.

(/usr/share/texmf-tetex/tex/latex/psnfss/upzd.fd
File: upzd.fd 2001/06/04 font definitions for U/pzd.
)
LaTeX Font Info:    Try loading font information for U+psy on input line 64.

(/usr/share/texmf-tetex/tex/latex/psnfss/upsy.fd
File: upsy.fd 2001/06/04 font definitions for U/psy.
))
\Fld@listcount=\count93
\@outlinefile=\write3
)
\@float@every@figure=\toks19
 (./proba.aux)
\openout1 = `proba.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 6.
LaTeX Font Info:    ... okay on input line 6.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 6.
LaTeX Font Info:    ... okay on input line 6.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 6.
LaTeX Font Info:    ... okay on input line 6.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 6.
LaTeX Font Info:    ... okay on input line 6.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 6.
LaTeX Font Info:    ... okay on input line 6.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 6.
LaTeX Font Info:    ... okay on input line 6.
LaTeX Font Info:    Checking defaults for PD1/pdf/m/n on input line 6.
LaTeX Font Info:    ... okay on input line 6.
Package hyperref Info: Link coloring OFF on input line 6.

(/usr/share/texmf-tetex/tex/latex/hyperref/nameref.sty
Package: nameref 2003/12/03 v2.21 Cross-referencing by name of section
\c@section@level=\count94
)
LaTeX Info: Redefining \ref on input line 6.
LaTeX Info: Redefining \pageref on input line 6.
 (./proba.out)
(./proba.out)
\openout3 = `proba.out'.

 (./proba.lof
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <7> on input line 1.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <5> on input line 1.
)
\tf@lof=\write4
\openout4 = `proba.lof'.

 [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}
! pdfTeX warning (ext4): destination with the same identifier (name{Item.3}) ha
s been already used, duplicate ignored
<to be read again> 
                   \endgroup \set@typeset@protect 
l.20 \end{document}
                   

] (./proba.aux) ) 
Here is how much of TeX's memory you used:
 1961 strings out of 94500
 26975 string characters out of 1175787
 74655 words of memory out of 1000000
 5158 multiletter control sequences out of 10000+50000
 4935 words of font info for 18 fonts, out of 500000 for 2000
 580 hyphenation exceptions out of 8191
 27i,4n,22p,168b,205s stack positions out of 1500i,500n,5000p,200000b,5000s
PDF statistics:
 26 PDF objects out of 300000
 7 named destinations out of 131072
 17 words of extra memory for PDF output out of 65536

! pdfTeX warning (dest): name{figure.1} has been referenced but does not exist,
 replaced by a fixed one

</usr/share/texmf-tetex/fonts/type1/bluesky/cm/cmbx12.pfb></usr/share/texmf-tet
ex/fonts/type1/bluesky/cm/cmr10.pfb>
Output written on proba.pdf (1 page, 15484 bytes).

######################################
 List of ls-R files

-rw-rw-r--  1 root users 1187 2006-02-03 15:12 /var/lib/texmf/ls-R
lrwxrwxrwx  1 root staff 25 2005-11-20 18:05 /usr/local/share/texmf/ls-R -> /var/lib/texmf/ls-R-LOCAL
lrwxrwxrwx  1 root root 29 2006-01-31 18:19 /usr/share/texmf/ls-R -> /var/lib/texmf/ls-R-TEXMFMAIN
lrwxrwxrwx  1 root root 35 2006-01-22 16:57 /usr/share/texmf-tetex/ls-R -> /var/lib/texmf/ls-R-TEXMFDIST-TETEX

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (650, 'testing'), (600, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.14-2-686
Locale: LANG=hu_HU.iso88592, LC_CTYPE=hu_HU.iso88592 (charmap=ISO-8859-2) (ignored: LC_ALL set to hu_HU.iso88592)

Versions of packages tetex-extra depends on:
ii  dpkg                          1.10.28    Package maintenance system for Deb
ii  tetex-base                    3.0-13     Basic library files of teTeX
ii  tetex-bin                     3.0-13     The teTeX binary files
ii  ucf                           1.17       Update Configuration File: preserv

-- no debconf information



Reply to: