Style not working anymore after Zotero update

Hi,

after updating to the newest version of zotero, some of my created styles do not work anymore and give the error:
"Error parsing style:
CSL style error: undefined macro "issued-year""


Can anyone help me out with a hint on what the problem might be?

Kind regards,
Dennis

Style:

<?xml version="1.0" encoding="UTF-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" xml:lang="en" class="in-text" >
<info>
<title>TestStyle</title>
<id>http://www.zotero.org/styles/teststyle</id>;
<link href="http://www.zotero.org/styles/teststyle"/>
<author>
<name>Test</name>
<email>Testmail@test.de</email>
</author>

<category term="author-date"/>
<category term="generic-base"/>
<updated>2010-10-26T21:20:42+00:00</updated>
<summary>Test Style</summary>
<link href="http://www.zotero.org/styles/teststyle" rel="documentation"/>
</info>
<macro name="editor">
<names variable="editor" delimiter=", ">
<name and="text" initialize-with=". " delimiter=", "/>
<label form="short" prefix=", " text-case="lowercase" suffix="."/>
</names>
</macro>
<macro name="editor2">
<names variable="editor">
<name sort-separator=", " initialize-with="." name-as-sort-order="all" delimiter=", " delimiter-precedes-last="always"/>
<label form="short" prefix=" (" suffix=")," text-case="capitalize-first"/>
</names>
</macro>
<macro name="anon">
<text term="anonymous" form="short" text-case="capitalize-first"/>
</macro>
<macro name="author">
<names variable="author">
<name name-as-sort-order="all" sort-separator=", " initialize-with=". "
delimiter-precedes-last="always" delimiter="; "/>
<label form="short" prefix=" " suffix="." text-case="lowercase"/>
<substitute>
<names variable="editor"/>
<text macro="anon"/>
</substitute>
</names>
</macro>
<macro name="author-short">
<names variable="author">
<name form="short" and="text" delimiter=", " delimiter-precedes-last="never" initialize-with=". "/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text macro="anon"/>
</substitute>
</names>
</macro>
<macro name="access">
<group>
<text value="Available at:" suffix=" "/>
<text variable="URL"/>
<group prefix=" [" suffix="]">
<text term="accessed" text-case="capitalize-first" suffix=" "/>
<date variable="accessed">
<date-part name="month" suffix=" "/>
<date-part name="day" suffix=", "/>
<date-part name="year"/>
</date>
</group>
</group>
</macro>
<macro name="title">
<choose>
<if type="book thesis" match="any">
<text variable="title" font-style="italic"/>
</if>
<else>
<text variable="title"/>
</else>
</choose>
</macro>
<macro name="publisher">
<group delimiter=": ">
<text variable="publisher-place"/>
<text variable="publisher"/>
</group>
</macro>
<macro name="year-date">
<choose>
<if variable="issued">
<date variable="issued">
<date-part name="year"/>
</date>
</if>
<else>
<text term="no date"/>
</else>
</choose>
</macro>
<macro name="edition">
<choose>
<if is-numeric="edition">
<group delimiter=" ">
<number variable="edition" form="ordinal" prefix="("/>
<text term="edition" form="short" suffix=".)"/>
</group>
</if>
<else>
<text variable="edition" suffix="."/>
</else>
</choose>
</macro>
<macro name="pages">
<group>
<label variable="page" form="short" include-period="true" suffix=" "/>
<text variable="page"/>
</group>
</macro>
<citation>
<option name="et-al-min" value="3"/>
<option name="et-al-use-first" value="1"/>
<option name="et-al-subsequent-min" value="3"/>
<option name="et-al-subsequent-use-first" value="1"/>
<option name="disambiguate-add-year-suffix" value="true"/>
<option name="disambiguate-add-names" value="true"/>
<!-- <option name="disambiguate-add-givenname" value="true"/> -->
<sort>
<key macro="author"/>
<key macro="issued-year"/>
</sort>
<layout prefix="(" suffix=")" delimiter="; ">
<group delimiter=", ">
<group delimiter=" ">
<text macro="author-short"/>
<text macro="year-date"/>
</group>
<group>
<label variable="locator" suffix=". " form="short"/>
<text variable="locator"/>
</group>
</group>
</layout>
</citation>
<bibliography>
<option name="hanging-indent" value="true"/>
<option name="et-al-min" value="6"/>
<option name="et-al-use-first" value="1"/>
<sort>
<key macro="author"/>
<key variable="title"/>
</sort>
<layout>
<text macro="author" suffix=""/>
<date variable="issued" prefix=" (" suffix="):">
<date-part name="year"/>
</date>
<choose>
<if type="book">
<group prefix=" " delimiter=" " suffix=",">
<text macro="title" />
<text macro="edition"/>
<text macro="editor"/>
</group>
<text variable="container-title" font-style="italic" suffix=","/>
<text variable="collection-title" prefix=" " suffix=","/>
<text prefix=" " suffix="." macro="publisher"/>
</if>
<else-if type="chapter">
<text macro="title" prefix=" " suffix="."/>
<group class="container" prefix=" " delimiter=" ">
<text term="in" text-case="capitalize-first" suffix=":"/>
<text macro="editor2" />
<text variable="container-title" font-style="italic" suffix=","/>
<text variable="collection-title" suffix="."/>
<group suffix="." delimiter=", ">
<text macro="publisher" prefix=""/>
<text macro="pages" />
</group>
</group>
</else-if>
<else-if type="thesis">
<group prefix=" " suffix="," delimiter=". ">
<text macro="title"/>
<text variable="genre"/>
<text macro="publisher"/>
</group>
</else-if>
<else>
<group suffix=".">
<text macro="title" prefix=" " quotes="false" />
<text macro="editor" prefix=" "/>
</group>
<group class="container" prefix=" " suffix=".">
<text variable="container-title" font-style="italic"/>
<group prefix=" ">
<text variable="volume" prefix="(" />
<text variable="issue" prefix=":" suffix=")"/>
</group>
<group prefix=", ">
<label variable="locator" suffix="." form="short"/>
<text macro="pages" />
</group>
</group>
</else>
</choose>
<text prefix=" " macro="access" suffix="."/>
</layout>
</bibliography>
</style>
  • The error message means just what it says. You need to define that macro.
  • Thanks for the quick reply.
    But it worked just fine before the update of zotero...
  • The previous processor might not have raised an error, but the style was invalid just the same; there is no way that that code can could have sorted citations by date if authors were identical. If you want to sort on that condition, you need to provide a key.
  • edited March 28, 2011
    Thank you for the reply.
    That is really weird, since it also affects sorting of my citations.

    I would like the in text citations to sort authors first by author and if there are two of the same author then sort them by year of publication.

    Based on your comment I have changed the sorting part to:

    <sort>
    <key macro="author"/>
    <key variable="issued"/>
    </sort>

    This fixes the error message, but does not resolve my sorting issue.
    Do you have any hints?

    Thanks and kind regards,
    DEnnis
  • can you detect how it affects sorting?
  • its really weird. my fix above does seem to work for most of the citations. Right now I only have two papers from one identical author that are not sorted the right way. I cannot find out why though. I think we can mark this issue as resolved, since it does not work for only one author in my collection but all others seem fine. I'll post again if I find out more.

    Thank you and kind regards,
    Dennis
  • If you have time,Can you post the bibliography entries corresponding to the citations that don't sort correctly? It would be good to satisfy ourselves of the cause of the mistaken sort, or fix any underlying problem that might be causing it.
  • I just copy the export of the two wrong citations of that author below
    and also the style I am using right now. From my collection in a multi-citation it puts the 2009 citation first and also does not sort the bibliography in ascending order.
    I was expecting it to sort both ascending, as it does with all other citations.

    CITATION EXPORT:

    <rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:z="http://www.zotero.org/namespaces/export#"
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:prism="http://prismstandard.org/namespaces/1.2/basic/"
    xmlns:bib="http://purl.org/net/biblio#"
    xmlns:foaf="http://xmlns.com/foaf/0.1/"
    xmlns:link="http://purl.org/rss/1.0/modules/link/">
    <bib:Article rdf:about="#item_599">
    <z:itemType>journalArticle</z:itemType>
    <dcterms:isPartOf>
    <bib:Journal>
    <dc:title>Long Range Planning</dc:title>
    <prism:volume>43</prism:volume>
    <prism:number>1</prism:number>
    </bib:Journal>
    </dcterms:isPartOf>
    <bib:authors>
    <rdf:Seq>
    <rdf:li>
    <foaf:Person>
    <foaf:surname>Teece</foaf:surname>
    <foaf:givenname>D. J</foaf:givenname>
    </foaf:Person>
    </rdf:li>
    </rdf:Seq>
    </bib:authors>
    <link:link rdf:resource="#item_598"/>
    <dc:subject>#B</dc:subject>
    <dc:subject>_LRP</dc:subject>
    <dc:subject>BM</dc:subject>
    <dc:subject>Innovation</dc:subject>
    <dc:subject>Unterschied BM Strategie</dc:subject>
    <dc:title>Business Models, Business Strategy and Innovation</dc:title>
    <bib:pages>172-194</bib:pages>
    <dc:date>2009</dc:date>
    <z:libraryCatalog>Google Scholar</z:libraryCatalog>
    </bib:Article>
    <z:Attachment rdf:about="#item_598">
    <z:itemType>attachment</z:itemType>
    <dc:title>Business_Models_Business_Strategy_and_Innovation_TEECE_LRP#B_2010_A.pdf</dc:title>
    <link:type>application/pdf</link:type>
    </z:Attachment>
    <bib:Article rdf:about="http://dx.doi.org/10.1002/smj.640">
    <z:itemType>journalArticle</z:itemType>
    <dcterms:isPartOf rdf:resource="urn:issn:1097-0266"/>
    <bib:authors>
    <rdf:Seq>
    <rdf:li>
    <foaf:Person>
    <foaf:surname>Teece</foaf:surname>
    <foaf:givenname>David J.</foaf:givenname>
    </foaf:Person>
    </rdf:li>
    </rdf:Seq>
    </bib:authors>
    <link:link rdf:resource="#item_732"/>
    <dc:subject>business ecosystems</dc:subject>
    <dc:subject>cospecialization</dc:subject>
    <dc:subject>entrepreneurship</dc:subject>
    <dc:subject>global competitiveness</dc:subject>
    <dc:subject>Innovation</dc:subject>
    <dc:subject>intangible assets</dc:subject>
    <dc:subject>managerial capitalism</dc:subject>
    <dc:title>Explicating Dynamic Capabilities: The Nature and Microfoundations of Enterprise Performance</dc:title>
    <bib:pages>1319-1350</bib:pages>
    <dc:date>2007</dc:date>
    <dc:identifier>
    <dcterms:URI>
    <rdf:value>http://dx.doi.org/10.1002/smj.640</rdf:value>;
    </dcterms:URI>
    </dc:identifier>
    </bib:Article>
    <bib:Journal rdf:about="urn:issn:1097-0266">
    <dc:title>Strategic Management Journal</dc:title>
    <prism:volume>28</prism:volume>
    <prism:number>13</prism:number>
    <dcterms:alternative>Strat. Mgmt. J.</dcterms:alternative>
    <dc:identifier>DOI 10.1002/smj.640</dc:identifier>
    <dc:identifier>ISSN 1097-0266</dc:identifier>
    </bib:Journal>
    <z:Attachment rdf:about="#item_732">
    <z:itemType>attachment</z:itemType>
    <dc:title>smj.640</dc:title>
    <dcterms:dateSubmitted>2010-11-30 20:03:00</dcterms:dateSubmitted>
    <dc:identifier>
    <dcterms:URI>
    <rdf:value>http://dx.doi.org/10.1002/smj.640</rdf:value>;
    </dcterms:URI>
    </dc:identifier>
    </z:Attachment>
    </rdf:RDF>
  • ------

    STYLE EXPORT:



    <?xml version="1.0" encoding="UTF-8"?>
    <style xmlns="http://purl.org/net/xbiblio/csl" xml:lang="en" class="in-text" >
    <info>
    <title>test</title>
    <id>http://www.zotero.org/styles/test</id>;
    <link href="http://www.zotero.org/styles/test"/>
    <author>
    <name>Test</name>
    <email>test@test.com</email>
    </author>

    <category term="author-date"/>
    <category term="generic-base"/>
    <updated>2010-10-26T21:20:42+00:00</updated>
    <summary>test</summary>
    <link href="http://www.zotero.org/styles/test" rel="documentation"/>
    </info>
    <macro name="editor">
    <names variable="editor" delimiter=", ">
    <name and="text" initialize-with=". " delimiter=", "/>
    <label form="short" prefix=", " text-case="lowercase" suffix="."/>
    </names>
    </macro>
    <macro name="editor2">
    <names variable="editor">
    <name sort-separator=", " initialize-with="." name-as-sort-order="all" delimiter=", " delimiter-precedes-last="always"/>
    <label form="short" prefix=" (" suffix=")," text-case="capitalize-first"/>
    </names>
    </macro>
    <macro name="anon">
    <text term="anonymous" form="short" text-case="capitalize-first"/>
    </macro>
    <macro name="author">
    <names variable="author">
    <name name-as-sort-order="all" sort-separator=", " initialize-with=". "
    delimiter-precedes-last="always" delimiter="; "/>
    <label form="short" prefix=" " suffix="." text-case="lowercase"/>
    <substitute>
    <names variable="editor"/>
    <text macro="anon"/>
    </substitute>
    </names>
    </macro>
    <macro name="author-short">
    <names variable="author">
    <name form="short" and="text" delimiter=", " delimiter-precedes-last="never" initialize-with=". "/>
    <substitute>
    <names variable="editor"/>
    <names variable="translator"/>
    <text macro="anon"/>
    </substitute>
    </names>
    </macro>
    <macro name="access">
    <group>
    <text value="Available at:" suffix=" "/>
    <text variable="URL"/>
    <group prefix=" [" suffix="]">
    <text term="accessed" text-case="capitalize-first" suffix=" "/>
    <date variable="accessed">
    <date-part name="month" suffix=" "/>
    <date-part name="day" suffix=", "/>
    <date-part name="year"/>
    </date>
    </group>
    </group>
    </macro>
    <macro name="title">
    <choose>
    <if type="book thesis" match="any">
    <text variable="title" font-style="italic"/>
    </if>
    <else>
    <text variable="title"/>
    </else>
    </choose>
    </macro>
    <macro name="publisher">
    <group delimiter=": ">
    <text variable="publisher-place"/>
    <text variable="publisher"/>
    </group>
    </macro>
    <macro name="year-date">
    <choose>
    <if variable="issued">
    <date variable="issued">
    <date-part name="year"/>
    </date>
    </if>
    <else>
    <text term="no date"/>
    </else>
    </choose>
    </macro>
    <macro name="edition">
    <choose>
    <if is-numeric="edition">
    <group delimiter=" ">
    <number variable="edition" form="ordinal" prefix="("/>
    <text term="edition" form="short" suffix=".)"/>
    </group>
    </if>
    <else>
    <text variable="edition" suffix="."/>
    </else>
    </choose>
    </macro>
    <macro name="pages">
    <group>
    <label variable="page" form="short" include-period="true" suffix=" "/>
    <text variable="page"/>
    </group>
    </macro>
    <citation>
    <option name="et-al-min" value="3"/>
    <option name="et-al-use-first" value="1"/>
    <option name="et-al-subsequent-min" value="3"/>
    <option name="et-al-subsequent-use-first" value="1"/>
    <option name="disambiguate-add-year-suffix" value="true"/>
    <option name="disambiguate-add-names" value="true"/>
    <!-- <option name="disambiguate-add-givenname" value="true"/> -->
    <sort>
    <key macro="author"/>
    <key variable="issued"/>
    </sort>
    <layout prefix="(" suffix=")" delimiter="; ">
    <group delimiter=", ">
    <group delimiter=" ">
    <text macro="author-short"/>
    <text macro="year-date"/>
    </group>
    <group>
    <label variable="locator" suffix=". " form="short"/>
    <text variable="locator"/>
    </group>
    </group>
    </layout>
    </citation>
    <bibliography>
    <option name="hanging-indent" value="true"/>
    <option name="et-al-min" value="6"/>
    <option name="et-al-use-first" value="1"/>
    <sort>
    <key macro="author"/>
    <key variable="issued"/>
    </sort>
    <layout>
    <text macro="author" suffix=""/>
    <date variable="issued" prefix=" (" suffix="):">
    <date-part name="year"/>
    </date>
    <choose>
    <if type="book">
    <group prefix=" " delimiter=" " suffix=",">
    <text macro="title" />
    <text macro="edition"/>
    <text macro="editor"/>
    </group>
    <text variable="container-title" font-style="italic" suffix=","/>
    <text variable="collection-title" prefix=" " suffix=","/>
    <text prefix=" " suffix="." macro="publisher"/>
    </if>
    <else-if type="chapter">
    <text macro="title" prefix=" " suffix="."/>
    <group class="container" prefix=" " delimiter=" ">
    <text term="in" text-case="capitalize-first" suffix=":"/>
    <text macro="editor2" />
    <text variable="container-title" font-style="italic" suffix=","/>
    <text variable="collection-title" suffix="."/>
    <group suffix="." delimiter=", ">
    <text macro="publisher" prefix=""/>
    <text macro="pages" />
    </group>
    </group>
    </else-if>
    <else-if type="thesis">
    <group prefix=" " suffix="," delimiter=". ">
    <text macro="title"/>
    <text variable="genre"/>
    <text macro="publisher"/>
    </group>
    </else-if>
    <else>
    <group suffix=".">
    <text macro="title" prefix=" " quotes="false" />
    <text macro="editor" prefix=" "/>
    </group>
    <group class="container" prefix=" " suffix=".">
    <text variable="container-title" font-style="italic"/>
    <group prefix=" ">
    <text variable="volume" prefix="(" />
    <text variable="issue" prefix=":" suffix=")"/>
    </group>
    <group prefix=", ">
    <label variable="locator" suffix="." form="short"/>
    <text macro="pages" />
    </group>
    </group>
    </else>
    </choose>
    <text prefix=" " macro="access" suffix="."/>
    </layout>
    </bibliography>
    </style>
  • The reason is that the two authors aren't actually the same:
    one is David J. and the other D. J. - for Zotero these are two different people.
    It's possible now to sort by last name only, but probably not worth it (and might not be desirable when authors are actually different)- easier to just consolidate your database.
  • Argh, you are right. I did miss this. Thank you for this fantastic help.

    Kind regards,
    Dennis
Sign In or Register to comment.