2

This is kind of a combination of two questions and then I have a bibliography style problem on top of that.

I would like to make each bib entry into a hyperlink with the priority: 1. DOI, 2. URL, 3. ISBN/ISNN. It has earlier been shown how this is done for the title of the entries in biblatex: make title hyperlink to DOIs, URL or ISBN. However, I am using a bibliography style which does not show titles (chem-angew). I would like the entire entry to become a hyperlink. This has been done only with DOI in Hyperlink each bib entry to its DOI page.

My first problem is, when I use the chem-angew style and I include an entry with a DOI, the DOI shows, even though I include DOI=false in the usepackage (and the DOI is not supposed to show up in the chem-angew style):

\documentclass{article}
\usepackage[style=chem-angew,doi=false,url=false,isbn=false,]{biblatex}
\usepackage[colorlinks]{hyperref}

\begin{filecontents}{\jobname.bib}
@article{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
doi = {doi},
url = {url},
issn = {isbn-issn},
}
\end{filecontents}

\addbibresource{\jobname.bib}
\nocite{*}

\begin{document}
\printbibliography
\end{document}

enter image description here

My second problem is, when I add:

\AtEveryBibitem{%
  \iffieldundef{url}
    {}
    {\href{\thefield{url}}{\usedriver{\thefield{article}}}
    \csdef{blx@bbx@\thefield{entrytype}}{}}%
}

to my local biblatex.cfg file, the bib entry will have the biblatex style and not the chem-angew style as asked for in the same way as my earlier MWE.

enter image description here

The final problem is the priority of the hyperlink which I would like to add to the entries.

3

Here is one solution that tries to link the entire entry (minus the label). string+doiurl is a simplified version of lockstep's string+doiurlisbn from biblatex: make title hyperlink to DOIs, URL or ISBN

\documentclass{article}
\usepackage[style=chem-angew,doi=false,url=false,isbn=false,]{biblatex}
\usepackage[colorlinks]{hyperref}

\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

\addbibresource{biblatex-examples.bib}
\nocite{sigfridsson,ctan,nussbaum}

\begin{document}
\printbibliography
\end{document}

Screenshot of the bibliography in the MWE: The first two entries are linked to DOI and URL, respectively. The last entry is not linked as it misses both a <code>doi</code> and <code>url</code> field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.