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)
  • 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 7 days ago
    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 6 days ago
    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.
  • 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.
Sign In or Register to comment.