Organisations in the bibliography not in alphabetical order
JabRef version
5.15 (latest release)
Operating system
GNU / Linux
Details on version and operating system
Fedora 40
Checked with the latest development build (copy version output from About dialog)
- [x] I made a backup of my libraries before testing the latest development version.
- [X] I have tested the latest development version and the problem persists
Steps to reproduce the behaviour
- Set IsSortByPosition="false"
- Use "{Linux Foundation}" as an author.
The bibliography is broken now and not in alphabetical order. Using {}-brackets for organisations was suggested here: https://discourse.jabref.org/t/how-to-enter-corporation-name-in-author-field/2080
Appendix
@subhramit This is jstyle but as you are deeper in the topic now can you take a look please?
@subhramit This is jstyle but as you are deeper in the topic now can you take a look please?
Yeah sure
As it looks at first sight, the order is overridden because of the curly braces {}. JabRef already stores them in BibTeX format, which has braces around them, so when explicitly added, it becomes {{organization name}}. Instead of "o", the first character to participate in the comparator is then "{".
Solution - we will have to ignore extra braces, if explicitly present. I'll take a look at this.
Temporary workaround - do not use extra braces.
We have a RemoveEnclosingBracesFormatter that can be used
Weirdly enough, I can reproduce with {The Geany contributors} but not {Linux Foundation}. It is as if the issue is occurring in some special case.
Luckily, I have dozens of foundations and companies in my LibreOffice document. :) I think this is the pattern:
If {}-braces are used, JabRef takes the last word within the {}-brackets and sorts it like the ASCII-table. This is why "c" from contributors is above all.
{Linux Foundation} will be sorted in a wrong order, too, if you add two authors with "F" in their last name and "Foundation" is between them.
Edit: The best workaround I found so far is to replace each " " with a rare symbol like "℗". Before finishing your document, you can simply replace all "℗" with " " in LibreOffice.
Two thoughts:
org.jabref.model.entry.BibEntry#getFieldLatexFreeshould be used as first try (if it is OK that "The" comes first). However, that ignores authors completelyorg.jabref.model.entry.AuthorList#getAsLastFirstFirstLastNamesWithAndor similar method should be used. One needs to look at other methods for sorting...
Solution - we will have to ignore extra braces, if explicitly present. I'll take a look at this.
Remember that the braces may be needed to protect the formatting of organisation names, even if the name is only one word.
The best workaround I found so far is to replace each " " with a rare symbol like "℗". Before finishing your document, you can simply replace all "℗" with " " in LibreOffice.
Have you tried using no-break spaces in the organisation names?
The~Geany~contributors should make the whole name behave as one word (and retain "The" in citation key).
Also, note that (without no-break spaces) capitalisation matters, at least in citation keys. {Linux Foundation} and {The Geany Contributors} produce "LinuxFoundation" and "GeanyContributors", respectively in the citation key, but {Linux foundation} and {The Geany foundation} produce "Linux" and "Geany". I am not sure if this affects the bibliography.
Have you tried using no-break spaces in the organisation names?
The~Geany~contributorsshould make the whole name behave as one word (and retain "The" in citation key).
Yes, it has no effect. When I use The~Geany~contributors or {The~Geany~contributors}, the sorting is always wrong. It looks like the "~" is only affecting the display in the JabRef GUI but not text in the LibreOffice document.
This issue could be related: https://github.com/JabRef/jabref/issues/7805
/assign-me
👋 Hey @sryjksu, thank you for your interest in this issue! 🎉
We're excited to have you on board. Start by exploring our Contributing guidelines, and set up your local development workspace by following the steps in our workspace setup guidelines to get started smoothly.
For questions on JabRef functionality, you can consult the JabRef Guru. For questions related to the codebase, please start using DeepWiki.
In case you encounter failing tests during development, please check our developer FAQs!
Still facing issues or having more questions? Feel free to ask here on GitHub or on JabRef's Gitter chat. Please don't hesitate to open a (draft) pull request early on to show the direction you are heading towards if unsure.
Happy coding! 🚀
⏰ Assignment Reminder
Hi @sryjksu, this is a friendly reminder about your assignment to this issue.
[!WARNING] This issue will be automatically unassigned in 11 days if there's no activity.
Remember that you can ask the JabRef Guru or DeepWiki about anything regarding JabRef. Additionally, our contributing guide has hints on creating a pull request and a link to our Gitter chat.
How to keep your assignment
If you are working on it, you can prevent automatic unassignment by:
- Submitting a draft pull request with your progress within 11 days
- Asking for the 📌 Pinned label if you need more time
We appreciate your contribution and are here to help if needed!
📋 Assignment Update
Hi @sryjksu, due to inactivity, you have been unassigned from this issue.
Next steps
If you still want to work on this:
- Submit a pull request showing your current state. You will be automatically assigned again.
- Ask a maintainer to assign you again.
/assign-me
⚠️ Reassignment Blocked
Hi @sryjksu, you cannot assign yourself to this issue again.
[!NOTE] Since you were previously unassigned from this issue, a maintainer needs to approve your reassignment.
Please ask a maintainer to assign you if you'd like to continue working on this issue.
@koppor I'm still working on this issue for my final project. Could you please assign this issue to me again? Thank you.
👋 Hey @sryjksu, looks like you’re eager to work on this issue — great! 🎉 It also looks like you don't know how to assign issues to yourself. Please read our CONTRIBUTING.md to find out how. It will also guide you in other aspects of contributing to JabRef.
@subhramit I saw the instruction said that I need to write unit tests for any modification I make. Since this bug is about UI, how do you want the unit test to be like? Also, do you care about coverage of the tests? If so, what types of coverage?
@subhramit I saw the instruction said that I need to write unit tests for any modification I make. Since this bug is about UI, how do you want the unit test to be like? Also, do you care about coverage of the tests? If so, what types of coverage?
No, unit tests aren't needed for UI changes. Only if there is some change in logic made in the viewmodel, write tests.