So I'm trying to get \DeclareSourcemap working according to the biblatex manual.
Here's my code:
\RequirePackage{filecontents}
\begin{filecontents*}{p.bib}
@article{A1,
author={Aa, A and Bb, B},
title={Title},
abstract={abs},
journal={J BS},
year={1999},
}
@conference{A2,
author={Aa, A and Ab, S},
title={Title},
abstract={abs},
journal={J BS},
year={2009},
}
\end{filecontents*}
\documentclass{article}
\usepackage[style=authoryear-comp,backend=biber]{biblatex}
\addbibresource{p.bib}
\DeclareSourcemap{
\maps[datatype=bibtex,overwrite]{
\map{
\step[fieldsource=title]
\step[fieldset=title, fieldvalue=Test]
}}}
\begin{document}
\textcite{A1,A2}
\printbibliography
\end{document}
Running this through latex/biber doesn't change the title field to 'Test'.
In the .bcf file, the sourcemap rules are created, here is a relevant snippet:
<!-- SOURCEMAP -->
<bcf:sourcemap>
<bcf:maps datatype="bibtex" map_overwrite="1">
<bcf:map>
<bcf:map_step map_field_source="title"/>
<bcf:map_step map_field_set="title" map_field_value="Test"/>
</bcf:map>
</bcf:maps>
<bcf:maps datatype="bibtex" driver_defaults="1">
<bcf:map>
<bcf:map_step map_type_source="conference" map_type_target="inproceedings"/>
<bcf:map_step map_type_source="electronic" map_type_target="online"/>
<bcf:map_step map_type_source="www" map_type_target="online"/>
[…]
It seems my additional block does not get processed because there is another maps block for bibtex (And this does get processed, as it changes @conference to @inproceedings)?
If I copy the map block into biber.conf, it works as expected.
So here is my question: How do I use \DeclareSourcemap correctly ensuring that the map gets executed, independent of possible other blocks?
\step[fieldsource=title]line by the way, it isn't doing anything in your example. – PLK Oct 08 '12 at 09:27