Page Layouttocloft | Hyperlinks for ToC Entries with Offset

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

tocloft | Hyperlinks for ToC Entries with Offset

Post by Cham »

I'm experiencing a glitch with the tocloft package. See the MWE below.

When the package is switched off, the clickable links are working perfectly in the ToC entries. When the package is turned on, clicking on entries like "Content" or "List of Figures" in the ToC brings you to the right page but with an annoying offset (the title isn't visible). Why is that?

Code: Select all

\documentclass[12pt,letterpaper,twoside]{book}
\usepackage[T1]{fontenc}
\usepackage[]{tocbibind}
\usepackage{tocloft}
\usepackage[]{hyperref}

\begin{document}

\tableofcontents

\chapter{A first chapter}
\section{A section}
Bla bla bla bla bla bla.
\newpage
Bla bla bla bla bla.

\chapter{A second chapter}
\section{First section in the second chapter}
Bla bla bla bla.  Bla bla bla bla bla.
\newpage
Bla bla bla bla

\listoffigures

\newpage
blabla

\end{document}
I much prefer the normal behavior (when the package is off), but I still need that package to customize the presentation of the ToC and the LoF.

Any idea how to solve this issue?

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

mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

Re: tocloft | Hyperlinks for ToC Entries with Offset

Post by mas »

Did not see the problem you mention. Which viewer are you using to view the pdf file?

Regards.

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

tocloft | Hyperlinks for ToC Entries with Offset

Post by Cham »

To see the problem, you need to switch off and on the tocloft package. Both output behaves differently when you click on the "Contents" or the "List of Figures" links.
Last edited by Cham on Wed Jan 02, 2013 6:15 pm, edited 1 time in total.
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Re: tocloft | Hyperlinks for ToC Entries with Offset

Post by Cham »

So, is there a solution to this issue? Any idea?
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Re: tocloft | Hyperlinks for ToC Entries with Offset

Post by Cham »

I guess that there is no clear solution to the issue I exposed above(?).

This is weird.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

tocloft | Hyperlinks for ToC Entries with Offset

Post by localghost »

Try etoc or titletoc instead to customize your ToC.


Thorsten
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Re: tocloft | Hyperlinks for ToC Entries with Offset

Post by Cham »

Thanks for the reply.

However, do you confirm the issue that I described in my first post above ?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

tocloft | Hyperlinks for ToC Entries with Offset

Post by localghost »

Cham wrote:[…] However, do you confirm the issue that I described in my first post above ?
Yes. If you don't want to use one of the suggested alternatives, write a note to the tocloft maintainer.
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Re: tocloft | Hyperlinks for ToC Entries with Offset

Post by Cham »

Ok, thanks a lot for your feedback.

I'll see what I can do with the other packages too.
Post Reply