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>
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>
Meanwhile I can upload this one for you.
Thanks again!
No inconvenience, thanks for the contribution.
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.
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.
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 ;-)
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>
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!
http://www.zotero.org/support/dev/creating_citation_styles#the_zotero_style_repository
http://forums.zotero.org/discussion/4924/journal-of-the-royal-anthropological-institute/?Focus=21340#Comment_21340