将引用转换为 url-doi 链接

将引用转换为 url-doi 链接

我正在尝试更新我的简历,但我通常使用的脚本不再起作用了。

我的简历基于 awesome-CV 模板,并使用 awesome cls。但是,与标准类不同的是,我希望将参考资料作为论文的超链接,为此,我使用了类似这样的 MWE:

\documentclass[11pt, a4paper]{awesome-cv}
\definecolor{darkblue}{rgb}{0.0,0.0,0.3}
\hypersetup{colorlinks,linkcolor=darkblue,urlcolor=darkblue}
\geometry{left=1.4cm, top=.8cm, right=1.4cm, bottom=1.8cm, footskip=.5cm}
\fontdir[fonts/]

\newbibmacro{string+doiurl}[1]{%
  \iffieldundef{doi}
    {\iffieldundef{url}
       {#1}
       {\href{\thefield{url}}{#1}}}
    {\href{https://doi.org/\thefield{doi}}{#1}}}

\makeatletter
\def\blx@driver#1{%
  \ifcsdef{blx@bbx@#1}
    {\usebibmacro{string+doiurl}{\csuse{blx@bbx@#1}}}
    {\ifcsdef{blx@bbx@*}
       {\blx@warning{%
          No driver for entry type '#1'.\MessageBreak
          Using fallback driver}%
        \usebibmacro{string+doiurl}{\csuse{blx@bbx@*}}}
       {\blx@error
          {No driver found}
          {I can't find a driver for the entry type
           '\abx@field@entrytype'\MessageBreak
           and there is no fallback driver either}}}}
\makeatother

\begin{filecontents}{references.bib}
@article{test,
title = {Book's title},
author = {Author, Some},
location = {The City},
publisher = {Publisher},
date = {2005},
}
\end{filecontents}

\addbibresource{references.bib}

%-------------------------------------------------------------------------------
\begin{document}

\begin{refsection}
    \nocite{test}
    \printbibliography[title={Journal Articles},
    heading=subbibliography]
\end{refsection}


%-------------------------------------------------------------------------------
\end{document}

然而,问题是这不再起作用,相反我收到错误:

(pdf backend): \pdfextension endlink cannot be used in vertical mode

我希望有一种更智能/标准的方式来做我想做的事情,因为我使用的宏是我在网上找到的,但我并不真正了解它是如何工作的(现在似乎不再起作用了)。

相关内容