One possibility is to extend Herbert's bibmacro to several nested conditions. (The following example contains only placeholder links for the ISBN/ISSN fields because I don't know how this links must be formatted.)
With regard to your further issues:
I'm not sure if the url
field allows to specify several URLs separated by white spaces; if it does, I don't know how to retain only the first URL.
Herbert's code actually first covers all entry types, then specifies a special title format (quotes instead of emphasis) for articles.
\documentclass{article}
\usepackage[doi=false,url=false,isbn=false]{biblatex}
\usepackage[colorlinks]{hyperref}
\newbibmacro{string+doiurlisbn}[1]{%
\iffieldundef{doi}{%
\iffieldundef{url}{%
\iffieldundef{isbn}{%
\iffieldundef{issn}{%
#1%
}{%
\href{http://books.google.com/books?vid=ISSN\thefield{issn}}{#1}%
}%
}{%
\href{http://books.google.com/books?vid=ISBN\thefield{isbn}}{#1}%
}%
}{%
\href{\thefield{url}}{#1}%
}%
}{%
\href{http://dx.doi.org/\thefield{doi}}{#1}%
}%
}
\DeclareFieldFormat{title}{\usebibmacro{string+doiurlisbn}{\mkbibemph{#1}}}
\DeclareFieldFormat[article,incollection]{title}%
{\usebibmacro{string+doiurlisbn}{\mkbibquote{#1}}}
\begin{filecontents}{\jobname.bib}
@article{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
doi = {doi},
url = {url},
issn = {isbn-issn},
}
@book{B02,
author = {Buthor, B.},
year = {2002},
title = {Bravo},
url = {http://tex.stackexchange.com/},
isbn = {isbn-issn},
}
@incollection{C03,
author = {Cuthor, C.},
year = {2003},
title = {Charlie},
isbn = {9780521867016},
}
@misc{D04,
author = {Duthor, D.},
year = {2004},
title = {Delta},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\nocite{*}
\begin{document}
\printbibliography
\end{document}
If biber
is used as backend, then one can use the \DeclareSourcemap
facilities to change fields.
For the case at hand a solution is to remap url
entries with dx.doi.org
as initial part using the following code:
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[ % copies url to doi field if it starts with http://dx.doi.org/
fieldsource=url,
match=\regexp{http://dx.doi.org/(.+)},
fieldtarget=doi,
]
\step[ % removes http://dx.doi.org/ string from doi field
fieldsource=doi,
match=\regexp{http://dx.doi.org/(.+)},
replace=\regexp{$1}
]
}
\map{ % removes url + urldate field from all entries that have a doi field
\step[fieldsource=doi, final]
\step[fieldset=url, null]
\step[fieldset=urldate, null]
}
}
}
The actual value inside \regexp
can be adjusted.
In the first step we create a doi
field for each entry where the url
field matches the regexp, and the novel field has the value of the url
field. In the second step we remove the doi "namespace".
In the second \map
sequence the url and urldate fields are cleared if a doi field is present, to mimic the behavior in the first part of the original question.
Best Answer
Remove
series=false
from the options when loadingbiblatex
and write this in the preamble:This suppresses that field for all types of entries.
If you want to remove it only for a particular type of entries, let's say
article
, writeinstead.
Remark 1. You have to switch to
biber
if you want to be able to use the code. Manybiblatex
features are unsupported if you usebibtex
as a backend...Remark 2. The option
<field>=true/false
is available only for the following fields:isbn
,url
,doi
,eprint
.EDIT
As a workaround, when using
bibtex
as a backend, adding the following line to the preambleshould be the right trick.