Full manual of CSL

Is there any full (detail) manual for the overview at
http://www.zotero.org/support/dev/csl_syntax_summary#formatting

I am having some problem understanding the use of 'match' inside the conditionals. Is there any page with some examples on that?
I would appreciate any feedback.
  • no, that's the best manual we have. It's a wiki, though, so we're constantly trying to improve.

    match is very simple - it's either match="any" or match="none"
    remember that you can use "if" only to test for some select things, namely
    - the presence of a variable
    - the item type
    - if a variable is numeric or not
  • Thanks for your reply.
    So, what does the following line really mean

    <if type="chapter book" match="any">

    Is this a test to see if any of the multiple citation entries is a book chapter? Or, does it mean something entirely different?
  • book and chapter are two item types.
    What this line means is - test if the one item that csl is formatting (and it always goes one by one, all the if commands refer to just one item) - is either a "book" or a "book section" (the latter being "chapter" in csl).
    So whatever follows will only be applied to books and and book sections.
  • so, "match" is basically matching the left hand side of the equal sign following "if," with a list on the right hand side.
    Is that right?
    Thank you.
  • If I understand you correctly - yes.
    You don't need a match command in all cases - e.g.
    if type="book"
    works without any match.

    But then if you want to say - "if an item is not a book", you can do
    if type="book" match="none"

    or as in the example above, if something applies to a whole list of items you do
    if type="book chapter article-journal" match="any"
  • thanks for the clarification. I have a related issue.
    I am trying to distinguish between two types of report: report and working paper. For working paper, I want to put some string in te "Extra" field. Now when I try:
    <else-if type="report">
    <choose>
    <if variable="extra">
    <text variable="title" font-style="italic"/>
    </if>
    <else>
    <text variable="title" quotes="true"/>
    </else>
    </choose>
    </else-if>

    It won't work. I tried <if variable="extra" match="none"> then the else branch won't work!
    Thank you.
  • "extra" is not the right name for the variable (it's not the name of any variable, which is why this doesn't work ;-)). Extra is mapped to "note" - that should work.
    (the whole list of mappings is here:
    http://www.zotero.org/support/dev/csl_syntax_summary#variables )
  • thanks many.
    I have achieved all that I targeted, for now. One little thing, for conferences is there any way to add a conference end date. I put "2003/9/7" in the date field and get it as "September 7" in the right place. However, I would like to see "September 7-9"
    Any way to do that, at this point.
    Thanks again
  • nope, date ranges aren't supported atm.
Sign In or Register to comment.