year-suffix-delimiter cannot be empty (?)

edited November 20, 2020
Hi

I am trying to implement a style in which, if I had 2 works from Smith in 2006 and one in 2007, the citation would look like:

(Smith 2006ab, 2007)

Now, I _think_ the delimiter between the a and b should be given by year-suffix-delimiter="D", where D is the delimiter. But I want no delimiter at all, so I set year-suffix-delimiter="", but when I do that Zotero seems to do some kind of substitution and uses the delimiter for separating 2006 from 2007 -- a comma in this case -- instead, as if it is defaulting to this. So, when year-suffix-delimiter is empty, it gets replaced by the layout delimiter. Can I specify an empty delimiter in some other way, so it stays empty?

To be clear, if I specify:

year-suffix-delimiter="Q"

I get

(Smith 2006aQb, 2007).

If I specify

year-suffix-delimiter="" (empty, which is what I want) I get:

(Smith 2006a, b, 2007)

which is wrong. It has replaced the empty delimiter with the between-entry delimiter. How can I force an empty delimiter?


  • This is probably a bug. What citation style are you using?
  • Hi, thanks for checking this out so quickly. I am developing a new citation style, based on the Australian Manual of Style (https://www.sciencestyle.com.au/). I have based the style file on WHO Regional Office for Europe -- Harvard, and ... (goes away and does couple of tests) ... I can confirm that this 'original' behaves in the same way as my derived style file. I can remove the comma and space in 'a, b' in the desktop Zotero (5.0.93 on Win 10) by using the zero-width HTML character, but this does not work in the online editor. The year-suffix-delimiter is ignored by the online editor, but recognised by Zotero desktop, but in both cases an empty string is replaced by some other delimiter.
  • edited November 20, 2020
    To explain a bit more -- I have done some experimenting...

    I can get it to work in Zotero desktop by doing this in the citation definition:

    year-suffix-delimiter="‌"

    (that is, HTML for a zero-width non-joiner).

    I find that if I put in

    year-suffix-delimiter=""

    the delimiter gets replaced by the between-entry delimiter (comma space), which is not what I want.

    Now, what I want to note is that this solution works in Zotero desktop (Win 10), but the exact same bit of code does not work in the code editor: https://editor.citationstyles.org/codeEditor/ -- in which the value of year-suffix-delimiter seems to be ignored.
  • That's reproducible in any style I think (was able to reproduce in APA by changing collapse to year-suffix and adding the attribute).

    As a workaround, you can insert a zero-width-space as year suffix delimiter:
    year-suffix-delimiter="​"
  • Thanks for that, and thanks for such a quick reply. I eventually managed to do that myself; I decided to use the zero width non joiner to avoid linebreaking -- maybe the style already does that? I don't know that yet. The workaround, which is fine by me, does not seem to work in the online editor...? Thanks again.
  • edited November 20, 2020
    yeah, the visual editor escapes ampersands when you paste them in the field (you can see this in the code editor). It's a trade-off, but given the havoc that unescaped ampersands can cause otherwise, that's probably the right choice.
    I think it works using the code editor though, doesn't it?
  • I tried putting it direct into the code editor (which is what I mostly use) -- nothing works! I can put say DDD as in:

    year-suffix-delimiter="DDD"

    And it still has no effect. No ampersands at all. The DDD shows up in desktop app, so I suspect a bug in online editor.
  • oh how very odd -- I hadn't tested with custom data. It looks like it somehow gets added as a delimiter of the item before the collapsed group. The online editor is running a slightly older version of the citation processor, so that's the most likely reason for the bug, but it's still surprising.
  • There are so many possible cases and combinations, it's no wonder a few edge cases get through. For now it means some tests and development will have to take place in the desktop app. Thanks.
  • If you are comfortable with using a text editor and using the terminal, an alternative workflow would be to use the citeproc-test-runner on the desktop: https://github.com/Juris-M/citeproc-test-runner

    You’d put together a set of test items in a group library, develop the style in the text editor and keep a terminal window open next to it with the citeproc-test-runner which will rerun the tests on the test items whenever you save the style file.
  • Thanks. I may give that a go. Very useful forum. Thanks again.
Sign In or Register to comment.