Huw to submit a new csl style?

Using the zotero reference test pane (chrome://zotero/content/tools/csledit.xul) and building from one of the existing styles, I have created a csl style for an evolutionary journal (J. Evol Biol). That was pretty simple (since it reminds me of html editing), but since I have no background whatsoever in programming, I have no idea what to do next (ok, in the dev forum it says I shall validate it and then submit it to the database, and I have no idea even what that mean...)

However, if anyone who have the knowledge and skill to do anything useful with a fully functional csl style for a journal not yet existing among the zotero styles, you can take over from now. I have left the <id> and <link> field with questionmarks, since they seem to refer to the location of the style, which I have no idea about.

Have fun, and I hope this one will be useful. I can submit more evolutionary/ecological styles in the future if anyone can help me share them with the community...

Rgeards
Martin
----------------------------

<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" xml:lang="en">
<info>
<title>Journal of Evolutionary Biology</title>
<id>??????????????????</id>
<link>???????????????????</link>
<author>
<name>Martin Lind</name>
<email>martin.lind@emg.umu.se</email>
</author>
<category term="biology"/>
<category term="generic-base"/>
<updated>2008-01-16T17:41:10+00:00</updated>
</info>
<macro name="editor-translator">
<names variable="editor translator" prefix="(" suffix=")" delimiter=", ">
<name and="symbol" initialize-with=". " delimiter=", "/>
<label form="short" prefix=", " text-transform="capitalize" suffix="."/>
</names>
</macro>
<macro name="author">
<names variable="author">
<name name-as-sort-order="all" and="symbol" sort-separator=", " initialize-with=". "
delimiter=", " delimiter-precedes-last="always"/>
<label form="short" prefix=" (" suffix=".)" text-transform="capitalize"/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text macro="title"/>
</substitute>
</names>
</macro>
<macro name="author-short">
<names variable="author">
<name form="short" and="symbol" delimiter=", " initialize-with=". "/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<choose>
<if type="book">
<text variable="title" form="short" font-style="italic"/>
</if>
<else>
<text variable="title" form="short" quotes="true"/>
</else>
</choose>
</substitute>
</names>
</macro>
<macro name="access">
<group>
<text term="retrieved" text-transform="capitalize" suffix=" "/>
<date variable="accessed" suffix=", ">
<date-part name="month" suffix=" "/>
<date-part name="day" suffix=", "/>
<date-part name="year"/>
</date>
<group>
<text term="from" suffix=" "/>
<text variable="URL"/>
</group>
</group>
</macro>
<macro name="title">
<choose>
<if type="book">
<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>
<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"/>
<layout prefix="(" suffix=")" delimiter="; ">
<text macro="author-short"/>
<date variable="issued" prefix=", ">
<date-part name="year"/>
</date>
<label variable="locator" prefix=", " suffix="." form="short"/>
<text variable="locator" prefix=" "/>
</layout>
</citation>
<bibliography>
<option name="hanging-indent" value="true"/>
<option name="sort-algorithm" value="author-date"/>
<option name="et-al-min" value="15"/>
<option name="et-al-use-first" value="15"/>
<layout>
<text macro="author" suffix="."/>
<date variable="issued" prefix=" " suffix=".">
<date-part name="year"/>
</date>
<choose>
<if type="book">
<group suffix=".">
<text macro="title" prefix=" "/>
<text macro="editor-translator" prefix=" "/>
</group>
<text prefix=" " suffix="." macro="publisher"/>
</if>
<else-if type="chapter">
<text macro="title" prefix=" "/>
<group class="container" prefix=". ">
<text term="in" text-transform="capitalize"/>
<names variable="editor translator" prefix=" " suffix="," delimiter=", ">
<name and="symbol" sort-separator=", " initialize-with=". "/>
<label form="short" prefix=" (" suffix=".)" text-transform="capitalize"/>
</names>
<text variable="container-title" font-style="italic" prefix=" " suffix="."/>
<text variable="collection-title" prefix=" " suffix="."/>
<group suffix=".">
<text macro="publisher" prefix=" "/>
<group prefix=" (" suffix=")">
<label variable="page" form="short" suffix=". "/>
<text variable="page"/>
</group>
</group>
</group>
</else-if>
<else>
<group suffix=".">
<text macro="title" prefix=" "/>
<text macro="editor-translator" prefix=" "/>
</group>
<group class="container" prefix=" " suffix=".">
<text variable="container-title" font-style="italic"/>
<group prefix=" ">
<text variable="volume" font-weight="bold"/>

</group>
<text variable="page" prefix=": "/>
</group>
</else>
</choose>
<text prefix=" " macro="access"/>
</layout>
</bibliography>
</style>
  • You can register for an account to upload these via SVN - via this page https://www.zotero.org/dev/trac_access

    Meanwhile I can upload this one for you.
  • Thanks a lot, I'll try that out! Sorry for the inconvenience caused, but I felt lika an extreme idiot when I was reading the dev forum...

    Thanks again!
  • OK - I fixed up a couple of errors and added the missing parts and its submitted now.
    No inconvenience, thanks for the contribution.
  • As a general principle, I'm encouraging people to rely more on well-designed macros. The latest dev version of APA reflects what I'm talking about, and I encourage people to model their styles on that.

    One of the reasons for this is to build up a stock of good macros that can be more easily reused, including in a style creation wizard.
  • Good tip! I´ll base further styles on that one, as I said Im not a programmer at all, so I cant see the difference between good and bad macros when Im copying another style. Im apologise and I'll try to remake my jeb-style following apa this time.

    And, of course, if Im just messing up the project by writing bad code, just tell me and I'll stop, thats no problem.

    Thanks again for the help with submitting the style Codec, and for the tip of using Apa as my startpoint when making new styles Bdarcus! Its really good that you informed me what style to base my future ecological&evolutionary styles upon, since I do not have the skill to see the difference between them in how welll designed the macros are.
  • edited January 16, 2008
    No, no; don't worry. Any contribution is a good contribution. I was just mentioning this for anybody that might be interested.

    Good code vs. bad code?

    To keep it simple: good code does the most amount of work with the least amount of code.

    By using macros, for example, you only have to write the rules for that chunk once. If you find that the macro you've written doesn't work in some context, then you enhance the macro so it does.

    By confining the actual formatting logic to the macros, you're creating styles that are easier to enhance and debug and, as I said, allowing us to extract those macros for use in other styles.

    It's really not any more complicated than that. I'm not much of a programmer either ;-)
  • Thanks for adding my style. I have now updated it (completely rewritten based upon APA 8dev) as recommended above. I have also signed up for a TRAC account, (as described above) but I failed completely to find how to update my existing style jeb (dev). So I post it here again, if someone can replace the old one with this new one you're welcome!

    The style has a known bug, which is belived to be a bug in zotero, it sorts references within a bracket in the text according to authors, even though I have specified that it shall sort according to issued. I have submitted a bug report to zotero.
    -----------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <?oxygen RNGSchema="http://xbiblio.svn.sourceforge.net/viewvc/*checkout*/xbiblio/csl/schema/trunk/csl.rnc" type="compact"?>
    <style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" xml:lang="en">
    <info>
    <title>Journal of Evolutionary Biology (dev)</title>
    <id>http://www.zotero.org/styles/jeb</id>;
    <link href="http://www.zotero.org/styles/jeb"/>
    <author>
    <name>Martin Lind</name>
    <email>martin.lind@emg.umu.se</email>
    </author>
    <category term="biology"/>
    <category term="generic-base"/>
    <updated>2008-02-20T09:41:30+00:00</updated>
    </info>
    <macro name="editor-translator">
    <names variable="editor translator" delimiter=", ">
    <name and="symbol" initialize-with=". " delimiter=", "/>
    <label form="short" prefix=" (" text-case="capitalize-first" suffix=".)"/>
    </names>
    </macro>
    <macro name="author">
    <names variable="author">
    <name name-as-sort-order="all" and="symbol" sort-separator=", "
    initialize-with=". " delimiter=", " delimiter-precedes-last="never"/>
    <label form="short" prefix=" (" suffix=".)" text-case="capitalize-first"/>
    <substitute>
    <names variable="editor"/>
    <names variable="translator"/>
    <text macro="title"/>
    </substitute>
    </names>
    </macro>
    <macro name="author-short">
    <names variable="author">
    <name form="short" and="symbol" delimiter=", " initialize-with=". "/>
    <substitute>
    <names variable="editor"/>
    <names variable="translator"/>
    <choose>
    <if type="book">
    <text variable="title" form="short" font-style="italic"/>
    </if>
    <else>
    <text variable="title" form="short" quotes="true"/>
    </else>
    </choose>
    </substitute>
    </names>
    </macro>
    <macro name="access">
    <choose>
    <if variable="DOI">
    <text variable="DOI" prefix="doi: "/>
    </if>
    <else>
    <group>
    <text term="retrieved" text-case="capitalize-first" suffix=" "/>
    <date variable="accessed" suffix=", ">
    <date-part name="month" suffix=" "/>
    <date-part name="day" suffix=", "/>
    <date-part name="year"/>
    </date>
    <group>
    <text term="from" suffix=" "/>
    <text variable="URL"/>
    </group>
    </group>
    </else>
    </choose>
    </macro>
    <macro name="title">
    <choose>
    <if type="book">
    <text variable="title" text-case="sentence" font-style="italic"/>
    </if>
    <else>
    <text variable="title" text-case="sentence"/>
    </else>
    </choose>
    </macro>
    <macro name="publisher">
    <group delimiter=": ">
    <text variable="publisher-place"/>
    <text variable="publisher"/>
    </group>
    </macro>
    <macro name="event">
    <text variable="event"/>
    <text variable="event-place" prefix=", "/>
    </macro>
    <macro name="issued">
    <group prefix=" (" suffix=").">
    <date variable="issued">
    <date-part name="year"/>
    </date>
    <choose>
    <if type="book chapter article-journal" match="none">
    <date variable="issued">
    <date-part prefix=", " name="month"/>
    <date-part prefix=" " name="day"/>
    </date>
    </if>
    </choose>
    </group>
    </macro>
    <macro name="issued-year">
    <date variable="issued">
    <date-part name="year"/>
    </date>
    </macro>
    <macro name="citation-locator">
    <group>
    <label variable="locator" include-period="true" form="short"/>
    <text variable="locator" prefix=" "/>
    </group>
    </macro>
    <macro name="container-prefix">
    <choose>
    <if type="chapter">
    <text term="in" text-case="capitalize-first" suffix=" "/>
    </if>
    </choose>
    </macro>
    <macro name="pages">
    <choose>
    <if type="chapter">
    <group prefix=" (" suffix=")">
    <label variable="page" form="short" include-period="true" suffix=" "/>
    <text variable="page"/>
    </group>
    </if>
    <else>
    <text variable="page" prefix=" "/>
    </else>
    </choose>
    </macro>
    <macro name="edition">
    <text variable="edition"/>
    </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="false"/>
    <option name="disambiguate-add-givenname" value="false"/>
    <option name="collapse" value="year"/>
    <sort>
    <key macro="issued"/>
    <key variable="author"/>
    </sort>
    <layout prefix="(" suffix=")" delimiter="; ">
    <group delimiter=", ">
    <text macro="author-short"/>
    <text macro="issued-year"/>
    <text macro="citation-locator"/>
    </group>
    </layout>
    </citation>
    <bibliography>
    <option name="hanging-indent" value="true"/>
    <option name="et-al-min" value="15"/>
    <option name="et-al-use-first" value="15"/>
    <sort>
    <key macro="author"/>
    <key variable="issued"/>
    </sort>
    <layout suffix=".">
    <text macro="author" suffix="."/>
    <text macro="issued"/>
    <text macro="title" prefix=" "/>
    <text macro="container-prefix" prefix=" "/>
    <text macro="editor-translator" prefix=" "/>
    <text variable="container-title" prefix=", " font-style="italic"/>
    <text variable="collection-title" prefix=", " suffix="."/>
    <text macro="edition" prefix=" (" suffix=")"/>
    <text variable="volume" prefix=". " font-weight="bold"/>
    <text macro="pages" prefix=":"/>
    <text macro="publisher" prefix=", "/>
    <text macro="access" prefix=". " />
    </layout>
    </bibliography>
    </style>
  • Hi,
    I might be dumb (or tired) but I cannot see how to submit a new style (just modified from the APSA style) on the Repository. I have a trac account but I am consuming my eyes to find the way to upload my style...
    Can someone help?
    Thanks!
Sign In or Register to comment.