[OS X TeX] hyperref and endnotes/bibliography

Wolfgang Schmidle Wolfgang.Schmidle at sunderland.ac.uk
Fri Apr 28 13:34:33 CEST 2006


Bruno Voisin schrieb:
> Le 28 avr. 06 à 11:51, Wolfgang Schmidle a écrit :
>> I have made a minimal example now. With "\addcontentsline" at 
>> position A, the toc entry is correct, but hyperref refers to the 
>> wrong page. At position B, hyperref works correctly, but the page in 
>> the toc entry is wrong.
>
> Sorry, I had missed your original post. I think the solution to your 
> problem is using the (undocumented) \phantomsection command from the 
> hyperref package (at the very end of hyperref.sty). It does not insert 
> any text, but an anchor at the current point in the PDF output. Thus 
> you should write, possibly:
>
> \phantomsection
> \addcontentsline{toc}{chapter}{\numberline{}Bibliography} % position A
>


Thanks Bruno, that solved the problem!

Another thing with hyperref and endnotes: Hyperref recognises footnotes 
but not endnotes, and even with footnotes there is no link from the 
footnote back to the text. Starting with the code from
http://www.tug.org/pipermail/pdftex/2006-March/006460.html
and using some co from the LaTeX Companion, I wrote the following:

\newcounter{nummer} \setcounter{nummer}{1}
\newcommand{\fn}[2]{\hypertarget{back\arabic{nummer}}{\hyperlink{note#1}{\endnotemark}}%
\stepcounter{nummer}%
\endnotetext{\protect\hypertarget{note#1}{#2}}}

\renewcommand\enoteformat{\noindent
   
\setlength\parindent{12pt}\makebox[0pt][r]{\hyperlink{back\theenmark}{\theenmark}.\,\,}}

However, this solution is not very convenient as I have to give a unique 
label to every endnote. Is there a better solution?

Wolfgang

------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list