Help with United Nations style

Hi everyone,
I created a custom style that follows the guidelines of the United Nations (well, mostly). It's a work in progress but I'm stuck on one specific requirement. When citing UN published works, we must append "Sales No. #.##.##.##.#" to the end of the citation.

Since the UN publication can be of different types (book, chapter, report, etc), I can't use the publication type as a conditional. I used to test against the existence of anything in 'note' (the extra field). But since "extra" is used for so many things, I wanted to improve on this.

I read the documentation for using the "extra" field (https://www.zotero.org/support/kb/item_types_and_fields#citing_fields_from_extra).

Here is the point: The "extra" field may have multiple entries as shown the example:
DOI: 10.1128/AEM.02591-07
Original Date: 1824
PMCID: PMC3531190

Using this example, I want to add one using this format:

DOI: 10.1128/AEM.02591-07
Original Date: 1824
PMCID: PMC3531190
Sales No.: #.##.##.##.#

In my style I want to test for and use only the "Sales No." in a conditional. Is there a way to do this in CSL? Or is there a smarter way to achieve this?

Thanks!
  • Those examples you found that can be input into the extra field are all CSL variables. That's why you can request them with a style, even if Zotero doesn't have that metadata field for a specific item.

    So, you cannot just "invent" new CSL variables.

    However, could you use "number: #.##.##.##.#"?
    That's the number you see for item type report.

    Also, you'll find this handy: https://aurimasv.github.io/z2csl/typeMap.xml
  • edited May 3, 2023
    Thanks @damnation. This answers my question (not possible to invent variables), but unfortunately I'm not closer to solving my problem.

    The specific UN formatting is triggered by the author/publisher being the UN, not by item type. This is why I'm having a difficult time. I need a conditional that would be specific to the UN alone and that would trigger a specific UN-only format for all types (books, reports, UN resolutions, etc).
  • You need to find something or a combination of things (is type 1, 2, 3 and has variable 1, 2, 3) that is UNIQUE for the UN items...

    Sadly we cannot test for the actual content of variables.
  • @brazuca were you ever able to figure out this issue? Or create a style that follows the UN guidelines? Having a similar issue but don't have a any experience creating custom citation styles so am quite lost
Sign In or Register to comment.