Document Classeshyperref package and toc, bibliography

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
shiin
Posts: 5
Joined: Sat Nov 24, 2007 2:26 am

hyperref package and toc, bibliography

Post by shiin »

Hi there,
I ran into several problems when trying to adapt the hyperref package to my needs. My main concern at the moment is that when enabling colorlinks instead of having boxes around links the number, the page numbers in table of contents no longer align properly and if more than one number is in a cite reference, the closing ] is placed to too close / within the last number. I suspect this is related to the documentclass, but using another one than book unfortunately isn't an option.

A minimal code block that generates this behaviour is:

Code: Select all

\documentclass[12pt,a4paper,english]{book}
\usepackage[pdftex,colorlinks]{hyperref}
%
\begin{document}
\pagestyle{empty}
%
\tableofcontents
%
\cleardoublepage
\chapter{one}
\section{one.one}
\section{one.two}
\chapter{two}
\section{two.one}
\section{two.two}
%
\end{document}
Another problem I encountered was that using the pagebackref option no longer adds page numbers to the bibiography for back referencing. Since the same latex code compiled and added these numbers two years ago at my old institute I suspect the newer Latex version I'm using now requires a different approach.


Thanks for reading and I hope somebody might have an answer for my problems.

bye
dennis


Addition:
I now tried the former problem on the computer of my old institute, where it works just fine. They have a Latex installation from around 2004 whereas here, I'm having the newest one (MikTex + TechniCenter).

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

hyperref package and toc, bibliography

Post by sommerfee »

shiin wrote: A minimal code block that generates this behaviour is:


I can't see any misalign when running this code on my computer. TeX system is MikTeX 2.6, updated yesterday. \listfiles gives me:

Code: Select all

 *File List*
    book.cls    2005/09/16 v1.4f Standard LaTeX document class
    bk12.clo    2005/09/16 v1.4f Standard LaTeX file (size option)
hyperref.sty    2007/11/17 v6.77f Hypertext links for LaTeX
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
 hycolor.sty    2007/04/11 v1.1 Code for color options of hyperref/bookmark (HO
)
  pd1enc.def    2007/11/17 v6.77f Hyperref: PDFDocEncoding definition (HO)
etexcmds.sty    2007/09/09 v1.1 Prefix for e-TeX command names (HO)
infwarerr.sty    2007/09/09 v1.2 Providing info/warning/message (HO)
hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive
kvoptions.sty    2007/10/18 v3.0 Keyval support for LaTeX options (HO)
     url.sty    2005/06/27  ver 3.2  Verb mode for urls, etc.
  bitset.sty    2007/09/28 v1.0 Data type bit set (HO)
 intcalc.sty    2007/09/27 v1.1 Expandable integer calculations (HO)
bigintcalc.sty    2007/11/11 v1.1 Expandable big integer calculations (HO)
pdftexcmds.sty    2007/11/12 v0.2 LuaTeX support for pdfTeX utility functions (
HO)
kvsetkeys.sty    2007/09/29 v1.3 Key value parser with default handler support 
(HO)
atbegshi.sty    2007/09/09 v1.6 At begin shipout hook (HO)
   ifpdf.sty    2007/09/09 v1.5 Provides the ifpdf switch (HO)
 hpdftex.def    2007/11/17 v6.77f Hyperref driver for pdfTeX
   color.sty    2005/11/14 v1.0j Standard LaTeX Color (DPC)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
  pdftex.def    2007/06/12 v0.04h Graphics/color for pdfTeX
supp-pdf.tex
 nameref.sty    2007/05/29 v2.31 Cross-referencing by name of section
refcount.sty    2006/02/20 v3.0 Data extraction from references (HO)
    text.out
    text.out
 ***********
So if you are using an older version of hyperref, maybe updating your MikTeX solves this problem!?

Axel
shiin
Posts: 5
Joined: Sat Nov 24, 2007 2:26 am

hyperref package and toc, bibliography

Post by shiin »

I seem to be running the exact same versions as you besides pd1enc.def:

Code: Select all

 *File List*
    book.cls    2005/09/16 v1.4f Standard LaTeX document class
    bk12.clo    2005/09/16 v1.4f Standard LaTeX file (size option)
hyperref.sty    2007/11/17 v6.77f Hypertext links for LaTeX
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
 hycolor.sty    2007/04/11 v1.1 Code for color options of hyperref/bookmark (HO
)
  pd1enc.def    1999/03/30 v0.3 PDFDocEncoding (Heiko Oberdiek)
etexcmds.sty    2007/09/09 v1.1 Prefix for e-TeX command names (HO)
infwarerr.sty    2007/09/09 v1.2 Providing info/warning/message (HO)
hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive
kvoptions.sty    2007/10/18 v3.0 Keyval support for LaTeX options (HO)
     url.sty    2005/06/27  ver 3.2  Verb mode for urls, etc.
  bitset.sty    2007/09/28 v1.0 Data type bit set (HO)
 intcalc.sty    2007/09/27 v1.1 Expandable integer calculations (HO)
bigintcalc.sty    2007/11/11 v1.1 Expandable big integer calculations (HO)
pdftexcmds.sty    2007/11/12 v0.2 LuaTeX support for pdfTeX utility functions (
HO)
kvsetkeys.sty    2007/09/29 v1.3 Key value parser with default handler support
(HO)
atbegshi.sty    2007/09/09 v1.6 At begin shipout hook (HO)
   ifpdf.sty    2007/09/09 v1.5 Provides the ifpdf switch (HO)
 hpdftex.def    2007/11/17 v6.77f Hyperref driver for pdfTeX
   color.sty    2005/11/14 v1.0j Standard LaTeX Color (DPC)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
  pdftex.def    2007/06/12 v0.04h Graphics/color for pdfTeX
supp-pdf.tex
 nameref.sty    2007/05/29 v2.31 Cross-referencing by name of section
refcount.sty    2006/02/20 v3.0 Data extraction from references (HO)
    test.out
    test.out
I've also attached a pdf with my output.
Attachments
test.pdf
(15.92 KiB) Downloaded 373 times
shiin
Posts: 5
Joined: Sat Nov 24, 2007 2:26 am

Re: hyperref package and toc, bibliography

Post by shiin »

Hi there,
I probably solved my problem: Apparently the new pdflatex uses some new pdf commands that my (old) Acrobat Reader doesn't understand. Using a new one doesn't produce this misalignemt.
So now this means searching for pdflatex compatibility option :-).

bye
Post Reply