Portion of proofread document.odt (16.9 KB)
I just wanted a “working” citation and a “failing” citation in the sample. But you seem to say that they are all failing when you try to copy them into your original document.
Reading the sample, now.
Yes, that’s right, all the citations are lost when I copy them into the original document.
Thank you!
I just had a look at the internal encoding of the sample and don’t see anything obviously unusual but I am not at all an expert in Zotero stuff. Copying a note to a fresh document transfers all Zotero data apparently.
(Once again, I didn’t install Zotero. I can only tell that all the hidden stuff is copied without guarantee for it to be functional.)
What may happen, it is only a supposition and I can’t check it, is that the pasted stuff has lost some necessary data (which? how? when?). Zotero data is highly structured with parameters enclosed in [ ] and { }. If for any reason, a delimiter near the end or beginning of the copied stuff is missing, Zotero will not be able to parse correctly the data and will reject it.
A similar possibility lies in the destination location of your pasting. If it lands inside some existing text already containing the delimiters, nesting may become unbalanced.
Have you tried pasting in an empty paragraph? I mean a really empty one.
Thank you for looking into that.
I get what you’re saying in the second paragraph, but as far as I can tell the data are all there, because I created a new/fresh LO-document and tried to copy the citations there and it worked. They only disappear when I copy them into my long document. I also tried to paste different citations/ text passages in different places of the long document (including an empty paragraph), but still they disappeared.
I tried updating both LibreOffice and Zotero to the newest versions and now I seem to face an additional problem: the ZoteroToolbar in LibreOffice won’t work properly any more (I reinstalled the ZoteroLibreOfficeIntegration and checked that a JAVA/JDK environment was selected). When I try to add a citation now, the citation-placeholder appears, I can select a publication in the dialogue-window that pops up, but the placeholder is never replaced with the actual citation. This is something that always happens when I update LibreOffice. I am sorry for introducing a different problem here, but maybe you can help me out. In the past, this problem did sometimes solve itself, since I sometimes had to wait very long (maybe half an hour) for the first citation (after an update) to appear where the placeholder was. Maybe you can help me out here?
update: the toolbar now works again, but since this is a recurring problem a tip for future use would still be appreciated.
@Sofia
if this question is actually about Writer, please re-tag your question to help others looking for solutions. Thanks.
@Sofia: if the citations “disappear” in the real document, you may (once again, it’s a supposition insofar as I have no idea about your document) have an issue with formatting. Perhaps, a style or some unexpected formatting flag is applied causing the paragraph to become hidden.
If your sample file is representative of your document, I fear it is inconsistently manually formatting (my clue: the sample file uses Default Paragraph Style, but I didn’t mention it because it was a sample file). Pasting may cause accidentally some conflict.
@BigRAl: I’ll do it for OP.
@ajlittoz
thanks. I could have done it, but I was not certain if Zotero could be used in other LO components
@ajlittoz : Thank you, this makes sense (or it sounds like it), I will try to figure out if that could be the problem. In the zotero-Forum I also received the following suggestion
@BigRAl: Ok, thank you. If the problem persists, I will open a new thread.
Cross-posting at https://forums.zotero.org/discussion/96482/zotero-citations-get-lost-when-copy-pasting-to-a-specific-odt-document
I am sorry for the bad editing, I meant to delete my reference to the zotero forum since I realised it regarded the other problem that appeared after updating both programs and therefore was not thematically belonging to this thread. So please ignore it.
As you already provided a part of the proof-read text. Could you please
- Copy a citation in an empty file
- Copy a citation in a copy of your document, wich “looses” citation, then remove most other parts of the document (therefore use a copy)
- Post both files to compare them (to check, if all data is lost, or maybe
available, but unusable by Zotero)
If this gives no lead, the question is, why this document gives you trouble, as it seem to work in other places… Difficult to find
Anything special in this document, besides usung Zotero? Do you track changes in this file?
hi, same problem here, I copy-paste either inside the document or from another document and the zotero “fields” are not pasted.
It has nothing to do with the clipboard, as pasting in a new document works.
Even more strange, it worked in a first paragraph, then stopped working.
Finally, I created a new document and pasted each part one after the other.
Could it be that everything following that first citation was actually inside the first citation field?
See Zotero plugin refs "grabbing" prior text or, cannot type beyond it once inserted - #10 by EarnestAl
I had the issue again and followed kb:debugging_broken_documents [Zotero Documentation]
in that case, copy-pasting the whole text in a new document (in one go) solved the issue.
@jcolomb Please don’t use Suggest a solution for anything which is in fact a refresh of the initial question and, worse, for a follow-on of a Comment (@EarnestAl’s). You create false notifications for supposed new solutions.
Zotero is a product on its own to manage citations. Inserting them into documents is kind of “by-product”. Zotero team provided this service in a “universal” way, independent of the office suite. This means they didn’t integrate “intimately” and implemented a complete subsystem with macros.
So, either your primary goal is value-text contents and you try to use (limited) built-in features which respect formatting integrity; or you privilege citations and you must accept formatting degradation caused by Zotero macros. I admit this is not central to your present problem.
Zotero citations are “complex objects” in the ODF stream. It is possible that your copy operation does not collect all data needed to create a full-fledged Z-citation. Also, it is possible that Zotero “optimises” citations to same source. Then if you don’t copy the “primary” occurrence, you don’t get all data.
Considering the original question is already 3 years old and addressed a round-trip through an external service, you should ask your own question, describing in detail your context and, perhaps, providing a small sample document. IMHO, this is not a Writer issue, but rather Zotero’s since there is no coordination between LO and Zotero.
sorry about the “suggest a solution”, that is the only obvious button in the platform… I actually looked for a reply button, but could not find it before.
I thought the problem is so similar that it was better discussed here, and since I had it several times in the last 2 days, it is probably still relevant for many users. Also since Sofia mentioned talking to zotero developers, it seemed to me appropriate to continue the conversation here.
For the issue itself: it is not in the copy, but in the paste operation that something goes wrong (since pasting in a new document works). I think it is independent of zotero and lies in the way LO deals with the special fields, but I do not understand enough how LO works to start debugging.
Sorry again and thank you for your time.
Can you attach a small sample document where you make sure the problem occurs? Give step-by-step instructions on how to reproduce the issue. I want to have a look at the exact data Zotero embeds in the document and see if the copy operation (the one retrieving data) gets everything or misses a bit. I’ll check too the paste operation.
Is it eventually possible that Zotero has macros intercepting both copy and paste? (I’d like not to install Zotero in order not to “pollute” my production configuration)
tested on a linux computer and got the same problem, here a file having the issue
zoteroerror.odt (29.7 KB)
(copy all, and paste below the text will give the error: special fields show as text in the document, NB: if one opens a new file and paste, then it works as expected; if one copy all, delete all and paste: first time it works, second time it does not, even if pasted before the text; if one deletes one reference, the paste works for that reference, not for the other…)
Zotero data are stored in custom <text:reference-mark-start …/>
and <text:reference-mark-end …/>
XML elements. Data is duplicated in both elements (why? this is superabundant).
Zotero is not installed in my LO. It looks like the copy operation filters “input” data to normalise it and to retain only what the strict ODF standard defines. I checked exact contents in the clipboard manager. However since this is the OS clipboard, it is possible there is an extra filter step to export data outside LO, but I doubt it. And on second look, the “edit” icon on the clipboard manager does not give access to full raw data. My checks are therefore not conclusive and my hypothesis might be completely wrong.
Considering the failure of my attempts, I reconsidered your previous statement.
Copy-pasting into another document works. There is a different behaviour between in-document copy-paste and out-document copy-paste. But round-trip does not work!
I double-checked: the <text:reference-mark-start …/>
and <text:reference-mark-end …/>
are not there after paste.
Sorry, I can't help more. As I already mentioned, I don't want to install Zotero only to work on this question.