How to specify the order of fields of each entry when saving?

Hi, I have been using JabRef v3.8.2 on macOS Sierra (10.12.6) for a long time. Recently I upgrade macOS to Big Sur (11.5.1) and I find JabRef v3.8.2 can not be used, thus I upgrade JabRef as well.

I find JabRef v5.3 stores entries in a different format, it changes the order of fields. For example, in my old file stored by v3.8.2, an article entry reads

@Article{keys,
  author     = {Author},
  title      = {Title},
  journal    = {Journal},
  year       = {2021},
  volume     = {11},
  number     = {6},
  pages      = {1},
}

But in the file stored by v5.3, it reads

@Article{keys,
  author     = {Author},
  title      = {Title},
  number     = {6},
  pages      = {1},
  volume     = {11},
  journal    = {Journal},
  year       = {2021},
}

I understand the difference in the order of fields of an entry does not affect the output when using BibTeX or BibLaTeX, but I am still wondering if there is a way to specify the order of fields of each entry when saving?

PS. It seems the file format changes quite a bit from v3.8.2 to v5.3, thus git diff on my database file reports many changes (though most of them is just reordering of fields in each entry).

I think the options in library>library properties>Save sort order relate to this

Take care, there seems to be a bug around that makes that the selected save order will switch between Keep original order and Use current table sort order in an odd manner (Save sort order switching between "Keep original order" and "Use current table sort order" · Issue #8198 · JabRef/jabref · GitHub) but there is already a fix in the making and should be published soon in one of the development versions you can find here index - powered by h5ai v0.29.0 (https://larsjung.de/h5ai/)

Edit: Please backup your data before using a development version. Better safe than sorry

Thank you! But I am concerned with the order of fields in each entry rather than the order of entries, thus I am afraid the option ‘save sort order’ does not help here.

Oh no, my bad :fearful: I honestly thought it was that. No idea then.

Have you tried the Customize Entry types? There you can change the order of the fields. I just don’t remember if this also affects the saving…

Regarding the fields order @koppor also somewhere has an issue about this

Sorry for the late reply. I have tried ‘Options’ → ‘Custom entry types’ and changed the order of fields for the type ‘Article’. But after clicking ‘Apply’, the order of fields loses.

Maybe current JabRef version lacks the feature of specifying order of fields in each entry when saving/exporting bib files?

PS: I have updated JabRef to stable-5.5.

Ah now I understand your issue, no, that is not possible. The serialization order (when writing) of the fields in an entry type is always the same, for the same reason as you state in your original question, to avoid problems with git or other version control systems.

The format has changed over time, unfortunately we did not really document it…

Ah here ist the draft blog post I was searching Add blog post on changes of our .bib serialization by koppor · Pull Request #47 · JabRef/blog.jabref.org · GitHub

@gaochenyi, f you have trouble finding the fields you can go to Options > customize entry types and only show the fields that you use regularly and remove the others:

Hope that will help :thinking:

OK, I would be fine with the slightly changed format. Thanks for the explanation. @Siedlerchr

Also thanks for the kindly reminder. @ThiloteE

1 Like