4

I have a little nasty problem: a footnote hyperlink doesn't lead me to current page footnote, but it jumps to the document title page.

I have already considered & tested several possible solutions (Hyperlink from footnote mark to footnote body, Using setspace package breaks footnotes link), but:

  • including the 'setspace' package before 'hyperref' has no effect;
  • disabling the 'hyperref' hyperfootnotes option (in original call to 'hyperref') leads to option clash.

I'm using the pdflatex compiler. Here are simplified code snippets:

% main.tex

\documentclass[11pt, a4paper, oneside, headinclude,footinclude]{book}
\usepackage{longtable} 
\input{book_structure.tex} % include the ''book_structure.tex'' file 
%which specifies the document structure and layout

% custom title page
\newcommand*{\titleTH}{\begingroup
\raggedleft 
\vspace*{\baselineskip} 
{\LARGE\bfseries Some book title}\\[\baselineskip] 
{\Large Version x.x.x}\par 
\endgroup}

\begin{document}
\titleTH % include the title page
\thispagestyle{empty}
\newpage

\chapter{System requirements}

\textbf{Supported operating systems:} Unix OS family 
(e.g. Mac OS X, Linux, FreeBSD) and Microsoft Windows OS family 
(e.g. 2000, 2003, XP, Vista, Seven, 8/8.1, 10). 

\textbf{CPU architectures:} x86 (x86-32, x86-64), ARMv7.

\textbf{CPU model:}\footnote{see our white paper on selection of 
hardware for LPR} selected individually (in accordance to 
number of recognition threads to be used on the server, 
video framerate and resolution). When adding one or more 
recognition threads, CPU load increases linearly. 

\end{document}

% book_structure.tex

\usepackage{arsclassica}
\usepackage{amsfonts}
\renewcommand*\rmdefault{iwona} 

\usepackage[margin = 1.5cm]{geometry} 

\usepackage{setspace} % making 1.5 line spacing 
\onehalfspacing

\usepackage[T1, T2A]{fontenc} 
\usepackage[english, russian]{babel}


%\usepackage[hyperfootnotes=false]{hyperref} %option clash
\usepackage{hyperref}
\hypersetup{
colorlinks=true, breaklinks=true,
 bookmarks=true, bookmarksnumbered, unicode=true, urlcolor=RoyalBlue, 
linkcolor=RoyalBlue
        }

If not fixing this bug, I would be satisfied with switching off the footnote hyperlinks, but, as said above, something goes wrong. Excuse me in advance for a must-be-trivial subject, I'm still a LaTeX newbie.

Does anybody have any considerations?

2
  • 1
    If arsclassica is not loaded, the linking is correct. arsclassica loads classicthesis which is a package that is multiple issues
    – user31729
    Apr 22, 2016 at 14:40
  • @ChristianHupfer, thank you very much for your comment. Yes, excluding the 'arclassica' package from the simplified example solved the issue. But I have a few dependencies from 'classicthesis' in my real project, not to mention the output document design which I adore and don't want to lose.) I guess I will live with this bug. Anyway, as we've figured out what's wrong with the hyperlinks, I would gladly accept your answer if you wrote it down below.
    – Inna
    Apr 25, 2016 at 13:36

1 Answer 1

0

Similary to my answer to Why are all of my footnotes hyperlinked to the titlepage? this is a matter of package loading order. (One could argue this is a duplicate.) setspace is your bad boy here… What you need to be aware of is that arsclassica loads classicthesis which loads hyperref. This means you need to load setspace before arsclassica.

However, both arsclassica and classicthesis at least nowadays try loading hyperref with the option hyperfootnotes=false which made it tricky to reproduce the MWE. We also need to load hyperref before arsclassica to get them activated again.

classicthesis also loads footmisc which is not terribly compatible with hyperref. As can be seen in my linked answer it must be loaded before hyperref, too. this means we need this loading order:

\usepackage{setspace}
\usepackage{footmisc}
\usepackage{hyperref}
\usepackage{arsclassica}

Actually classicthesis does not load footmisc if it finds the command \deffootnote. The latter is a KOMA-Script command and available in KOMA-Script classes. What the maintainer of classicthesis didn't seem to be aware is that one can load the package scrextend for \deffootnote as well. So lets exchange footmisc and scrextend to be on the safer side:

\usepackage{setspace}
\usepackage{scrextend}
\usepackage{hyperref}
\usepackage{arsclassica}

When we apply this to the MWE we get correctly hyperlinked footnotes (as of today 2021/01/04). I didn't use an external file book_structure.tex but simply included the code in the preamble and re-ordered:

\documentclass[11pt, a4paper, oneside, headinclude,footinclude]{book}

\usepackage[T1, T2A]{fontenc} 
\usepackage[english, russian]{babel}

\usepackage[margin = 1.5cm]{geometry} 
\usepackage{setspace} % making 1.5 line spacing 
\onehalfspacing

\usepackage{scrextend}
\usepackage[hyperfootnotes]{hyperref}
\usepackage{arsclassica}
\usepackage{amsfonts}
\renewcommand*\rmdefault{iwona} 

\newcommand*{\titleTH}{%
  \begingroup
    \raggedleft 
    \vspace*{\baselineskip} 
    {\LARGE\bfseries Some book title}\\[\baselineskip]
    {\Large Version x.x.x}\par
  \endgroup
}

\begin{document}

\titleTH
\thispagestyle{empty}
\newpage

\chapter{System requirements}

\textbf{Supported operating systems:} Unix OS family (e.g. Mac OS X, Linux,
FreeBSD) and Microsoft Windows OS family (e.g. 2000, 2003, XP, Vista, Seven,
8/8.1, 10).

\textbf{CPU architectures:} x86 (x86-32, x86-64), ARMv7.

\textbf{CPU model:}\footnote{see our white paper on selection of hardware for
  LPR} selected individually (in accordance to number of recognition threads
to be used on the server, video framerate and resolution). When adding one or
more recognition threads, CPU load increases linearly.

\end{document}

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.