1

I made a table of content with clickable links. Links to chapters and sections work fine: when I click on them I see the chapter title and its content. On the other hand, when I click to the list of figures, tables and content itself, I get to the text of the list rather then see the whole page with the title "List of Figures".

Can I get 'list of figure' behave in the same way of chapters?

EDIT: it might be a problem on how I compile the code as other users with the same pdf viewer say it already works as I would like.

Here's a code sample.

\documentclass{book}

\usepackage{color}
\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    citecolor=black,
    filecolor=black,
    linkcolor=blue,
    urlcolor=black
}


\begin{document}

\tableofcontents
\addcontentsline{toc}{chapter}{Content}

\newpage ~

\listoffigures
\addcontentsline{toc}{chapter}{List of Figures}

\listoftables
\addcontentsline{toc}{chapter}{List of Tables}

\newpage ~
\chapter{Intro}

\begin{figure}
\caption{Bla Bla}
\label{fig:bla}
\end{figure}

\newpage ~
\chapter{Related}

\begin{table}[hb]
\caption{Boh}
\begin{tabular}{|l|l|r|}

\end{tabular}
\label{tab:boh}
\end{table}


\end{document}
Niccolò
  • 187
  • This is is pretty easy to explain, the link comes with the caption. Since the Caption of a figure is below of the picture, the link points below the figure. – Rico Sep 02 '13 at 14:43
  • Try the package »tocbibind« instead of the \addcontentsline commands. – Thorsten Donig Sep 02 '13 at 14:43
  • @Rico, the point is the link to the list of figures not the links inside the list pointing to the figures. Note that inverting the lines \listoffigures \addcontentsline does not work properly. – Niccolò Sep 02 '13 at 14:53
  • @ThorstenDonig I check it, thanks. The problem is that I actually use an external .sty that slightly modifies these and other commands. So it can be problematic. – Niccolò Sep 02 '13 at 14:57
  • @ThorstenDonig the package did not work anyway. I tried it on the above example. – Niccolò Sep 02 '13 at 15:15
  • Using your code in AdobeReader I got the desired behaviour. Isn't the problem coming from your PDF reader? – Ludovic C. Sep 02 '13 at 16:01
  • @LudovicC. I tested it with Acrobat Reader, Okular and Gnome's PDFviewer, no one works: if i click "List of Figure" the first line that I see is "1.1 Bla Bla.. 7" and not "List of Figures" (title). Are you sure you get that behavior? – Niccolò Sep 02 '13 at 16:17
  • Definitely sure. – Ludovic C. Sep 02 '13 at 16:34
  • I have no problems, either, with SumatraPDF. – karlkoeller Sep 02 '13 at 16:48
  • @Niccolò you mentioned a package that modifies \listoffigures. Can you please add to your question as an edit the code modifying the command? – Gonzalo Medina Sep 02 '13 at 17:31
  • I don't know guys (@LudovicC. @karlkoeller), now I've tried it on a Kindle Fire HD with AdobeReader, previously I was on Ubuntu 12.04. The first line I see is always "1.1 Bla Bla.. 7", the title is always hided above. Is it possible that the problem is in my latex compiler? Can you pass me your compiled copy of the code above? – Niccolò Sep 02 '13 at 17:56
  • The problem shows also in the minimal example shown in the question, where I don't use the .sty file. But if you (@GonzaloMedina) really want to try with it, you find it at http://en.ru.is/departments/school-of-computer-science/graduate-education/msc-in-computer-science/theses/thesis-template/ – Niccolò Sep 02 '13 at 17:59
  • @Niccolò the code in your question behaves OK in my system (I checked using Evince, Okular, and Acrobat Reader in Ubuntu 12.04). – Gonzalo Medina Sep 02 '13 at 18:13
  • @GonzaloMedina can it be a compiler issue then? Cause I tried to open my document with Adobe on a kindle fire and still what I see is the first line of the figures: "1.1 Bla Bla.. 7" and the title "list of figures" is hided above. – Niccolò Sep 02 '13 at 21:01

1 Answers1

2

It seems that you are using an outdated TeXLive 2009. You can see this in the first line of your log file:

This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) (format=pdflatex 2013.6.3) 

The current version is TeXLive 2013.

Please follow question How to install "vanilla" TeXLive on Debian or Ubuntu? to update your system.

Mensch
  • 65,388