Export to Biblatex/Biber (and others). Custom field order.

If I export to Biblatex I might get an entry like


@book{nietzsche_1969_thus,
author = {Nietzsche, Friedrich Wilhelm},
date = {1969},
title = {Thus Spoke Zarathustra: A Book for Everyone and No One},
shorttitle = {Thus Spoke Zarathustra},
edition = {2},
isbn = {0-14-044118-2},
pagetotal = {364},
publisher = {Penguin Books},
langid = {english},
note = {biblatex[origdate=1883;shorthand=Z]}
}


I suggest allowing the user a custom ordering of the output fields. E.g. So the user can specify something like: date, title, author, publisher, etc. For an output like


@book{nietzsche_1969_thus,
date = {1969},
title = {Thus Spoke Zarathustra: A Book for Everyone and No One},
author = {Nietzsche, Friedrich Wilhelm},
publisher = {Penguin Books},
shorttitle = {Thus Spoke Zarathustra},
edition = {2},
isbn = {0-14-044118-2},
pagetotal = {364},
langid = {english},
note = {biblatex[origdate=1883;shorthand=Z]}
}


The actual ordering is unimportant, the suggestion is to allow any arbitrary ordering the user desires.

The suggestion would apply to any intermediate export format, as for Biblatex and Bibtex, not to bibliographic style formats. Bibliographic style formats already rigorously specify a field ordering (and so a user wanting to change this ordering would just be required to create a new style/style translator).

The motive for this is to enable bib entries embedded in documents, and (secondarily) standalone *.bib files, to be more human readable (according the user's tastes).

In most cases folk use *.bib files as an intermediate file that they don't need to read (or rarely read). As in a workflow that goes: Zotero Export > .bib file > transform .tex and .bib file to pdf.

However, where bib entries are embedded in a documents it can be more critical that those entries be more human readable.
  • I don't fancy building a GUI for that, to be honest, and Zotero doesn't have any place for a GUI for it; I think I've seen it mentioned that it's a design principle behind the Zotero translators that they should need no configuration and just do the right thing in the common case (not attempting to speak on their behalf -- it's just what I remember being said, and it's consistent with the implementation of the existent translators).

    No such principle underlies Better BibTeX (obviously, if you've ever sniffed at it), but still, that UI... regardless, there is *sort of* an UI for it, as it's a two-line postscript should you swing that way (https://github.com/retorquere/zotero-better-bibtex/issues/512).
  • (yeah -- before emiliano chimed in, I was going to say that this is the type of thing BBT excels at. I don't think we'll want to build it into regular Zotero).
  • Emiliano has just supplied the solution to do this in Zotero-better-bibtex (BBT).

    I've documented the solution at:

    https://github.com/retorquere/zotero-better-bibtex/wiki/Scripting-examples#custom-field-order

    It works beautifully.
Sign In or Register to comment.