# [pdftex] problems w/pdflatex and hyperref in the book class

franciszek holop fred at pentacom.sk
Mon Nov 17 14:23:56 CET 2003

hello list,

i know, this list is more for pdftex.  if there's a list
for pdflatex please direct me to it.

i am typesetting a book but not for printing just regular
electronic publishing.  for convinience i would like to
have links to the particular chapters.  i have 2 test cases:
with and without the tocloft package.  my problem is,

without the tocloft package after clicking on the link (in xpdf)
the same page is diplayed, with the tocloft package
always the first chapter is displayed.  frankly, i lack the skills
to debug this issue, and i am not sure whose fault is this
(pdflatex, hyperref, tocloft).  i use hyperref regularly and
this is the first time the links are not right.  somebody else
could test this book?
(3.14159-1.10b, hyperref 2003/01/22 v6.73n, tocloft 2003/01/20 v2.3b)

please see the example at the end of this mail which is the
skeleton of the book i am working on.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[10pt,openright,twoside]{book}
\usepackage[a5paper]{geometry}
\usepackage[T1]{fontenc}
\usepackage[latin2]{inputenc}
\usepackage[magyar]{babel}
\usepackage{fancyhdr}
\usepackage{tocloft}
\usepackage{pslatex}
\usepackage[pdftex]{hyperref}

\pagestyle{fancy}
\fancyhf{}

\hypersetup{
pdfauthor={simple sample},
pdftitle={the sample book}
}

\clubpenalty=10000
\widowpenalty=10000
\lineskip 1pt
\normallineskip 1pt
\setlength\parskip{0.01pt}

\AtBeginDocument{%
\renewcommand{\contentsname}{}
\renewcommand{\chaptername}{}}

\renewcommand{\thechapter}{\Roman{chapter}}

\renewcommand{\cftchapfont}{\mdseries}
\newlength{\len}
\setlength{\len}{0.5em}
\renewcommand{\cftchappresnum}{\hfill}
\renewcommand{\cftchapaftersnum}{\hspace*{\len}}
\renewcommand{\cftchapafterpnum}{\cftparfillskip}

\begin{document}

\title{the sample book}
\author{simple sample}
\date{}

\maketitle

\clearpage
\tableofcontents
\clearpage

\chapter{one}
\chapter{two}
\chapter{three}
\chapter{four}

\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

-f
--
god?  i'm no god.  god has mercy.