0

I have a general question about \cleardoublepage and its use. I have a document written following the Classicthesis model, written with TexStudio and compiled with pdfLatex. I have 7 chapters and 15 sections, and have noticed that a couple of sections are not linked correctly from the table of contents, while the page number is correct. I have read all the answers about \phantomsection, \addcontentsline and \cleardoublepage and seems that the only working thing, for me, is to add a \cleardoublepage at the beginning of the section for which I get the link error. Is this solution correct? Correct me if I'm wrong, but in this way I could have useless blank pages, right? What's the proper way to link all the sections from the table of contents?

Note that, using Classicthesis, I have this lines (that I can't understand... I'm not so capable to use Latex):

\refstepcounter{dummy} % to refere to a chapter not numbered
\pdfbookmark[1]{\contentsname}{tableofcontents} % bookmark to the table of contents
\setcounter{tocdepth}{2} % <-- 2 includes up to subsections in the ToC
\setcounter{secnumdepth}{3} % <-- 3 numbers up to subsubsections
\manualmark
\markboth{\spacedlowsmallcaps{\contentsname}}{\spacedlowsmallcaps{\contentsname}}


% Table of contents
\tableofcontents % makes the table of contents
\automark[section]{chapter} % page header
\renewcommand{\chaptermark}[1]{\markboth{\spacedlowsmallcaps{#1}}{\spacedlowsmallcaps{#1}}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\enspace \spacedlowsmallcaps{#1}}}
\cleardoublepage

At the end of the document configuration file I have:

\PassOptionsToPackage{pdftex,hyperfootnotes=false,pdfpagelabels}
{hyperref} % load it last!
\usepackage{hyperref}  % backref link tocpage pagebackref
\pdfcompresslevel=9
\pdfadjustspacing=1 


% Hyperreferences

\hypersetup{%
%draft, % = no hyperlinking at all (useful in b/w printouts)
colorlinks=true, linktocpage=true, pdfstartpage=1, %linktoc = all, pdfstartview=FitV,%
% uncomment the following line if you want to have black links (e.g., for printing)
%colorlinks=false, linktocpage=false, pdfstartpage=1, pdfstartview=FitV,  pdfborder={0 0 0},%
breaklinks=true, pdfpagemode=UseNone, pageanchor=true, pdfpagemode=UseOutlines,%
plainpages=false, 
bookmarksnumbered, bookmarksopen=true, bookmarksopenlevel=1,%
hypertexnames=true,
pdfhighlight=/O,%nesting=true,%frenchlinks,%
urlcolor=webbrown, linkcolor=RoyalBlue, citecolor=webgreen, %pagecolor=RoyalBlue,%
%urlcolor=Black, linkcolor=Black, citecolor=Black, %pagecolor=Black,%
pdftitle={\myTitle},% Options for Acrobat reader
pdfauthor={\textcopyright\ \myNameOnly},%
pdfsubject={},%
pdfkeywords={},%
pdfcreator={pdfLaTeX},%
pdfproducer={LaTeX with hyperref and classicthesis}%
}   

Thank you for the answers! Giovanni

  • Let's put it this way: download classicthesis template, open ClassicThesis.pdf, go to Table of Contents page. Why do the hyperref links to Section 1.1, Part II, and Section 2.2 point to pages 4, 1o, and 13 (these numbers will show when you hover the links) instead of 5, 11, and 14 as the printed TOC indeed says. – PhilipPirrip Mar 29 '17 at 16:09
  • @PhilipPirrip That issue is known? – Johannes_B Apr 2 '17 at 11:46
  • @PhilipPirrip Uhm... so you're saing it could be a general error of classicthesis? Ok, in any case thank you! – Giova_Pave Apr 2 '17 at 13:21
  • @Giova_Pave Classicthesis is just a collection of other packages, so let's rather blame them. – PhilipPirrip Apr 2 '17 at 14:21
  • @Johannes_B I have no idea what's happening there, i.e. what in the combination of titlesec, hyperref and others can go so wrong. Where does hyperref get page numbers from? – PhilipPirrip Apr 2 '17 at 14:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.