Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with hyperref, pdftex and addcontentsline

1,046 views
Skip to first unread message

Christian Wom Mortensen

unread,
Dec 10, 2000, 7:37:27 AM12/10/00
to
Hi,

Consider the following latex source file:

----------------------------------------------------
\documentclass[11pt,a4paper]{article}
\usepackage[pdftex,bookmarks=true,breaklinks,a4paper,plainpages=false]{hyper
ref}

\begin{document}
1. Bla
\par\addcontentsline{toc}{section}{1. Bla}
Bla Bla

1.1 Bla
\par\addcontentsline{toc}{subsection}{1.1 Bla}
Bla Bla

1.2 Bla
\par\addcontentsline{toc}{subsection}{1.2 Bla}
Bla Bla

2. Bla
\par\addcontentsline{toc}{section}{2. Bla}
Bla Bla

2.1 Bla
\par\addcontentsline{toc}{subsection}{2.1 Bla}
Bla Bla

\end{document}
----------------------------------------------------

When I run this through pdflatex and then view the resulting pdf file in
acrobat reader, alle the booksmark are nested into each other. That is, when
I unfold the bookmarks I see something like:

1. Bla
|
+- 1.1 Bla
|
+- 1.2 Bla
|
+- 2. Bla
|
+- 2.1 Bla

And not:

+1. Bla
|
+- 1.1 Bla
|
+- 1.2 Bla
2. Bla
|
+- 2.1 Bla

As I would expect. If, however, I remove the final subsection the booksmark
look like I think they should. I use Debian 2.2 and this is the contents of
the log file:

This is pdfTeX, Version 3.14159-13d (Web2C 7.3.1) (format=pdflatex
2000.9.11) 10 DEC 2000 13:31
**d.tex
(d.tex[/usr/share/texmf/pdftex/config/pdftex.cfg]
LaTeX2e <1998/12/01> patch level 1
Babel <v3.6x> and hyphenation patterns for american, french, german,
ngerman, d
anish, nohyphenation, loaded.
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 1999/01/07 v1.4a Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size11.clo
File: size11.clo 1999/01/07 v1.4a 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/tex/latex/hyperref/hyperref.sty
Package: hyperref 2000/05/08 v6.70f Hypertext links for LaTeX

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

(/usr/share/texmf/tex/latex/hyperref/pd1enc.def
File: pd1enc.def 2000/05/08 v6.70f Hyperref: PDFDocEncoding definition (HO)
)
Package hyperref Info: Option `bookmarks' set `true' on input line 1478.
Package hyperref Info: Option `breaklinks' set `true' on input line 1478.
Package hyperref Info: Option `plainpages' set `false' on input line 1478.
Package hyperref Info: Bookmarks ON on input line 1536.
Package hyperref Info: Hyper figures OFF on input line 1555.
Package hyperref Info: Link nesting OFF on input line 1560.
Package hyperref Info: Hyper index ON on input line 1563.
Package hyperref Info: Plain pages OFF on input line 1570.
Package hyperref Info: Backreferencing OFF on input line 1575.

Implicit mode ON; LaTeX internals redefined
(/usr/share/texmf/tex/latex/misc/url.sty
Package: url 1999/03/02 ver 1.4 Verb mode for urls, email addresses, and
file
names
)
\Fld@menulength=\count89
\Field@Width=\dimen104
\Fld@charsize=\dimen105
\Choice@toks=\toks15
\Field@toks=\toks16
Package hyperref Info: Hyper figures OFF on input line 2206.
Package hyperref Info: Link nesting OFF on input line 2211.
Package hyperref Info: Hyper index ON on input line 2214.
Package hyperref Info: backreferencing OFF on input line 2221.
Package hyperref Info: Link coloring OFF on input line 2226.
\c@Item=\count90
\c@Hfootnote=\count91
)
*hyperref using driver hpdftex*
(/usr/share/texmf/tex/latex/hyperref/hpdftex.def
File: hpdftex.def 2000/05/08 v6.70f Hyperref driver for pdfTeX

(/usr/share/texmf/tex/latex/psnfss/pifont.sty
Package: pifont 1999/03/29 PSNFSS v.7.2 Pi font support : S Rahtz
LaTeX Font Info: Try loading font information for U+pzd on input line 63.

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

(/usr/share/texmf/tex/latex/psnfss/upsy.fd
File: upsy.fd 1998/07/06 font definitions for U/psy.
))
\Fld@listcount=\count92
\@outlinefile=\write3
) (d.aux)
\openout1 = `d.aux'.

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

(/usr/share/texmf/tex/latex/hyperref/nameref.sty
Package: nameref 2000/05/08 v2.18 Cross-referencing by name of section
\c@section@level=\count93
) (d.out) (d.out)
\openout3 = `d.out'.

