classicthesis 包中的反向引用不起作用

classicthesis 包中的反向引用不起作用

我使用的是classicthesis4.1 版软件包。以下是我遇到的反向引用问题的示例。虽然我通过设置启用了反向引用,但结果文档的参考书目中没有反向引用:\setboolean{enable-backrefs}{true}

在此处输入图片描述

abbrvunsrtnat.bst我使用了已发布的参考书目样式在这里

\documentclass[
                openright,
                titlepage, numbers=noenddot, headinclude,%1headlines,
                footinclude=true, cleardoublepage=empty,
                BCOR=30mm, paper=letter, fontsize=11pt, % Binding correction, paper type and font size
                ngerman, american, % Languages
                ]{scrreprt}


\PassOptionsToPackage{%
                    eulerchapternumbers,
                    listings,
                    pdfspacing,
                    subfig,
                    beramono,
                    parts}{classicthesis}


\PassOptionsToPackage{square,numbers,sort&compress}{natbib}
 \usepackage{natbib}


\usepackage[position=t,singlelinecheck=off,font={it}]{subfig}

\usepackage{ifthen} % Allows the user of the \ifthenelse command
\newboolean{enable-backrefs} % Variable to enable backrefs in the bibliography
\setboolean{enable-backrefs}{true} % Variable value: true or false

% ---------------------------------------------------------------------------------------
\newcommand{\backrefnotcitedstring}{\relax} % (Not cited.)
\newcommand{\backrefcitedsinglestring}[1]{(Cited on page~#1.)}
\newcommand{\backrefcitedmultistring}[1]{(Cited on pages~#1.)}
\ifthenelse{\boolean{enable-backrefs}} % If backrefs were enabled
{
        \PassOptionsToPackage{hyperpageref}{backref}
        \usepackage{backref} % to be loaded after hyperref package 
                \renewcommand{\backreftwosep}{ and~} % separate 2 pages
                \renewcommand{\backreflastsep}{, and~} % separate last of longer list
                \renewcommand*{\backref}[1]{}  % disable standard
                \renewcommand*{\backrefalt}[4]{% detailed backref
                \ifcase #1 
                    \backrefnotcitedstring
                \or
                    \backrefcitedsinglestring{#2}
                \else
                    \backrefcitedmultistring{#2}
                \fi}
}{\relax} 

\PassOptionsToPackage{pdftex,hyperfootnotes=false,pdfpagelabels}{hyperref}
\usepackage{hyperref}  % backref linktocpage pagebackref
\pdfcompresslevel=9
\pdfadjustspacing=1

\hypersetup{
            colorlinks=true, linktocpage=true, pdfstartpage=1, pdfstartview=FitV,
            breaklinks=true, pdfpagemode=UseNone, pageanchor=true, pdfpagemode=UseOutlines,
            plainpages=false, bookmarksnumbered, bookmarksopen=true, bookmarksopenlevel=1,
            hypertexnames=true, pdfhighlight=/O, %
}   

\usepackage{classicthesis}

\begin{document}
This is test for back-referencing. \citep{knuth:1976}. 


\bibliographystyle{abbrvunsrtnat}

\bibliography{Bibliography}

\end{document}

答案1

你甚至在你的代码中有它:backref应该在之后加载hyperref,但你却以相反的方式执行。

它解决了我的问题,但就我而言,我需要\usepackage[hyperpageref]{backref}在引用包之前加载\usepackage[alf]{abntex2cite}。该包明确仅在加载包 backref 时启用反向引用:

  1. https://github.com/abntex/abntex2/blob/master/tex/latex/abntex2/abntex2cite.sty#L298-L302

相关内容