3

I'm trying to cite an eprint with biblatex. Back in my BibTeX days, I used @misc for that, but with biblatex's additional entry types it appears that @online is better suited for this purpose.

In addition, I use the hyperref package to insert links in my document at various places, including links to online documents in my bibliography, such as this eprint.

Back in my BibTeX days I would have used this:

@misc{foo,
  author       = {David Pointcheval and Olivier Sanders},
  title        = {Short Randomizable Signatures},
  year         = {2015},
  month        = jun,
  howpublished = {Cryptology ePrint Archive, Report 2015/525},
  note         = {\url{http://eprint.iacr.org/2015/525}},
}

Now with biblatex, I tried to improve this like so:

@online{foo,
  author     = {David Pointcheval and Olivier Sanders},
  title      = {Short Randomizable Signatures},
  year       = 2015,
  month      = jun,
  eprinttype = {Cryptology ePrint Archive},
  eprint     = {2015/525},
  url        = {https://eprint.iacr.org/2015/525}
}

enter image description here

The problem is that there are now two hyperlinks. The first stems from the eprint field (2012/525) and the second from the url field (https://eprint.iacr.org/2012/185). The second one works perfectly fine and looks as intended, but the first one appears to link to the local file 2012/525 relative to the directory which contains the PDF itself, which is of course nonsense. Such a file does not exist and accordingly I get an error message when I try to click on the link.

How can I remove this dead link? As a side question, what is the original intent of hyperlinking the eprint field to a local file? I cannot see any practical use for this.

Minimal working example:

\documentclass{article}

\usepackage[backend=biber]{biblatex}
\usepackage{hyperref}

\begin{filecontents}{\jobname.bib}
@online{foo,
  author     = {David Pointcheval and Olivier Sanders},
  title      = {Short Randomizable Signatures},
  year       = 2015,
  month      = jun,
  eprinttype = {Cryptology ePrint Archive},
  eprint     = {2015/525},
  url        = {https://eprint.iacr.org/2015/525}
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
\cite{foo}

\printbibliography
\end{document}
  • to your side question: it merely interprets the eprint field as an url and your system assumes from the form of the link that it is a relative link to a local file. I'm assuming you do not want the obvious solution (i.e. putting the url into the eprint field and changing eprinttype to "Cryptology .... (2015/525)" or sth like that)? – Bort Oct 4 '16 at 12:10
3

The idea of the eprint field is that it provides the unique part of some electronic reference, with the type supplying the 'setup'. In a case where the type is unknown, bibaltex assumes the epint ID contains the full URL, so simply makes it into a hyperlink. The hyperref package interprets links lacking http or similar as local ones, hence the outcome you see.

What you need to do is tell biblatex about the eprint type. I'd give it a one-word name, for example

\documentclass{article}

\usepackage[backend=biber]{biblatex}
\DeclareFieldFormat{eprint:iacr}{%
  \href{https://eprint.iacr.org/#1}{Cryptology ePrint Archive: #1}%
}
\usepackage{hyperref}

\begin{filecontents}{\jobname.bib}
@online{foo,
  author     = {David Pointcheval and Olivier Sanders},
  title      = {Short Randomizable Signatures},
  year       = 2015,
  month      = jun,
  eprinttype = {iacr},
  eprint     = {2015/525},
  url        = {https://eprint.iacr.org/2015/525}
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
\cite{foo}

\printbibliography
\end{document}

I'd probably remove the URL field here as it's just the eprint data repeated (in the same way I'd have a DOI field not a link for a publisher article). You could though set up to clear the URL if it matches the eprint data.

  • Thanks and you're right about removing the URL field. One thing is still bugging me, though: If I do remove the URL field, then biber --validate_datamodel complains about the missing mandatory field url for @online entries. This makes me feel like although this solution does work well, it is not the intended way to cite eprints. On the other hand, the biblatex-examples.bib provided with BibLaTeX itself also contains an @online entry baez/online which lacks the url field (so, even citing directly from biblatex-examples.bib produces this warning!) Not so mandatory after all? – Malte Skoruppa Oct 4 '16 at 15:15
  • @MalteSkoruppa My understanding of the data model is that an article which is online-only goes down as @article not @online: the latter is for things like websites. – Joseph Wright Oct 4 '16 at 15:45
  • I thought about this possibility too, but the problem is that @article in turn requires a journaltitle which does not make sense in this context (because it is an online database of papers, not a journal). So then, biber will complain about a missing journal title instead of a missing URL... Funny. This answer cites a few examples from biblatex-examples.bib to cite arXiv eprints using both @article and @online, but a journal title is not applicable in my case and the url field is missing from those examples too. – Malte Skoruppa Oct 4 '16 at 16:02
  • Well, I guess that @online and @article can both be used for eprints (depending on the situation), and that the url field for @online is in fact circumstancially not necessary. In that sense, biber --validate_datamodel is perhaps too strict here. This is also what @Audrey said in the answer mentioned in my previous comment: "arXiv articles can be entered as article or online types. (...) The url field is unnecessary as standard styles generate a link to the article from its identifiers." That makes sense, although the warning is slightly annoying, but I guess I can live with it. ;) – Malte Skoruppa Oct 4 '16 at 20:22

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.