LaTeX Info: Redefining \ref on input line 4.
LaTeX Info: Redefining \pageref on input line 4.


Package hyperref Warning: No destination for bookmark of \addcontentsline,
(hyperref) destination is added on input line 6.


Package hyperref Warning: The anchor of a bookmark and its parent's must not
(hyperref) be the same. Added a new anchor on input line 10.


Package hyperref Warning: The anchor of a bookmark and its parent's must not
(hyperref) be the same. Added a new anchor on input line 22.

[1

[/usr/share/texmf/dvips/config/pdftex.map]] (d.aux) )
Here is how much of TeX's memory you used:
1708 strings out of 50624
22559 string characters out of 443392
67267 words of memory out of 2500001
4719 multiletter control sequences out of 10000+50000
4630 words of font info for 17 fonts, out of 400000 for 1000
14 hyphenation exceptions out of 1000
27i,4n,21p,187b,211s stack positions out of 1500i,500n,1500p,200000b,10000s
<cmr10.pfb>
Output written on d.pdf (1 page, 10580 bytes).

Heiko Oberdiek

unread,
Dec 10, 2000, 7:45:52 AM12/10/00
to
On Sun, 10 Dec 2000 13:37:27 +0100, "Christian Wom Mortensen"
<wo...@diku.dk> wrote:

>\usepackage[pdftex,bookmarks=true,breaklinks,a4paper,plainpages=false]{hyper
>ref}
>
>\begin{document}
>1. Bla
>\par\addcontentsline{toc}{section}{1. Bla}
>Bla Bla
>
>1.1 Bla
>\par\addcontentsline{toc}{subsection}{1.1 Bla}
>Bla Bla
>
>1.2 Bla
>\par\addcontentsline{toc}{subsection}{1.2 Bla}
>Bla Bla
>
>2. Bla
>\par\addcontentsline{toc}{section}{2. Bla}
>Bla Bla
>
>2.1 Bla
>\par\addcontentsline{toc}{subsection}{2.1 Bla}
>Bla Bla

>Package hyperref Warning: No destination for bookmark of \addcontentsline,


>(hyperref) destination is added on input line 6.
>
>
>Package hyperref Warning: The anchor of a bookmark and its parent's must not
>(hyperref) be the same. Added a new anchor on input line 10.


You know \section, \subsection, ...?
If you do not want to use them, you have to use another counter
(\refstepcounter) or \phantomsection:
\phantomsection
X.Y Bla
\par\addcontentsline...

Yours sincerely
Heiko <ober...@ruf.uni-freiburg.de>

Christian Wom Mortensen

unread,
Dec 10, 2000, 9:39:38 AM12/10/00
to
Hi,

> You know \section, \subsection, ...?

Yes, but I want to layout the things myself for this particular project and
since I transform from XML by XSLT it is not important for me to use the
highlevel constructs.

> If you do not want to use them, you have to use another counter
> (\refstepcounter) or \phantomsection:
> \phantomsection
> X.Y Bla
> \par\addcontentsline...

Thank you very much :-) I have spend quite som time with this problem.


Christian


0 new messages