脚注链接总是跳转到标题页

脚注链接总是跳转到标题页

我遇到了一个小问题:脚注超链接不会引导我到当前页面的脚注,但它会跳转到文档标题页。

我已经考虑并测试了几种可能的解决方案(从脚注标记到脚注正文的超链接使用 setspace 包会破坏脚注链接), 但:

  • 在“hyperref”之前包含“setspace”包没有效果;
  • 禁用“hyperref”超脚注选项(在对‘hyperref’的原始调用中)导致选项冲突。

我使用的是 pdflatex 编译器。以下是简化的代码片段:

% 主.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}

%书籍结构.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
        }

如果不修复这个错误,我只要关闭脚注超链接就满足了,但是,如上所述,出了点问题。提前为一个必定微不足道的主题道歉,我仍然是 LaTeX 新手。

有人有什么考虑吗?

答案1

与我的回答类似为什么我的所有脚注都超链接到标题页?这是包加载顺序的问题。(有人可能会认为这是重复的。)这setspace是你的坏孩子……你需要注意的是arsclassica加载classicthesis加载hyperref。这意味着你需要setspace在之前加载arsclassica

但是,至少现在两者都尝试使用该选项加载arsclassica,这使得重现 MWE 变得很棘手。我们还需要先加载才能再次激活它们。classicthesishyperrefhyperfootnotes=falsehyperrefarsclassica

classicthesis也会加载,footmisc但与 不太兼容hyperref。正如我在链接的答案中看到的那样,它hyperref也必须在 之前加载。这意味着我们需要这个加载顺序:

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

如果发现命令,则实际上classicthesis不会加载。后者是 KOMA-Script 命令,可在 KOMA-Script 类中使用。的维护者似乎没有意识到,也可以加载包。因此,让我们交换和以更安全的方式:footmisc\deffootnoteclassicthesisscrextend\deffootnotefootmiscscrextend

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

当我们将其应用于 MWE 时,我们会得到正确的超链接脚注(截至今天 2021/01/04)。我没有使用外部文件book_structure.tex,只是将代码包含在序言中并重新排序:

\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}

相关内容