natbib
我在使用 LaTeX ++的下划线时遇到了问题footnotebackref
。
这是我的 MWE:
\documentclass[a4paper,12pt]{report}
\usepackage{footnotebackref} %%%
\usepackage{natbib}
\bibliographystyle{abbrvnat}
\hypersetup{colorlinks=true, breaklinks=true, urlcolor= blue, linkcolor= blue, citecolor=blue, } %%%
\begin{document}
hello \citep{Potter1994}
\bibliography{library}
\end{document}
和 bib 文件:
@article{Potter1994,
abstract = {deleted for short},
author = {Potter, Ma and Jong, Ka De},
doi = {10.1007/3-540-58484-6{\_}269},
file = {:home/me/ppsn94.pdf:pdf},
isbn = {3-540-58484-6},
journal = {Parallel Problem Solving from Nature},
pages = {249 -- 257},
title = {{A cooperative coevolutionary approach to function optimization}},
url = {http://link.springer.com/chapter/10.1007/3-540-58484-6{\_}269},
year = {1994}
}
当我删除标有的两行时,它可以正常工作,%%%
但我想保留颜色链接、URL 和引用。
有什么解决办法吗?谢谢
答案1
最后我发现这里有两个很大的误解。
\hypersetup
首先,您使用了未加载包的命令。在(控制台/终端上)hyperref
的文档中,您可以阅读用于设置包选项的命令。hyperref
texdoc hyperref
\hypersetup
hyperref
第二个是,url
在您的 bib 文件中使用字段并加载hyperref
(隐式加载包url
),您不必用 屏蔽下划线\
。
请尝试以下 MWE:
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{Potter1994,
abstract = {deleted for short},
author = {Potter, Ma and Jong, Ka De},
doi = {10.1007/3-540-58484-6_269},
file = {:home/me/ppsn94.pdf:pdf},
isbn = {3-540-58484-6},
journal = {Parallel Problem Solving from Nature},
pages = {249--257},
title = {{A cooperative coevolutionary approach to function optimization}},
url = {http://link.springer.com/chapter/10.1007/3-540-58484-6_269},
year = {1994},
}
\end{filecontents*}
\documentclass[a4paper,12pt]{report}
\usepackage{xcolor}
%\usepackage{footnotebackref} %%%
\usepackage{natbib}
\bibliographystyle{abbrvnat}
\usepackage{hyperref}
\hypersetup{%
colorlinks=true,
breaklinks=true,
urlcolor=blue,
linkcolor=blue,
citecolor=blue,
} %%%
\begin{document}
hello \citep{Potter1994}
\bibliography{\jobname}
\end{document}
并查看结果: