That’s right. The groups field assigns entries to groups but does not create the groups for display in the panel. I could be wrong, but I think this has been fixed and now works as you would expect in the development version of JabRef.
Now, let’s talk about a workaround that is not too difficult or slow and does not require a specific version of JabRef.
Explanation
The groups that JabRef creates or that you create in the UI are defined in a comment at the end of the .bib file, like this.
@Comment{jabref-meta: grouping:
0 AllEntriesGroup:;
1 StaticGroup:Temp\;2\;1\;\;\;\;;
2 StaticGroup:SubgroupA\;2\;1\;\;\;\;;
2 StaticGroup:SubgroupB\;2\;1\;\;\;\;;
}
In this case, the Temp group has been defined, so it will appear in the panel, and if you have an entry that contains groups = {Temp}, the entry will appear in the group. In contrast, if you have an entry that contains groups = {Temp}, but the group has not been defined as 1 StaticGroup:Temp\;2\;1\;\;\;\;; then entry will be associated with the Temp group, but the group will not appear in the panel.
This should be seamless, but since it isn’t working automatically you can give JabRef a little manual assistance to make the groups show up in the UI.
If I understand correctly, the groups appear in the panel when you open the file, which means that the file must contain group definitions. For whatever reason, this does not happen when you import files. However, you can copy and paste group definitions between files, so if you open the files individually and each one contains group definitions, you can merge the definitions into one file. After that, the groups and entries associated with them will appear in the UI.
Here is an example.
@Comment{jabref-meta: grouping:
0 AllEntriesGroup:;
1 StaticGroup:Temp\;2\;1\;\;\;\;;
2 StaticGroup:SubgroupA\;2\;1\;\;\;\;;
2 StaticGroup:SubgroupB\;2\;1\;\;\;\;;
1 StaticGroup:NewGroup\;2\;1\;\;\;\;;
1 StaticGroup:AnotherNewGroup\;2\;1\;\;\;\;;
}
Option 1
- Open and save each .bib file with JabRef.
- Open the files with a text editor to confirm that the files have group definitions at the end.
- Create a choose a library to be the main library.
- Copy entries and definitions from the secondary libraries, and paste them into the main library, above the existing definitions.
- Merge the definitions into a single
`@Comment {jabref-meta: grouping } statement.
@Article{Someone2023,
author = {Example, Author},
date = {2023-05},
journaltitle = {J JabRef},
title = {Last entry in the main/existing library},
}
***********************************************
Past entire contents of the next library here,
where it will be easy to delete any duplicated
@Comment lines and merge the group definitions.
***********************************************
@Comment{jabref-meta: databaseType:biblatex;}
@Comment{jabref-meta: fileDirectory:/path/to/attachments;}
@Comment{jabref-meta: fileDirectory-host:/other/path/to/attachments;}
@Comment{jabref-meta: grouping:
0 AllEntriesGroup:;
1 StaticGroup:Temp\;2\;1\;\;\;\;;
2 StaticGroup:SubgroupA\;2\;1\;\;\;\;;
2 StaticGroup:SubgroupB\;2\;1\;\;\;\;;
}
Option 2
- Import entries into JabRef
- Confirm that the entries have groups but the groups don’t appear in the UI.
- Open the .bib file in a text editor that supports regular expressions.
- Use a regex search to find and copy all the group names in your library
- Remove duplicates, then convert the group names to definitions like the examples above.
- Confirm that the groups and entries appear in the UI
Here is a regex pattern that will match each group name individually in a JabRef .bib file (if you use a comma, with or without trailing space as the delimiter). If you use another delimiter, replace the commas with your delimiter.
(?<=(,|{)\s{0,1})\S+?(?=,|})(?<=^ groups ?=.*)