In-line citations have space before and after number

Hi,

After restarting my computer and re-opening the document I was just working on in Word with Zotero plugin, Zotero asked me to re-download and install the Zotero for Word plugin. After doing this, now my in-line, superscripted citations all have a space before and after the number. It did not change the citations that were already in the document prior to the restart--they have no spaces. If I remove the spaces manually, the citations stop syncing with refresh.

I checked the citation style I am using, and do not see scripting to add in spaces around the number there, so I'm guessing it is a bug independent of the style format.

I am working on a Mac (just updated to 15.0.1)
Zotero version 7.0.8-beta.1+e754fa0c4 - I am not sure if it automatically upgraded the Zotero version from 6 when I restarted.
Word version 16.89.1 (for Mac)
«1
  • Same problem. I've been using Nature style which is not supposed to have a space before and after inline citation numbers. After redownload and re-install Word plugin, space was added. I don't see scripts to modify it either.

    Mac
    Zotero 7.0.8-beta.1+e754fa0c4
    Word Version 16.89.1
  • Can you reproduce this in a new document @jdlang47 @CherryChengchenLi?
  • https://s3.amazonaws.com/zotero.org/images/forums/u12619812/nykb0iqgdygd571vd8og.png


    Does a screenshot of a new document help? I'm using Nature style and just tried out on a new document -- now there is no space after the superscripted number (good), but still space before the number.
    Went back to my older documents using the same style before yesterday's reinstall, no space either before or after superscripted numbers.
  • edited October 9, 2024
    In a new document, there is a space before the superscript in Word (16.89.1). But not in LibreOffice Writer (24.8.0.3)
  • If you press Add/Edit Citation on those citations with a space do you get a dialog saying that the citation has been modified? Could you provide step-by-step instructions for how to reproduce this in a new document?
  • I am not able to reproduce with Word 16.78.3.
  • @adomasven

    In a new document, I see the same thing as @CherryChengchenLi -- there is a space before the superscripted in text citation, but not after it.

    If I press Add/Edit Citation on those citations, it works as normally. But if I remove the space manually to fix to the desired format, it does give that dialog.

    Step-by-step:

    1. Write some text, and place cursor where I want to add the in-text citation.
    2. Select Add/Edit Citation while Zotero 7 app is open.
    3. Select the desired style format (I typically use a custom one based off of the Nature style, but the problem also exists with the Nature style)
    4. Select the citation to add and select OK.
    5. Citation is inserted into the document as was described, and modeled by @CherryChengchenLi.
  • I also don't know if this is relevant, but I don't see a plugin listed in Zotero's plugin manager. I'm not sure what the expected behavior is on version combinations where the citations work as expected.
  • The Word add-on isn't listed in the plugin manager anymore, so that's expected, yes.
  • I think I found a fix: I followed the instructions to reinstall the Zotero Word plug in (https://www.zotero.org/support/word_processor_plugin_manual_installation), and on restart, a new document inserts the citations as desired.

    However, in an existing document with citations already existing, there are still some problems.

    1. When I changed between citation styles, it updated to remove most, but not all of the unexpected spaces. When trying to fix the ones with a space by removing and readding it (with or without letting it refresh citations between these steps), it enters it again with a space before and after the citation.
    2. New citations add spaces before the number, but only in the middle of a paragraph. At the end of a paragraph, it works as expected. But if I copy/paste that citation to the desired location and refresh citations to fix number ordering, it goes back to adding the space.
  • More odd behaviors:
    1) Copy pasting same citation from a different document doesn't fix the problem.
    2) The document that had the citation copied has gray brackets ([]) around the number. Refreshing does not fix the way it appears.
  • edited October 10, 2024
    Strangely, it works again as expected in a new document (Word 16.89.1).

    Edit 1: No, in fact it is not true. I am digging into. It worked in a new document. I then edited an existing one (edited by others also), which had all the superscripts with a leading space. I had to replace all, because while the numbers were detected (a new reference got the correct numbering and was added to the bibliography), there were not editable (selecting the number and hitting add/edit citation just showed an empty citation bar). I noticed that if I wanted to insert a citation right after a ) or a ", the new citation I added to replace the previous always suddenly showed a leading space. Then, I came to an error when I tried to add a citation between two brackets (), right after an equation object. An error message popped up ("Zotero experienced an error updating your document. Would you like to view troubleshooting instructions?"). I clicked "No" because I knew what happened. Despite this error, all the citations seems to be correct (no leading space). But when I tried again the Nature style in new document, I got a leading space in all the citations, when there was none prior to the edition of my existing document.

    Edit 2: Exiting Word seems to help. Inserting a citation in Nature format in a new, empty document works as expected (no leading/trailing space). I'll try to reproduce with an equation object inside parenthesis.
  • Problem resolved after reinstalling Zotero (7.0.7) and word plug-in.
    Restarted Word -> Zotero -> Document Preferences -> select "Nature" -> inline citations automatically updated.
    Now there is no leading space before the inline citation numbers (good)!

    Mac
    Zotero 7.0.7 (don't think this is the most updated version though)
    Word Version 16.89.1 for mac
  • @CherryChengchenLi Zotero 7.0.7 is the latest version and it won't have this issue. We're testing a new way to insert citations in the Zotero Beta that you were previously running, which is why you don't see it with the main release. We would appreciate if someone could find a reliable way to reproduce this. @poettli thank you for documenting your findings so far.
  • I have the same problem. Running 7.0.8-beta.1+e754fa0c4 on Mac with Catalina 10.15.7 and Word for Mac 16.66.1. Was all working fine until yesterday or day before then started inserting space before reference number in in-line cites. My understanding is that with the Mac on Catalina I have to use the beta.
  • @jwilentz: No, you don't have to use the beta.
  • @adomasven You are welcome. Unfortunately, I am not able to reliably reproduce this at the moment. I have kept a copy of the unedited document (the one with the existing leading spaces I mentioned above). I will try to reproduce what I described earlier when I have some free time.
  • I also uninstalled Zotero (and the plugin), and reinstalled with 7.0.7 (not beta), and seems to work for me. Refreshing citations in the affected document didn't fix the spaces, but was able to resolve them by using "Add/edit citation" for the affected citations, hitting OK, and it updated to not have undesired spaces.
  • @poettli Could you produce a Debug ID for an insert that causes an extra space?
  • @poettli @jdlang47 @CherryChengchenLi We have pushed an update to the Zotero Beta that might fix this issue. It would be a huge help if you could install it and see if the issue is fixed for you.
  • Coming from 7.0.8-beta.2+237a2e5b8 to new 7.0.8-beta.4+a6c9af3c2 solved the problem for me, on macOS.
  • edited October 17, 2024
    With 7.0.8-beta.4+a6c9af3c2, in the existing document with spaces, any new citation is added without a space. But refreshing the document does not make the existing spaces to disappear (I guess because they are not technically part of the field code, so they are invisible to Zotero).
    Generating an error in the existing does not trigger the behavior reported earlier (i.e., leading space in a blank, new document), as far as I can see.
  • edited October 17, 2024
    Reopening a document I have edited with changes tracking (not sure it makes a difference or not), the first in-text citation are correct, then a space suddenly appears for subsequent citations. The document I am talking about is a copy of a document where all the citations are correct (no spaces). So I am not sure when the spaces started to appear. Refreshing the citation does not make the space to disappear. I have to edit each citation for the space to disappear. But it does not work after a parenthesis.
    @poettli Could you produce a Debug ID for an insert that causes an extra space?
    The Debug ID is D311694822.

    Edit1:
    Going through all the in-text citations and editing them through the Add/Edit Citation button broke everything. I have lost my references and and error message is now popping every time I try to add or refresh.

    Edit2:
    This seems to be linked to an equation I copy from another document into the document I am working on. When I Add/Edit Citation, the error message pops up. I have AutoSave on and after the error occurred, the document I have copied the equation from is modified, without me to touching it. I can see it because the AutoSave has been activated on the document source.

    Edit3:
    It doesn't seem to be linked to the equation, as I can trigger the error prior to the copy/paste of the equation, but not for all the citations. The Debug ID is D1411463013.

    Edit4:
    I have isolated two shorts paragraph which trigger the error message. Report IDs: 978000172 and 1166304361 (The second ID is after a prenthesis.)

    I am sorry, this reply is a mess and maybe talking about unrelated issues. I guess I will have to trough the whole document and reinsert all the citations.

    Edit 5: Restarting the laptop seems to have solved the errors related to Add/Edit Citation, but there is still a space after a closing parenthesis.
  • edited October 17, 2024
    @poettli: Sorry, trying to understand this. Is your sense that this is fixed for newly inserted citations?
  • edited October 17, 2024
    This is where there is something strange. For newly inserted citations, yes, it is fixed. So let me try to summarize what I then encountered. Maybe better to open a new thread?

    1. I have a document, I reinserted all the citations from scratch with the updated beta, and no space has been added. Everything is fine.
    2. I made a copy of the same exact document, to edit it. After some time working on it, adding some new citations, changing position of paragraph, then all of a sudden (I cannot say when it started during the editing process), almost all the citations that did not have any spaces got a leading space (only a few did not have). Again, no leading space existed in this document before I started to make changes. And the original document (in 1.) is still correct. Please note I am tracking changes.
    3. Using Add/Edit Citation button makes the space to disappear. The Refresh button has no action on that.
    4. After several Add/Edit Citation use, I then started to receive an error message. And then everything started to fall apart. Any citation I tried to edit thrown an error message. I was able to isolate a problematic paragraph. I copied it into an empty document. Error message while refreshing, trying to change the style, editing citation. Everything was a mess.
    5. I restarted my laptop. Everything is now fine, in the sense I can edit citation for the leading space to disappear.
    I am not sure whether it makes sense or not.
  • Have you worked with track changes in the past using Zotero without errors? Even without recent changes to the plugin an issue like this when working with track changes could arise, which is why we recommend against doing that.

    Do you think the citations that had a space added to them were edited in bulk by Zotero (i.e. when renumbering citations due to prepending one at the start of the document)? What do you mean by "there is a space after a closing parenthesis"?
  • Have you worked with track changes in the past using Zotero without errors?
    Yes, I did. But I can work without if it is prone to errors.
    Do you think the citations that had a space added to them were edited in bulk by Zotero (i.e. when renumbering citations due to prepending one at the start of the document)?
    No, I cannot say it is because of the bulk edition by Zotero. I just tried on another copy of the document in 1. and no space is added.
    What do you mean by "there is a space after a closing parenthesis"?
    https://s3.amazonaws.com/zotero.org/images/forums/u2119014/f3fq9m9t3bc35kvaqzuc.png
  • edited October 17, 2024
    Can you reproduce the space after parenthesis reliably in a new document? If you re-add that citation using Add/Edit Citation the space is still there?
    Yes, I did. But I can work without if it is prone to errors.
    Zotero tries its best to work in track changes mode, but users occasionally report document corruption and we generally recommend against that. Using other complex objects in the document like equations, table of contents have also caused users issues in the past, so not clear if the issue you have experienced is related to these recent changes. On the other hand if you've worked with all of these without issue before, then we'd like to be more cautious about this.
    I restarted my laptop. Everything is now fine, in the sense I can edit citation for the leading space to disappear.
    Did you try restarting Word before restarting the laptop outright?
  • Can you reproduce the space after parenthesis reliably in a new document?
    No, I cannot reproduce in a new, blank document. I just type ) and I can add a citation right after, without a space. Same goes after a ", as I mentioned earlier.
    If you re-add that citation using Add/Edit Citation the space is still there?
    Yes, it is still there. And it is the same after a ". And when I copy the citation showed in the screenshot above to the new document, and hit refresh for example, then Zotero encounters an error.
    Did you try restarting Word before restarting the laptop outright?
    I did not at that time. But I encountered an error again, and just restarting Word seems to have been enough to stop the error to appear.
  • Yes, it is still there. And it is the same after a ". And when I copy the citation showed in the screenshot above to the new document, and hit refresh for example, then Zotero encounters an error.
    Could you send this to support@zotero.org with a link to this thread? And also produce a Debug ID?
Sign In or Register to comment.