Report ID 1635808036
I am trying to use the Environment and Urbanisation style but the document reports an error. I would be grateful for any support
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.
@dstillman, @adamsmith: There are some issues here. The preview on zotero.org/styles is also broken, and as far as I can tell it has been since the style was first released. (I ran a test over the style using the processor code in use when it was first checked in [January 2016], and it crashed there as well).
I've added a fix for the crashing error, but the style applies an odd disambiguation pattern that the processor cannot (and will not) handle. The pattern boils down to this:
<if position="subsequent">
<group delimiter=", ">
<text prefix="See reference " variable="first-reference-note-number"/>
<choose>
<if disambiguate="true">
<text macro="contributors-short"/>
</if>
</choose>
<choose>
<if disambiguate="true">
<text variable="title"/>
</if>
</choose>
</group>
</if>
The crash was triggered by the second
disambiguate="true"
conditional (for some reason that I haven't taken the trouble to pinpoint), but the underlying cause was the call to thecontributors-short
macro within the scope of the first condition. That call raises issues that I won't attempt to work around.The processor applies disambiguation rules in sequence until a set of references either resolve or fail to disambiguate, as per the CSL Specification. The sequence is:
- Show more names
- Expand names (adding initials or full given names)
- Add a year-suffix
- Render the cite with the
The processor does not follow these rules precisely, butdisambiguate
attribute ofcs:choose
conditions testing “true”disambiguate
conditions are applied after adding and expanding names. Therefore, at the stage where thedisambiguate
condition is triggered, there are no further name operations to be performed, and as a result, adding and expanding names beyond the baseline requirements of theet-al-min
andet-al-use-first
attributes will never occur in this style. It's a limitation of the CSL logic that actually makes pretty good sense.While the style does need some form of disambiguation to function correctly, the style guide does not give any guidance on the rules that should be applied, so it looks like there should be leeway to just adjust the code of the style to avoid the chicken-and-egg problem described above.
1. Print the first reference note number
2. If that's ambiguous, add the short author names
3. If those are ambiguous, add the title
Am I understanding correctly that that the two consecutive disambiguate tests would be fine, but the problem is that the contributors-short macro is also subject to "disambiguate-add-names", which would typically precede the test in which it is embedded, thus causing havoc?
Are you asking for advice on what citeproc-js should do here? I think ideally it would not apply other disambiguation inside if-disambiguate="true", but any other clear-cut solution is fine, too.
Commit: https://github.com/Juris-M/citeproc-js/commit/12125e379c6f82bbc138dd674da9460412f818a2
Source: https://github.com/Juris-M/citeproc-js