[Tex/LaTex] Converting from biblatex to BibTeX format using biber

biberbiblatexbibtexconversion

I wish to use biblatex+biber, in large part because of its data format (xdata!), but often need to use .bst-based bibliography styles. I am aware that biber --tool allows conversion of .bib-files. Before rolling my own, is there a biber configuration file available that does the conversion from the biblatex format to the BibTeX format (e.g., resolving cross/x references/data, location -> address, journaltitle -> journal, date -> year+#mon#)?

Best Answer

Try the biber option --tool-resolve. This resolves crossref/xref and xdata. To reverse the standard biblatex mappings you mention (which are implemented in biblatex.def using the standard macros in the documentation), copy the standard mappings to your preamble and edit as necessary to reverse them:

\DeclareSourcemap[datatype=bibtex]{
  \map{
    \step[typesource=conference, typetarget=inproceedings]
    \step[typesource=electronic, typetarget=online]
    \step[typesource=www,        typetarget=online]
  }
  \map{
    \step[typesource=mastersthesis, typetarget=thesis, final]
    \step[fieldset=type,            fieldvalue=mathesis]
  }
  \map{
    \step[typesource=phdthesis, typetarget=thesis, final]
    \step[fieldset=type,        fieldvalue=phdthesis]
  }
  \map{
    \step[typesource=techreport, typetarget=report, final]
    \step[fieldset=type,         fieldvalue=techreport]
  }
  \map{
    \step[fieldsource=address,       fieldtarget=location]
    \step[fieldsource=school,        fieldtarget=institution]
    \step[fieldsource=annote,        fieldtarget=annotation]
    \step[fieldsource=archiveprefix, fieldtarget=eprinttype]
    \step[fieldsource=journal,       fieldtarget=journaltitle]
    \step[fieldsource=primaryclass,  fieldtarget=eprintclass]
    \step[fieldsource=key,           fieldtarget=sortkey]
    \step[fieldsource=pdf,           fieldtarget=file]
  }
}

or do the same thing via your biber.conf (these are the standard mappings, just reverse the source/target specifiers according to need):

<sourcemap>
  <maps datatype="bibtex">
    <map>
      <map_step map_type_source="conference" map_type_target="inproceedings"/>
      <map_step map_type_source="electronic" map_type_target="online"/>
      <map_step map_type_source="www" map_type_target="online"/>
    </map>
    <map>
      <map_step map_type_source="mastersthesis" map_type_target="thesis" map_final="1"/>
      <map_step map_field_set="type" map_field_value="mathesis"/>
    </map>
    <map>
      <map_step map_type_source="phdthesis" map_type_target="thesis" map_final="1"/>
      <map_step map_field_set="type" map_field_value="phdthesis"/>
    </map>
    <map>
      <map_step map_type_source="techreport" map_type_target="report" map_final="1"/>
      <map_step map_field_set="type" map_field_value="techreport"/>
    </map>
    <map>
      <map_step map_field_source="address" map_field_target="location"/>
      <map_step map_field_source="school" map_field_target="institution"/>
      <map_step map_field_source="annote" map_field_target="annotation"/>
      <map_step map_field_source="archiveprefix" map_field_target="eprinttype"/>
      <map_step map_field_source="journal" map_field_target="journaltitle"/>
      <map_step map_field_source="primaryclass" map_field_target="eprintclass"/>
      <map_step map_field_source="key" map_field_target="sortkey"/>
      <map_step map_field_source="pdf" map_field_target="file"/>
    </map>
  </maps>

These are equivalent and implement the default biblatex mappings, it just depends on where you prefer to specify the mapping.