Academic Pages export overwrites files for duplicate citation keys
JabRef version
Local development checkout; current upstream contains the same export logic.
Operating system
macOS, Java 25
Checked with the latest development build
The downloadable GUI build has not been tested. The problem was reproduced by calling the actual Academic Pages exporter with a temporary output directory.
Steps to reproduce the behaviour
- Create two entries with citation key
same, titledFIRST PAPERandSECOND PAPER. - Export both using Academic Pages.
- Observe that
same.mdandsame (1).mdboth link to/files/same.bib. - Inspect that file: it contains only
SECOND PAPER. The first exported BibTeX record has been overwritten.
Expected: each publication should link to its own exported BibTeX file, with neither record overwritten. Existing output files should also be preserved.
Appendix
The source library remains intact. The exporter generates unique Markdown filenames, but writes the BibTeX file using only the citation key. Its PDF-copy path also replaces existing files with matching names; that variant was initially identified by source inspection.
The reproduction used the real exporter with mocked formatting preferences and a temporary output directory. OpenAI Codex assisted with investigation.
GUI testing results
The build includes an unrelated IfPlural change; its Academic Pages exporter was unchanged.
- Opened a temporary library containing
FIRST PAPERandSECOND PAPER, both with citation keysame. - Exported both entries using File → Export → Export all entries → Academic Pages.
- JabRef reported that the export completed successfully.
- Both generated publication files linked to
/files/same.bib. That file contained onlySECOND PAPER; the first entry’s exported BibTeX had been overwritten.
The source test library remained intact. The PDF-overwrite variant was not tested in this GUI run.
Screenshot
/assign-me
Thank you for your continued work in JabRef. At this point, you probably already know the basics and the important links. If not, our contributing guidelines is the place you should go to.
At this point in time, you raised 3 pull request(s) of which 67% (2/3) have been merged.
JabRef has ability to avoid duplicate citation keys. - Please look into the codebase and devdocs carefully.
Thanks. The library can still contain duplicate keys (e.g. from import), and the Academic Pages exporter then overwrites same.bib. Could we reopen this so I can fix the exporter to write unique filenames?” Start the PR once a maintainer agrees. Mention Fixes #17784 in it