Paragraphs keep ending up inside citations with LibreOffice plug-in

Just that - whole sentences or paragraphs following a citation will end up inside of it, causing problems and generally annoying me as its untidy. Hovering the cursor over this text reveals the citation pop-up, and deleting the text and pasting it back in only seems to work some of the time.
Is there any way to edit the parameters of the citation and neaten it up, making sure that it ony applies to the superscript number*?

Cheers!

*I'm using Vancouver.
  • Sorry, this is a LibreOffice bug. It's been reported forever ago but unfortunately we cannot get the right people to care, although posting on the bug report and reminding them might eventually help, so do post on the bugtracker that you are affected by this as it might help. Otherwise you should enable field shading in LibreOffice so you can see if you accidentally start extending a Zotero citation and be careful when editing text at the end of them.
  • Thank you! Will try this.
  • So I've found a solution.

    If we add a space immediately after we add the citation, only then will zotero include the anteceding text inside the citation. BUT, if we start typing immediately after including the citation without any space, it will exclude the text. AND VOILA
  • edited January 4, 2022
    This discussion together with the libreoffice bug ticket made me wonder: Is using reference marks actually the appropriate way to insert citations? Shouldn't it be a field instead?

    Fields. For instance, the text could be a field of the type created by Ctrl+F2 > Variables > User Field.

    See: https://imgur.com/a/7SlvLEW, where separate variables are used to create protected text in the bibliography and for the citation. I haven't yet found a way to create a field that combined multiple variables for multi-citations, or making the numbers clickable cross-references to the bibliography entries, while allowing for multi-citations.

    Bookmarks. If I were creating a bibliography by hand (had to do it on a collaborative word document before), I'd somehow enumerate the citations, create bookmarks for the key listed in the bibliography, and insert cross-references to those bookmarks. Not only would that ensure consistency, it would also make the citations clickable links to the bibliography (as is the default in LaTeX's hyperref).

    See: https://imgur.com/a/PVQQxYP

    This differs from the way bookmarks are currently abused to encode the cross-reference information, sharing the issues of the reference-marks approach -- if not worse, because bookmarks are not highlighted as fields in LibreOffice.

    It would work straight-forward for citation styles where the bibliography and the citation use the same format for the reference mark, e.g. "[23]". But if multi-citations are needed, things become more complicated, e.g.

    See references [23, 24]
    || | | |
    || | | '- field displaying variable "ZOTERO_CITE_END"
    || | '- Reference to number-only bookmark
    || '- field displaying variable "ZOTERO_CITE_SEP"
    |'- Reference to number-only bookmark
    '- Field displaying variable "ZOTERO_CITE_START"

    References

    23. J Doe (2017) "On the ethics of being an example"
    24. J Doe (2019) "I'm not dead"
    |
    '-- Number is marked as bookmark. The actual text could be protected by being a field.

    Doing it like that would be definitely more complicated than the current solution, but would retain the "clickable cross-reference"-character of citations, and protect from accidental edits to the in-text citations, as all components would be fields. Users could still insert text between the separate fields, but that might even be desirable (analogously to the optional argument of \cite[extra]{key} in LaTeX, that allows to write something like ref. [JDoe17, eq. 10]).

  • Last time I checked LibreOffice did not provide the necessary programming APIs to implement Zotero citations with just fields. Plus LibreOffice fields are not text-editable which is a requirement for Zotero citations. We would definitely like to implement citations with Fields as that would allow us to drop Bookmark support and unify Word and LibreOffice citations, alas that is not on the table right now.
  • The fix for tdf#81720 has landed in 7.6, I’ve just added it to the release notes: https://wiki.documentfoundation.org/ReleaseNotes/7.6
  • edited September 4, 2023
    @uefmatty give our most generous thanks to everyone involved in fixing and releasing this.
  • @adomasven it was a group effort, and you too played a part. Thank you for your comments both here and on Bugzilla, describing the ideal behavior and the likelihood of a simple fix. Had someone looked at this prior to commit babba47 in Jan 23 - less than a month earlier - it could've been a two-liner. On the bright side, we now have a test in place to prevent regression.
Sign In or Register to comment.