jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Academic Pages export overwrites files for duplicate citation keys

Open Gautam-aman opened this issue 3 weeks ago • 4 comments

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

  1. Create two entries with citation key same, titled FIRST PAPER and SECOND PAPER.
  2. Export both using Academic Pages.
  3. Observe that same.md and same (1).md both link to /files/same.bib.
  4. 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.

  1. Opened a temporary library containing FIRST PAPER and SECOND PAPER, both with citation key same.
  2. Exported both entries using File → Export → Export all entries → Academic Pages.
  3. JabRef reported that the export completed successfully.
  4. Both generated publication files linked to /files/same.bib. That file contained only SECOND 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

ss1 ss2

Gautam-aman avatar Nov 11 '26 09:11 Gautam-aman

/assign-me

AnishKmSingh avatar Nov 11 '26 12:11 AnishKmSingh

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-machine avatar Nov 11 '26 12:11 jabref-machine

JabRef has ability to avoid duplicate citation keys. - Please look into the codebase and devdocs carefully.

pluto-han avatar Nov 11 '26 12:11 pluto-han

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

AnishKmSingh avatar Nov 12 '26 06:11 AnishKmSingh