我使用 Beamer 用 .bib 文件写了一些教学笔记。根据一些线索 约瑟夫赖特 和用户36296,我在我的小例子上做了一些测试如下:
\documentclass{beamer}
%\usepackage[comma,numbers,sort&compress]{natbib}
\usepackage[authoryear,round]{natbib}
%\bibliographystyle{plain}
\hypersetup{
colorlinks,
citecolor=green,
linkcolor=red,
backref=true
}
\let\oldbibitem=\bibitem
\renewcommand{\bibitem}[2][]{\label{#2}\oldbibitem[#1]{#2}}
\let\oldcite=\cite
\renewcommand\cite[1]{\hyperlink{#1}{\oldcite{#1}}}
\let\oldcitep=\citep
\renewcommand\citep[1]{\hyperlink{#1}{\oldcitep{#1}}}
\let\oldciteauthor=\citeauthor
\renewcommand\citeauthor[1]{\hyperlink{#1}{\oldciteauthor{#1}}}
\newcommand{\newblock}{}
\begin{document}
\title{Multiple reference citation: natbib + citep + hyperlink}
\frame{ \titlepage }
\begin{frame}{only}
\only<1>{\begin{block}{block 1}
\citep{hastie2009elements}
\end{block}}
\only<2>{\begin{block}{block 2}
\citep{hastie2009elements,james2013introduction}
\end{block}}
\only<3>{\begin{block}{block 3}
\citep{hastie2009elements},\citep{james2013introduction}
\end{block}}
\end{frame}
\begin{frame}%[allowframebreaks]
%\tiny
\frametitle{References}
\bibliographystyle{unsrtnat}
\bibliography{test}
\end{frame}
\end{document}
该test.bib
文件包含两个引用
@book{james2013introduction,
title={An introduction to statistical learning: with applications in R},
author={James, Gareth and Witten, Daniela and Hastie, Trevor and Tibshirani, Robert},
year={2013},
publisher={Springer},
address={New York}
}
@Book{hastie2009elements,
Title = {The elements of statistical learning: Data mining, inference, and prediction},
Author = {Hastie, Trevor and Tibshirani, Robert and Friedman, Jerome},
edition = {2},
Publisher = {Springer},
address ={New York},
Year = {2009}
}
它与指向单个引用的参考文献页面的正确超链接配合得很好(即\citep{hastie2009element}
或\citep{james2013introduction}
)。但是,单击包含多个参考文献的 PDF\citep{hastie2009elements,james2013introduction}
总是会转到标题页!有什么帮助吗?