If you use biber
, \DeclareSourcemap
does exactly what you want. Just add this to your preamble.
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=eprinttype,match=\regexp{^[a|A][r|R][x|X][i|I][v|V]$},final]
\step[fieldset=pages,null]
}
\map{
\step[fieldsource=archivePrefix,match=\regexp{^[a|A][r|R][x|X][i|I][v|V]$},final]
\step[fieldset=pages,null]
}
}
}
This code looks through the fields archivePrefix
and eprinttype
fields (the former is actually a link to the latter) and checks if either contains just arxiv
(in any case variation), if so, the field pages
is reset.
MWE
\documentclass[ngerman, a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=ieee-alphabetic, backend=biber]{biblatex}
\addbibresource{\jobname.bib}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=eprinttype,match=\regexp{^[a|A][r|R][x|X][i|I][v|V]$},final]
\step[fieldset=pages,null]
}
\map{
\step[fieldsource=archivePrefix,match=\regexp{^[a|A][r|R][x|X][i|I][v|V]$},final]
\step[fieldset=pages,null]
}
}
}
\begin{filecontents}{\jobname.bib}
@article{KingZengHistoryGuide,
author = {Gary King and Langche Zeng},
title = {When Can History Be Our Guide?},
subtitle = {The Pitfalls of Counterfactual Inference},
journaltitle = {International Studies Quarterly},
volume = {51},
date = {2007-03},
pages = {183-210},
url = {http://gking.harvard.edu/files/abs/counterf-abs.shtml},
urldate = {2012-06-05},
gender = {pm},
}
@article{Ashtekar1997,
archivePrefix = {arXiv},
arxivId = {arXiv:gr-qc/9706069v1},
author = {Ashtekar, A and Schilling, T},
eprint = {9706069v1},
pages = {1--41},
primaryClass = {arXiv:gr-qc},
title = {{Geometrical Formulation of Quantum Mechanics}},
year = {1997}
}
@article{DBLP:journals/corr/abs-1008-2849,
author = {Jan Wassenberg and Peter Sanders},
title = {Faster Radix Sort via Virtual Memory and Write-Combining},
eprinttype = {arxiv},
eprintclass = {cs.DS},
eprint = {1008.2849},
date = {2010-09-06},
pages = {1-8},
}
\end{filecontents}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
yields
Edit
Your arXiv
links seem to be not properly formatted for biblatex
, to change this you can add the following to your preamble
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=eprinttype, match=\regexp{^[a|A][r|R][x|X][i|I][v|V]$}, final]
\step[fieldset=pages, null]
}
\map{
\step[fieldsource=archivePrefix, match=\regexp{^[a|A][r|R][x|X][i|I][v|V]$}, final]
\step[fieldset=pages, null]
}
\map[overwrite]{%<---- this maps your example article to the proper arxiv site
\step[fieldsource=archivePrefix, match=\regexp{^[a|A][r|R][x|X][i|I][v|V]$}, final]
\step[fieldsource=arxivId, fieldtarget=eprint]
\step[fieldsource=eprint, match=\regexp{[a|A][r|R][x|X][i|I][v|V]:}, replace=\regexp{$1}]
\step[fieldset=primaryClass, null]
}
}
}
The MWE
\documentclass[ngerman, a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=ieee-alphabetic, backend=biber]{biblatex}
\usepackage{hyperref}
\addbibresource{\jobname.bib}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=eprinttype, match=\regexp{^[a|A][r|R][x|X][i|I][v|V]$}, final]
\step[fieldset=pages, null]
}
\map{
\step[fieldsource=archivePrefix, match=\regexp{^[a|A][r|R][x|X][i|I][v|V]$}, final]
\step[fieldset=pages, null]
}
\map[overwrite]{
\step[fieldsource=archivePrefix, match=\regexp{^[a|A][r|R][x|X][i|I][v|V]$}, final]
\step[fieldsource=arxivId, fieldtarget=eprint]
\step[fieldsource=eprint, match=\regexp{[a|A][r|R][x|X][i|I][v|V]:}, replace=\regexp{$1}]
\step[fieldset=primaryClass, null]
}
}
}
\begin{filecontents}{\jobname.bib}
@article{KingZengHistoryGuide,
author = {Gary King and Langche Zeng},
title = {When Can History Be Our Guide?},
subtitle = {The Pitfalls of Counterfactual Inference},
journaltitle = {International Studies Quarterly},
volume = {51},
date = {2007-03},
pages = {183-210},
url = {http://gking.harvard.edu/files/abs/counterf-abs.shtml},
urldate = {2012-06-05},
gender = {pm},
}
@article{Ashtekar1997,
archivePrefix = {arXiv},
arxivId = {arXiv:gr-qc/9706069v1},
author = {Ashtekar, A and Schilling, T},
eprint = {9706069v1},
pages = {1--41},
primaryClass = {arXiv:gr-qc},
title = {{Geometrical Formulation of Quantum Mechanics}},
year = {1997}
}
@article{DBLP:journals/corr/abs-1008-2849,
author = {Jan Wassenberg and Peter Sanders},
title = {Faster Radix Sort via Virtual Memory and Write-Combining},
eprinttype = {arxiv},
eprintclass = {cs.DS},
eprint = {1008.2849},
date = {2010-09-06},
pages = {1-8},
}
\end{filecontents}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
yields
Note the difference in the link.