1

I have written a small biber configuration file exper3.conf to clean .bib files. The goal is to alphabetize and normalize the individual entries. The script is

<?xml version="1.0" encoding="UTF-8"?>
<config>
  <output-indent>2</output-indent>
  <output_align>true</output_align>
  <output_fieldcase>title</output_fieldcase>
  <output_field_order>author,title</output_field_order>
  <sortingtemplate name="tool">
    <sort order="1">
      <sortitem order="1">entrykey</sortitem>
    </sort>
  </sortingtemplate>
</config>

When I run it with this command line

biber --tool -O TexStackOutput.bib -g exper3.conf TexStackInput.bib

on this input file TexStackInput.bib (notice the oddly formatted lines, the out of order entries, and the out of order fields)

@XData{PHEnglewoodCliffs,
  Ids  = {PH:EnglewoodCliffs},
  Publisher = {Prentice-Hall},
  Location     = {Englewood Cliffs NJ},
}

@Article{wombat2016, Author = {Wombat, Walther and Koala, Klaus}, Title = {The true meaning of 42}, Date = {2016}, Journaltitle = {Journal of modern skepticism}, Keywords = {trusted}, }

@Book{WetherellEtudes, Date = {1978}, Author= {Charles Wetherell}, Title = {Etudes For Programmers}, Xdata = {PH:EnglewoodCliffs}, }

the output is this file

@Xdata{PHEnglewoodCliffs,
  Ids       = {PH:EnglewoodCliffs},
  Location  = {Englewood Cliffs NJ},
  Publisher = {Prentice-Hall},
}

@Book{WetherellEtudes, Author = {Wetherell, Charles}, Title = {Etudes For Programmers}, Date = {1978}, }

@Article{wombat2016, Author = {Wombat, Walther and Koala, Klaus}, Title = {The true meaning of 42}, Date = {2016}, Journaltitle = {Journal of modern skepticism}, Keywords = {trusted}, }

Everything is now neat and tidy ... except

The Xdata field has been dropped from the entry WetherellEtudes.

If I use the option --outputresolve on the command line (or in the .conf file), the data from @XData entry PH:EnglewoodCliffs is copied in correctly, but the Xdata field is still dropped. This is what I would expect for resolution.

However, I don't want resolution or removal of the Xdata field for this use of biber. I just want the original .bib file to be "tidied" so that it (well, it's very large sibling which I am using for a big project) to be easier to manipulate and error check.

Further, this seems to be a "bug". If there is no way to keep the Xdata fields in the tidy output file, it seems to defeat the purpose of @XData entries in the first place. What if I want to make a change in the @XData and propagate to ALL of its usages? I cannot do that on the tidied file because the Xdata fields have either been resolved or dropped. I don't want to do it on the original input; after all, it is dirty and hard to use. The work flow strongly suggests replacing the "dirty" original with "tidy" output once the output has been tested and approved. If the Xdata fields are lost in the tidy result, this replacement cannot be done.

A cycle that I expect will go on many times during this project as the bibliography grows.

I am using biber 2.18 on a Mac.

  • Welcome! See https://tex.stackexchange.com/a/415630/105447 and https://tex.stackexchange.com/a/415013/105447. – gusbrs Jan 08 '23 at 12:00

0 Answers0