Expected behaviour for is-numeric?
Hi
I have the following code in my style
<macro name="edition-note">
<choose>
<if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="any">
<choose>
<if is-numeric="edition">
<group delimiter=" ">
<number variable="edition" form="ordinal"/>
<text term="edition" form="short" prefix="$$"/>
</group>
</if>
<else>
<text variable="edition" text-case="capitalize-first" suffix="££"/>
</else>
</choose>
</if>
</choose>
</macro>
The $ and £ symbols were to help me localize the problem. If the Zotero edition field is 'annotated' (no quotes in Zotero) the output is:
Robert Oresko, G.C. Gibbs, and H.M. Scott (eds), Royal and Republican Sovereignty in Early Modern Europe: Essays in Memory of Ragnhild Hatton (Annotated££, Cambridge, 1997) p. 97.
If the Zotero edition field is 'annotated edition' (no quotes in Zotero) the output is:
Robert Oresko, G.C. Gibbs, and H.M. Scott (eds), Royal and Republican Sovereignty in Early Modern Europe: Essays in Memory of Ragnhild Hatton (annotated $$ed., Cambridge, 1997) p. 97.
The are no numbers in the edition field but the is-numeric test resolves to true. Is this expected. Any way round it to get the result 'Annotated edition'
Thanks
Ken
I have the following code in my style
<macro name="edition-note">
<choose>
<if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="any">
<choose>
<if is-numeric="edition">
<group delimiter=" ">
<number variable="edition" form="ordinal"/>
<text term="edition" form="short" prefix="$$"/>
</group>
</if>
<else>
<text variable="edition" text-case="capitalize-first" suffix="££"/>
</else>
</choose>
</if>
</choose>
</macro>
The $ and £ symbols were to help me localize the problem. If the Zotero edition field is 'annotated' (no quotes in Zotero) the output is:
Robert Oresko, G.C. Gibbs, and H.M. Scott (eds), Royal and Republican Sovereignty in Early Modern Europe: Essays in Memory of Ragnhild Hatton (Annotated££, Cambridge, 1997) p. 97.
If the Zotero edition field is 'annotated edition' (no quotes in Zotero) the output is:
Robert Oresko, G.C. Gibbs, and H.M. Scott (eds), Royal and Republican Sovereignty in Early Modern Europe: Essays in Memory of Ragnhild Hatton (annotated $$ed., Cambridge, 1997) p. 97.
The are no numbers in the edition field but the is-numeric test resolves to true. Is this expected. Any way round it to get the result 'Annotated edition'
Thanks
Ken
See also http://rst.projectfondue.com/api/v1/rst2html/?rst_url=https://raw.github.com/citation-style-language/documentation/master/release-notes-CSL-1.0.1.txt&css_url=http://citation-style-language.github.com/styles/css/screen.css&output_type=html&callback=&document_output=whole&highlight_style=manni#numbers
Not just me missing something obvious then.
annotated edition
(I put a normal space and zero-width space between "annotated" and "edition"; this prevents citeproc-js from recognizing the "edition" part. See also http://en.wikipedia.org/wiki/Zero-width_space )
Thanks again
I've tightened up the conditions applied for is-numeric evaluation, and "annotated edition" will now correctly return false.
The offending code was a ham-fisted attempt to deal with weird strings describing editions which sometimes should be adapted to style requirements. I now know that the right way to do that is through an abbreviations engine (which wasn't fully implemented in the processor until fairly recently). I've fixed the code to apply external abbreviations, if available, to numeric content when rendering is-numeric=false strings. (No need to worry about this for the immediate use case.)
@knewmans: If you want to try out the new behaviour immediately, you can do so by installing this plugin. Its only effect is to swap in the more recent processor version. You can remove the plugin when Zotero 3.0.9 comes out, which will contain the new processor.