沒有 footmisc 的樣式註腳(超引用衝突)

沒有 footmisc 的樣式註腳(超引用衝突)

我已經獲得了包含此程式碼的範本和sty文檔,它提供了比預設值更好的腳註佈局:

\usepackage[hang, flushmargin,splitrule,multiple]{footmisc}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@makefntext}{
    \ifFN@hangfoot
    \bgroup
    }{
    \ifFN@hangfoot
    \bgroup\def\@makefnmark{
        \rlap{\normalfont\@thefnmark.}
    }
}{}{}
\patchcmd{\@makefntext}{
    \ifdim\footnotemargin>\z@
    \hb@xt@ \footnotemargin{\hss\@makefnmark}
    }{
    \ifdim\footnotemargin>\z@
    \hb@xt@ \footnotemargin{\@makefnmark\hss}
}{}{}
\makeatother
\setlength{\footnotemargin}{1.25em} % Between marker and text
\setlength{\skip\footins}{1\baselineskip} % Between main text and note rule
\setlength{\footnotesep}{\skip\footins} % Between footnotes [= previous]
\renewcommand{\hangfootparskip}{0pt}
\renewcommand{\hangfootparindent}{1em}

但是,使用footmiscBreaks†hyperref對內聯腳註標記的支援。

MWE - 取消註釋comment環境以查看所需的腳註佈局樣式,對其進行註釋以查看預設的腳註工作連結:

\documentclass{article}

\usepackage{verbatim} % to allow commenting code section

% hyperref options as per my uni's thesis class
\usepackage[pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true,
bookmarksopenlevel=0,bookmarksnumbered=true,hypertexnames=true, plainpages=false,
colorlinks,linkcolor={blue},citecolor={green},urlcolor={red},
pdfstartview={FitV},unicode,breaklinks=true,pdfpagelabels]{hyperref}

%\begin{comment}
\usepackage[hang, flushmargin,splitrule,multiple]{footmisc}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@makefntext}{
    \ifFN@hangfoot
    \bgroup
}{
    \ifFN@hangfoot
    \bgroup\def\@makefnmark{
        \rlap{\normalfont\@thefnmark.}
    }
}{}{}
\patchcmd{\@makefntext}{
    \ifdim\footnotemargin>\z@
    \hb@xt@ \footnotemargin{\hss\@makefnmark}
}{
    \ifdim\footnotemargin>\z@
    \hb@xt@ \footnotemargin{\@makefnmark\hss}
}{}{}
\makeatother
\setlength{\footnotemargin}{1.25em} % Between marker and text
\setlength{\skip\footins}{1\baselineskip} % Between main text and note rule
\setlength{\footnotesep}{\skip\footins} % Between footnotes [= previous]
\renewcommand{\hangfootparskip}{0pt}
\renewcommand{\hangfootparindent}{1em}
%\end{comment}

\begin{document}
Lorem ipsum dolor\footnote{A note} sit amet, consectetur adipiscing elit. Nam posuere risus\footnote{Another note} risus, et lobortis nunc egestas eu.
\end{document}

有沒有一種方法可以實現更好的腳註佈局,而不使用footmisc或添加任何其他破壞超文本功能的東西?

確實有一種方法可以為腳註提供返回其內聯錨點的連結。

因此,期待有一天我們停止使用傳統(紙本)格式的數位原生文件。當寫超文本時尤其具有諷刺意味。在那之前,LaTeX 就是這樣。

† FWIW,etoolbox似乎在其他地方使用(我沒有寫類別程式碼!),但不會破壞 hyperref 的超文本。

答案1

給 hyperref 一個機會:稍後加載它,以便它可以注入其程式碼:

\documentclass{article}

\usepackage{verbatim} % to allow commenting code section

%\begin{comment}
\usepackage[hang, flushmargin,splitrule,multiple]{footmisc}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@makefntext}{
    \ifFN@hangfoot
    \bgroup
}{
    \ifFN@hangfoot
    \bgroup\def\@makefnmark{
        \rlap{\normalfont\@thefnmark.}
    }
}{}{}
\patchcmd{\@makefntext}{
    \ifdim\footnotemargin>\z@
    \hb@xt@ \footnotemargin{\hss\@makefnmark}
}{
    \ifdim\footnotemargin>\z@
    \hb@xt@ \footnotemargin{\@makefnmark\hss}
}{}{}
\makeatother
\setlength{\footnotemargin}{1.25em} % Between marker and text
\setlength{\skip\footins}{1\baselineskip} % Between main text and note rule
\setlength{\footnotesep}{\skip\footins} % Between footnotes [= previous]
\renewcommand{\hangfootparskip}{0pt}
\renewcommand{\hangfootparindent}{1em}
%\end{comment}
% hyperref options as per my uni's thesis class
\usepackage[pdfpagemode={UseOutlines},bookmarks=true,bookmarksopen=true,
bookmarksopenlevel=0,bookmarksnumbered=true,hypertexnames=true, plainpages=false,
colorlinks,linkcolor={blue},citecolor={green},urlcolor={red},
pdfstartview={FitV},unicode,breaklinks=true,pdfpagelabels]{hyperref}


\begin{document}
Lorem ipsum dolor\footnote{A note} sit amet, consectetur adipiscing elit. Nam posuere risus\footnote{Another note} risus, et lobortis nunc egestas eu.
\end{document}

相關內容