我希望我的参考书目中的后继引用包含一些自定义格式。
我当前的代码是:
\documentclass{article}
\usepackage[english]{babel}
\usepackage{natbib}
\usepackage[backref=page]{hyperref}
\usepackage{filecontents}
\begin{filecontents*}{jobname.bib}
@book{joe,
author = {Smith, Joe},
year = {2017},
title = {Automotive Safety Handbook},
}
\end{filecontents*}
\begin{document}
"Hello, my name is Joe!", said Joe \citep{joe}.
\bibliographystyle{apalike}
\bibliography{jobname}
\end{document}
生成结果:
我想要的是:“ (see page 1)
“或者对于单个 bibitem 的多个引用,我想要“ (see pages 1, 2)
“。
我已经在 stackexchange 上找到了一些建议的解决方案,但它们似乎仅适用于 biblatex。
答案1
您可以重新定义钩子\backrefalt
:
\documentclass{article}
\usepackage[english]{babel}
\usepackage{natbib}
\usepackage[backref=page]{hyperref}
\renewcommand\backreftwosep{, }
\renewcommand\backrefsep{, }
\renewcommand*{\backrefalt}[4]{%
\ifcase #1%
\or (see page:~#2)%
\else (see pages:~#2)%
\fi%
}
\usepackage{filecontents}
\begin{filecontents*}{jobname.bib}
@book{joe,
author = {Smith, Joe},
year = {2017},
title = {Automotive Safety Handbook},
}
@book{alice,
author = {Smith, alice},
year = {2017},
title = {Automotive Safety Handbook},
}
\end{filecontents*}
\begin{document}
"Hello, my name is Joe!", said Joe \citep{joe}.
\citep{alice} \newpage \cite{alice}
\bibliographystyle{apalike}
\bibliography{jobname}
\end{document}