Perplexing double spaces in collapsed citation

I have a style with citations collapsed by year, such that they should look like this:
(Rehfeldt and others 2015; Worrall and others 2010, 2013)

However, in my Word document, they are rendered with 2 spaces following the comma between the collapsed years. What is really weird is, when I copy the citation from Zotero and paste it into a blank Word document, there is only one space. When I just now pasted it into this forum, there were two spaces.

The citation code looks like this:
<citation et-al-min="3" et-al-use-first="1" name-as-sort-order="all" disambiguate-add-year-suffix="true" collapse="year">
<sort>
<key macro="author"/>
<key macro="year-date" sort="ascending"/>
<key variable="title"/>
</sort>
<layout prefix="(" suffix=")" delimiter="; ">
<group>
<text macro="author-short"/>
<choose>
<if type="bill legislation" match="none">
<text macro="year-date-cite"/>
</if>
</choose>
<group>
<label variable="locator" form="short" strip-periods="false"/>
<text variable="locator"/>
</group>
</group>
</layout>
</citation>


Any thoughts?
  • Looking at that section of the code -- do you have a space set as a prefix inside the year-date-cite macro? That might cause this.
  • Thank you for the reply. The year-date-cite macro is:
    <macro name="year-date-cite">
    <choose>
    <if variable="issued">
    <date variable="issued" prefix=" ">
    <date-part name="year"/>
    </date>
    </if>
    <else>
    <text term="no date" form="short" prefix=","/>
    </else>
    </choose>
    </macro>


    If I delete the space in the prefix in <date variable="issued" prefix=" ">, all references lose the space between name and year (at least in Zotero's Style Editor preview).
  • yeah, but you'll want to handle that space differently, e.g.
    <group delimiter=" ">
    <text macro="author-short"/>
    <choose>
    <if type="bill legislation" match="none">
    <text macro="year-date-cite"/>
    </if>
    </choose>
    </group>
  • edited June 13, 2023
    Hmm, adding that delimiter=" " attribute to that group element of the citation didn't change anything. I wasn't sure if you meant delete the space in the macro AND add the delimiter to the citation group, so I tried both ways. I tried saving the style to ~/Zotero/styles/ and restarting Zotero and Word, but no joy.

    I wonder if a key clue may be the perplexing part: the double spaces do no occur in the Zotero Style Editor preview, nor when copying the citations from Zotero with Command-Shift-A and pasting it into Word, but only when using the Word plugin in Word. I confirmed that the plugin is set to the same style as I am editing in Zotero.
  • Add the delimiter, remove the prefix. Pretty sure that'll work
  • Holy cow, it did work. I had tried that, but only by editing the citation in Word. I needed to refresh the whole document in the Zotero plugin panel.

    Thank you so much!
Sign In or Register to comment.