当我将包backref
中的选项hyperref
与apacite
选项一起使用时natbibapa
,反向引用会出现在换行符上。如何防止这种情况发生?
以下是 MWE:
\documentclass{book}
\usepackage[natbibapa]{apacite}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {FirstAuthor, A.},
year = {2001},
title = {Alpha Title}
}
@misc{A02,
author = {SecondAuthor, A.},
year = {2001},
title = {Beta Title},
}
\end{filecontents}
\usepackage[backref=page]{hyperref}
\begin{document}
\chapter{One}
\citet{A01} ;\citet{A02}
\bibliographystyle{apacite}
\bibliography{\jobname}
\end{document}
更新
apacite
放置在文件\PrintBackRefs{\CurrentBib}
中的每个条目之后.bbl
。如果我删除所有实例\PrintBackRefs{\CurrentBib}
(然后通过 pdflatex 重新编译文件),则多余的行将被删除。此解决方法是一种解决方案,但如果我重新定义或 (我不确定是什么导致了换行),.tex
效果可能会更好。\PrintBackRefs
\CurrentBib
答案1
我不确定为什么,但这有帮助:
\AtBeginDocument{%
\renewcommand*{\PrintBackRefs}[1]{}%
}
如果你想删除后面引用前面的多余空格,你可以使用
\AtBeginDocument{%
\renewcommand*{\PrintBackRefs}[1]{\unskip}%
}
最后但同样重要的是,如果你想将后面的引用括在方括号中,请添加
% Enclose the back references in the bibliography in square brackets
% (Econometrica style):
\let \backreforig \backref
\renewcommand*{\backref}[1]{[\backreforig{#1}]}
这是一个完整的可编译示例:
% !TeX program = pdflatex
% !BIB program = bibtex
\documentclass{book}
\usepackage[natbibapa]{apacite}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {FirstAuthor, A.},
year = {2001},
title = {Alpha Title}
}
@misc{A02,
author = {SecondAuthor, A.},
year = {2001},
title = {Beta Title},
}
\end{filecontents}
\usepackage[backref=page, colorlinks]{hyperref}
% Enclose the back references in the bibliography in square brackets
% (Econometrica style):
\let \backreforig \backref
\renewcommand*{\backref}[1]{[\backreforig{#1}]}
\AtBeginDocument{%
\renewcommand*{\PrintBackRefs}[1]{\unskip}%
}
\begin{document}
\chapter{One}
\citet{A01}; \citet{A02}
\bibliographystyle{apacite}
\bibliography{\jobname}
\end{document}