Skip to content

Fix CSL citation ordering in footnotes#14313

Closed
marifer-perezh wants to merge 1 commit into
JabRef:mainfrom
marifer-perezh:feat/libreoffice-csl-footnote-citations-12484
Closed

Fix CSL citation ordering in footnotes#14313
marifer-perezh wants to merge 1 commit into
JabRef:mainfrom
marifer-perezh:feat/libreoffice-csl-footnote-citations-12484

Conversation

@marifer-perezh

Copy link
Copy Markdown

Closes #12484

Reworked CSL reference mark sorting to build partition-aware range entries and remap footnote citations to their footnote markers before ordering, ensuring numbering reflects footnote placement.

Added comparison logic that uses in-text ordering when possible and falls back to partition indices so citations within the same footnote keep their textual sequence

Steps to test

####Automated verification

  1. Ensure you have a working Java and LibreOffice development environment (Java 17+, LibreOffice SDK).
  2. From the repository root, run the OpenOffice/LibreOffice integration checks: ./gradlew :jablib:check
  3. If you only want to exercise the relevant logic, you can narrow it down with ./gradlew :jablib:test --tests org.jabref.logic.openoffice.oocsltext.CSLReferenceMarkManagerTest.

####Manual verification in LibreOffice

  1. Build the LibreOffice extension: ./gradlew :jablib:assemble.
  2. Install the freshly built extension (jablib/build/libs/JabRef-OpenOffice-integration.oxt) into LibreOffice.
  3. Open a document that mixes in-text citations and footnote citations, using a numeric CSL style.
  4. Insert several citation groups in the body text and multiple citations inside one or more footnotes.
  5. Trigger “Update citation numbers” from the JabRef LibreOffice plugin.

Mandatory checks

  • I own the copyright of the code submitted and I license it under the MIT license
  • I manually tested my changes in running JabRef (always required)
  • [/] I added JUnit tests for changes (if applicable)
  • I added screenshots in the PR description (if change is visible to the user)
  • I described the change in CHANGELOG.md in a way that is understandable for the average user (if change is visible to the user)
  • I checked the user documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request updating file(s) in https://github.com/JabRef/user-documentation/tree/main/en.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @marifer-perezh!

Thank you for contributing to JabRef! Your help is truly appreciated ❤️.

We have automatic checks in place, based on which you will soon get automated feedback if any of them are failing. We also use TragBot with custom rules that scans your changes and provides some preliminary comments, before a maintainer takes a look. TragBot is still learning, and may not always be accurate. In the "Files changed" tab, you can go through its comments and just click on "Resolve conversation" if you are sure that it is incorrect, or comment on the conversation if you are doubtful.

Please re-check our contribution guide in case of any other doubts related to our contribution workflow.

@jabref-machine

Copy link
Copy Markdown
Collaborator

Your code currently does not meet JabRef's code guidelines. We use Checkstyle to identify issues. You can see which checks are failing by locating the box "Some checks were not successful" on the pull request page. To see the test output, locate "Source Code Tests / Checkstyle (pull_request)" and click on it.

In case of issues with the import order, double check that you activated Auto Import. You can trigger fixing imports by pressing Ctrl+Alt+O to trigger Optimize Imports.

Please carefully follow the setup guide for the codestyle. Afterwards, please run checkstyle locally and fix the issues, commit, and push.

@Siedlerchr

Copy link
Copy Markdown
Member

Your entire steps to test description is AI generated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for footnote-based CSL citations

3 participants