This question was about a side effect encountered in this answer. One way to avoid this side effect is to not use biber but bibtool -biblatex
as stated in this answer.
I'm using biber --tool
to automatically remove fields like abstract
, review
, groups
, and file
from biblatex entries in .bib files. A side effect of this is that all non-standard-fields¹ seem to be removed as well, which I want to prevent. Here's an minimal example:
This is the entry in the .bib file mybib.bib
:
@Thesis{Author_18_TheThesis,
author = {Mr Author},
title = {The Thesis},
type = {Doctoral Dissertation},
institution = {Department of Documents, University of Stackexchange},
year = {2018},
abstract = {This is the abstract.},
file = {:author/Author_18_TheThesis.pdf:PDF},
review = {This is the review.},
groups = {publications},
ispreprintpublic = {true},
}
And this is the clean-bibfiles.conf
configartion file for biber --tool
:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<output_fieldcase>lower</output_fieldcase>
<output_indent>2</output_indent>
<output_align>true</output_align>
<sourcemap>
<maps datatype="bibtex" map_overwrite="1">
<map map_overwrite="1">
<map_step map_field_set="abstract" map_null="1"/>
<map_step map_field_set="review" map_null="1"/>
<map_step map_field_set="groups" map_null="1"/>
<map_step map_field_set="file" map_null="1"/>
</map>
</maps>
</sourcemap>
</config>
Running biber --tool --configfile=clean-bibfiles.conf mybib.bib
will produce a mybib_bibertool.bib
file that contains this biblatex entry:
@thesis{Author_18_TheThesis,
author = {Author, Mr},
institution = {Department of Documents, University of Stackexchange},
date = {2018},
title = {The Thesis},
type = {Doctoral Dissertation},
}
The non-standard-field ispreprintpublic
has been stripped from the entry. To be precise, the groups
and review
fields would also be stripped even if they would not be in the sourcemap, as both are also non-standard fields or are "borrowed" from the article type, respectively. How to prevent the automatic stripping of such fields when using biber --tool
?
¹See e.g. "2.1.1 Regular Types" and "4.2.4.1 Generic Fields" in the biblatex documentation.
biblatex
mode that already knows@thesis
. Run BibTool withbibtool -r biblatex <file.bib>
– moewe Feb 12 '18 at 22:03biber-tool.conf
are ignored and are neither read nor output. If custom fields are required, they should be defined in the data model by using a custom tool mode config file." This confirms my suspicion that it is indeed not possible without a data model definition. – moewe Feb 12 '18 at 22:15biber --tool-config
. 2) define a new field in the<fields>
element:<field fieldtype="field" datatype="literal">ispreprintpublic</field>
. 3) add it to thethesis
entryfields:<field>ispreprintpublic</field>
. 4) use your new configuration file... – Paul Gaborit Feb 13 '18 at 13:56--validate-datamodel
option. – PLK Feb 13 '18 at 20:47