將引用轉換為 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

我希望有一種更聰明/標準的方法來做我想做的事情,因為我使用的巨集是我在網路上找到的,並且並不真正了解如何工作(現在似乎不再工作)。

相關內容