CSL 'if' statement

I'm writing a CSL, and need an 'if' statement to check if the number of authors is >= 6. I'm not yet CSL fluent, so I would be grateful for any assistance.

Regards,
Trevor
  • You can't do that via "if" - csl is not a programming language but an xml schema, so options are constrained.
    what exactly are you trying to do, though? There might be another way to handle this.
  • Thanks Adam. For my bibliography, I need 'delimiter-precedes-last' (a comma in this case) only sometimes. In cases when there are fewer than 7 authors, the full reference should be like this (with a delimiter before the last author):
    Hilasvuori E, Berninger F, Sonninen E, Tuomenvirta H (2006)...

    But in cases when there are more than 7 authors, the list should be shortened to 3 authors followed by 'et al.' (and no delimiter before the 'et al.'):
    Gaudinski JB, Dawson TE, Quideau S et al. (2005)...

    If you have a work-around, that would be great.
  • that's not possible to do with valid CSL at the moment, but will be with CSL version 1.0.1 due out soon (weeks?), by adding
    delimiter-precedes-et-al="never"
    to the bibliography options.

    You can already use csl 1.0.1 functions in Zotero (and Mendeley and papers afaik), so for your personal use you can just include this in your csl and it will work, though we currently won't accept it to the style repository.
  • Thanks Adam. I'll omit delimiter-precedes-et-al="never" when I submit the style to the repository. This issue isn't a big deal, and something that can be updated in the future. I will leave a comment in cs:info->summary that this change should be made when CSL 1.0.1 comes online.
  • I will leave a comment in cs:info->summary that this change should be made when CSL 1.0.1 comes online.
    perfect, that's exactly the way to go.

This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.

Sign In or Register to comment.