I'm in the process of writing a biblatex
style file to support the on-line journal Theory of Computing. The journal has been using BibTeX for years, and I am looking forward to the flexibility biblatex
offers.
The difficulty: Our bibliographic entries typically need to refer to multiple dois, urls, or eprint entries. (Why? We often link to "preliminary" versions of an article, typically a conference article or an arXiv preprint.) My first question is a bit of a meta-question: what's the nicest approach?
Two approaches come to mind; I don't have enough experience with biblatex
to decide which one to pursue.
Approach 1
Arrange for biblatex to "natively" handle multiple dois, urls, eprints, etc. Specifically, it would be nice to permit a record to have several fields of the form
doi = {first-doi},
doi = {second-doi},
...
and
url = {first-url},
url = {second-url},
...
The idea would be that each of these produces its own output: DOI: first-doi, DOI: second-doi, etc. Is this within easy reach?
Of course, the idea of processing multiple eprint entries seems problematic, since an eprint
field is typically coupled with other "helper" fields such as eprinttype
. (Incidentally, supporting two eprint fields seems like something that one might wish to do in many other natural circumstances, such as where a paper has both a MathSciNet entry and a DOI).
Approach 2
Given the problem with even parsing multiple eprint fields, another possibility would be to add a number of new fields:
prelim-doi
prelim-eprint
prelim-url
prelim-manuscript
These are to be printed right after the regular doi
, eprint
, and url
entries (for a journal, say). Specifically, I would like output along the lines of:
Preliminary versions: DOI: ..., eprint: ..., URL: ..., Manuscript: ... .
Handling of DOI, eprint, and URL should be just like the corresponding "regular" fields (in particular, I would like prelim-eprint
to inherit the same eprint handlers that exist for eprint
). Manuscript should be handled just like eprint
as well (again with the same handlers). (If you are wondering why we need both prelim-eprint
and prelim-manuscript
, this is because we often need to cite both a preliminary conference version, using eprint, and also a preliminary arXiv version.)
My first attempt (for approach 2)
To get my feet wet, I tried the following (in a .bbx
file):
\DeclareFieldFormat{prelim-doi}{%
\mkbibacro{DOI}\addcolon\space
\ifhyperref
{\href{http://dx.doi.org/#1}{\nolinkurl{#1}}}
{\nolinkurl{#1}}}
\newbibmacro*{prelim-doi+eprint+manuscript+url}{%
\iftoggle{bbx:doi}
{\printfield{prelim-doi}}
{}}
\renewbibmacro*{doi+eprint+url}{%
\iftoggle{bbx:doi}
{\printfield{doi}}
{}%
\newunit\newblock
\iftoggle{bbx:eprint}
{\usebibmacro{eprint}}
{}%
\newunit\newblock
\iftoggle{bbx:url}
{\usebibmacro{url+urldate}}
{}%
\iftoggle{bbx:preliminary}
{\usebibmacro{prelim-doi+eprint+manuscript+url}}
{}}
This uses a toggle called bbx:preliminary
and was just intended to handle printing preliminary dois (to get started). However, it never seems to print anything (even for a record with a prelim-doi
field). Is there something fancy I need to do to tell biblatex
about the new fields? (Incidentally, this little .bbx
file is essentially just loaded over Marco Daniel's trad-plain style (see How to emulate the traditional BibTeX styles (plain, abbrv, unsrt, alpha) as closely as possible with biblatex?), since our traditional bibliography style is not far from BibTeX's plain
style.)
prelim-doi
, and the it ignores it. See the solution by PLK to the question tex.stackexchange.com/q/76275/16895 for how to modify the data model. You have to define a new entry type (in your caseprelim-doi
). Also, for approach 1 you can change the data model for the field and define them as lists, and parse them as lists.eprint
the parsing could be done by checking whether the value is a fullURL
(check whether it starts withhttp://
orftp://
or similar, in that case you output the current value ofeprint
) otherwise you useeprintype
to add the appropriate prefix.eprinttype
information directly in theeprint
string? I couldn't find a mention of this in the biblatex manual--could you explain how this convention works?