当 \bibitem 包含带有“%”字符的 \href 时,backref(hyperref)中止

当 \bibitem 包含带有“%”字符的 \href 时,backref(hyperref)中止

使用 hyperref 和 bibentry 时如何处理 url 中的 % 符号 提供使用 hyperref 和 bibentry 时处理 url 中 % 符号的修复程序

基本呼叫

[\usepackage[backref=page]{hyperref}]

当 bibitem 调用包含“%”字符的超链接时,建议的修复方法和方法均不起作用。这在 NASA ADS/arXiv 的参考书目中很常见。

示例如下:

\documentclass{article}
\usepackage{natbib}
\usepackage[backref=page]{hyperref}

\begin{document}

This is a well-behaved citation: \citet{2004ApJ...613L.153A}

This is a problematic citation with \%26 in the url: \cite{2013A&A...553A..49A}. It fails when [backref=page] is invoked, also with the fix previously suggested under questions/141247.

\begin{thebibliography}{2}
\bibitem[\protect\astroncite{{Alonso} et~al.}{2004}]{2004ApJ...613L.153A}
\href{http://esoads.eso.org/abs/2004ApJ...613L.153A}{
{Alonso} R, {Brown} TM, {Torres} G, et~al., 2004, Title2. 
{APJL}, 613, L153--L156}

\bibitem[\protect\astroncite{{Abe} et~al.}{2013}]{2013A&A...553A..49A}
\href{http://esoads.eso.org/abs/2013A%26A...553A..49A}{
{Abe} L, {Gon{\c c}alves} I, {Agabi} A, et~al., 2013, Title1.
{AAP}, 553, A49}

\end{thebibliography}
\end{document}

相关内容