
我目前正在使用 Latex 和 Biber 製作一本電子書。我用於腳註的包是包biblatex-chicago
。
我可以成功連結到段落中的腳註,但我希望能夠點擊實際腳註並返回到原始位置,建立反向引用。我已經查看了一些與類似主題相關的其他帖子,但似乎沒有一個與biblatex-chicago
我用來\autocite
創建腳註的包一起使用。
微量元素
\documentclass[10pt, letterpaper]{book}
\usepackage{palatino}
\usepackage[notes,backend=biber]{biblatex-chicago}
\addbibresource{mweBib.bib}
\usepackage{footnotebackref}
\usepackage{tocloft}
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}
\date{} \let\cleardoublepage\clearpage
\usepackage{hyperref}
\usepackage{color}
\hypersetup{colorlinks=true, linkcolor=blue, linktoc=all}
\begin{document}
This is a test for footnotebackref.\autocite[100]{test}
\printbibliography
\end{document}
我希望我已經清楚地說明了我的問題。任何幫助是極大的讚賞!
答案1
這確實要biblatex-chicago
歸功於footnotebackref
包裹不起作用。在 中biblatex-chicago.sty
,我們發現
\renewcommand\@makefntext[1]{% Provides in-line footnote marks
\setlength\parindent{1em}%
\noindent
\makebox[2.3em][r]{\@thefnmark.\,\,}#1}
每當我們載入非memoir
文檔類別時就會執行此操作。不幸的是,footnotebackref
無法修改這個宏,所以我們必須自己做。
下面的程式碼甚至不需要加載footnotebackref
,最重要的方面可以用幾行程式碼來實現(摘自footnotebackref
包裹/霍勒的回答註腳反向引用與 hyperref詳細地)
\newcounter{BackrefHyperFootnoteCounter}
\makeatletter
\pretocmd{\footnote}
{\refstepcounter{BackrefHyperFootnoteCounter}%
\edef\BackrefFootnoteTag{bhfn:\theBackrefHyperFootnoteCounter}%
\label{\BackrefFootnoteTag}}
{}{}
\renewcommand\@makefntext[1]{% Provides in-line footnote marks
\setlength\parindent{1em}%
\noindent
\makebox[2.3em][r]{\hyperref[\BackrefFootnoteTag]{\@thefnmark}.\,\,}#1}
\makeatother
在最後幾行中,我們修改biblatex-chicago
的巨集以包含腳註的連結。
微量元素
\documentclass[10pt, letterpaper]{book}
\usepackage{palatino}
\usepackage[notes,backend=biber]{biblatex-chicago}
\usepackage{hyperref}
\addbibresource{biblatex-examples.bib}
\newcounter{BackrefHyperFootnoteCounter}
\makeatletter
\pretocmd{\footnote}
{\refstepcounter{BackrefHyperFootnoteCounter}%
\edef\BackrefFootnoteTag{bhfn:\theBackrefHyperFootnoteCounter}%
\label{\BackrefFootnoteTag}}
{}{}
\renewcommand\@makefntext[1]{% Provides in-line footnote marks
\setlength\parindent{1em}%
\noindent
\makebox[2.3em][r]{\hyperref[\BackrefFootnoteTag]{\@thefnmark}.\,\,}#1}
\makeatother
\begin{document}
This is a test for footnotebackref.\autocite[100]{wilde}
\printbibliography
\end{document}