I am using Biber for my literature. Usually the URL should be printed out but some entries have "ugly" URLs like "http://dx.doi.org/…" etc. Is it possible to not print the URL if the URL field contains a specific string? I don't want to clean my bib file because maybe I want to use all URLs later.
I have tried the advice from karlkoeller, but it still doesn't work. Why the following code doesn't work?
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=url,
match=\regexp{dx.doi.org|dl.acm.org(.+)}, null=true
]
}
}
}
Best Answer
The solution for you is to use
biblatex
andbiber
'ssourcemap
features.Add the following code snippet to your preamble.
You can extend the list of URLs to be deleted by specifying the URL in
match=\regexp{http://(dx.doi.org/|dl.acm.org/)}
. To filterexample.com
, make the linematch=\regexp{http://(dx.doi.org/|dl.acm.org/|example.com)}
, though you should probably usematch=\regexp{http://(www.)?(dx.doi.org/|dl.acm.org/|example.com)}
to also catchwww.example.com
.biber
uses Perl's Regular Expressions, you can read more about them here.If
biber
finds a match, theurl
andurldate
are purged, otherwise nothing happens.The MWE
yields
Edit
biber
's features enable us to implement a more sophisticated handling of those URLs.The following MWE will map DOIs, stable JSTOR identifiers and arXiv links to the appropriate
doi
oreprintfields
. If you do not want to have those displayed, just adddoi=false
andeprint=false
tobiblatex
's options.