conflict between hyperref option and pdflatex

21 views
Skip to first unread message

Tinette

unread,
Jul 2, 2007, 10:33:30 AM7/2/07
to LaTeX Users Group
Hello everybody,
I am writing my PhD thesis and I want to use hyperref option with
pdflatex. However, the line with "\addtocententline" can't not pass
the second pdflex compile. There is a conflict between hyperref option
and pdflatex.
Do you know how to manage that?
Thank you
Tinette

Werner Grundlingh

unread,
Jul 2, 2007, 10:38:09 AM7/2/07
to LaTeX Users Group

In the very least, please send an example of the whole
\addtocontentsline command. Even better, strip down the document and
send a complete minimal example of what might be the problem. For more
information, see the UK TeX FAQ entry
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl

This problem may also occur if there was some mistake in the compiled
version of your LaTeX code which was corrected at a later stage.
The .aux (and .toc) file contains information about the compilation
(and toc entries)...so delete these and re-compile. If that doesn't
fix the problem, refer to my first paragraph.

Werner

Tinette

unread,
Jul 5, 2007, 5:24:31 AM7/5/07
to LaTeX Users Group
After lots of tries, I managed to eliminate the conflict between
\addcontentsline and \hyperref by making the following commands in
this particular order in the main document:

\cleardoublepage
\selectlanguage{english}
\typeout{List of Abbreviations}
\include{filename}
\addcontentsline{toc}{chapter}{List of Abbreviations}


Hyperref works and it goes at the right page from the TOC, however the
title is too high on the page and therefore it is not seen directly.
Any idea to do it better

Werner Grundlingh

unread,
Jul 5, 2007, 11:34:07 AM7/5/07
to LaTeX Users Group
On Jul 5, 2:24 am, Tinette <martine.pof...@gmail.com> wrote:
> After lots of tries, I managed to eliminate the conflict between
> \addcontentsline and \hyperref by making the following commands in
> this particular order in the main document:
>
> \cleardoublepage
> \selectlanguage{english}
> \typeout{List of Abbreviations}
> \include{filename}
> \addcontentsline{toc}{chapter}{List of Abbreviations}
>
> Hyperref works and it goes at the right page from the TOC, however the
> title is too high on the page and therefore it is not seen directly.
> Any idea to do it better

I understand from this that the title (probably the 'List of
Abbreviations' in filename) _is_ displayed, but the hyperref link
jumps to just below it, rather than on it, correct?

If this is the case, how do you specify the title of the 'List of
Abbreviations'? Hopefully you're using \chapter*{List of
Abbreviations}. If this is the case, just add the following in
filename:

% \cleardoublepage
\phantomsection
\chapter*{List of Abbreviations}


\addcontentsline{toc}{chapter}{List of Abbreviations}

and remove the \addcontentsline{...}{...}{...} from your main
document. The hyperref \phantomsection command is similar to
\hypertarget and sets the target/reference for the bookmarks to the
beginning of \chapter*{...}. You may have to actually use the
\cleardoublepage (that is, remove the comment in the above code) to
get the \phantomsection to work correctly. I haven't tested the code
to know.

Werner

Reply all
Reply to author
Forward
0 new messages