jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Add cursor area awareness (guards) to CSL citations

Open subhramit opened this issue 6 months ago • 8 comments

Reproducibility:

  1. Open JabRef and a LibreOffice Writer document
  2. Open Chocolate.bib in JabRef
  3. Connect to the running LO instance
  4. Select any JStyle
  5. Select any entry and cite it in the document
  6. Click anywhere in between the citation area (can be visualized by ctrl+f8)
  7. Select any other entry and try to cite
  8. Observe the following error ("the cursor is in a protected area"):
Image

This guarding mechanism doesn't exist when the corresponding steps are carried out with CSL styles, which leads to broken citations:

Image

Wish: Introduce it to CSL styles as well. Refs. https://github.com/JabRef/jabref/issues/11829 eventually.

subhramit avatar May 07 '26 18:05 subhramit

Some more UX engineering - in the error dialog, the user doesn't have to be aware of an internal reference mark format like JR_cite_1_Corti_2009. Maybe change it to the same string used for the citation text.

subhramit avatar May 07 '26 18:05 subhramit

Can I say that a document can only contain either CSL or JStyle citations?Or they can coexist in a doc?

pluto-han avatar May 07 '26 21:05 pluto-han

Can I say that a document can only contain either CSL or JStyle citations?Or they can coexist in a doc?

Yes, they cannot co-exist

subhramit avatar May 07 '26 21:05 subhramit

Seems to be another issue:

For CSL, a normal citation with multiple entries is inserted as a single reference mark, but in-text citation with multiple citations is still split into multiple separate reference marks.

Steps to reproduce:

  1. Use JStyle, cite serveral entries at the same time. Entries are inserted as a single reference mark.
Image
  1. Use CSL, do step 1 again. It does not work for in-text citation
Image

pluto-han avatar May 07 '26 22:05 pluto-han

There also appears to be missing spaces in csl normal, multiple entries from your screenshot

subhramit avatar May 08 '26 00:05 subhramit

Please open these two above as separate issues. They're good findings.

subhramit avatar May 08 '26 00:05 subhramit

We think that this issue was fixed. Please head to https://builds.jabref.org/main to download a development build and try it out.

For any feedback, add a comment to the pull request at https://github.com/JabRef/jabref/pull/15728.

github-actions[bot] avatar May 14 '26 10:05 github-actions[bot]

A pull request addressing the issue has been created. You can try out the pull request by following the steps at How to try out any JabRef pull request?.

For any feedback, add a comment to the pull request at https://github.com/JabRef/jabref/pull/15728.

github-actions[bot] avatar Aug 08 '26 10:08 github-actions[bot]