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?
Best Answer
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 thatarsclassica
loadsclassicthesis
which loadshyperref
. This means you need to loadsetspace
beforearsclassica
.However, both
arsclassica
andclassicthesis
at least nowadays try loadinghyperref
with the optionhyperfootnotes=false
which made it tricky to reproduce the MWE. We also need to loadhyperref
beforearsclassica
to get them activated again.classicthesis
also loadsfootmisc
which is not terribly compatible withhyperref
. As can be seen in my linked answer it must be loaded beforehyperref
, too. this means we need this loading order:Actually
classicthesis
does not loadfootmisc
if it finds the command\deffootnote
. The latter is a KOMA-Script command and available in KOMA-Script classes. What the maintainer ofclassicthesis
didn't seem to be aware is that one can load the packagescrextend
for\deffootnote
as well. So lets exchangefootmisc
andscrextend
to be on the safer side: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: