Style for Journal of Anatomy
The Journal of Anatomy has a pretty simple citation style. I've got the bibliography done (using some features of CSL 1.0 like strip-periods), but in-text citations are a disaster. Example citations:
(Hannam, 1969; Hannam & Farnsworth, 1977; Larson et al. 1981; Byers, 1985; Loescher & Robinson, 1989; Linden, 1990a,b; Johnsen & Trulsson, 2003)
(Gathercole & Keller, 1982;
van Driel et al. 2000; Dorow et al. 2002, 2003; Nishihira
et al. 2003; Natali et al. 2004)
So far, I have:
(Alexander et al., 1979; Alexander, 1983a; 1983b; Gatesy & Biewener, 1991; Ryan & Rietbergen, 2005; Matsuoka et al., 2005; Turney et al., 2007; You et al., 2008; Dendorfer et al., 2009; Arganda-Carreras et al., 2010; Wolff, 2010aundefinedb)
The troublesome points are:
Sorting by author after sorting by year
Collapsing years into Jones, 2000a,b, 2002 style
Removing the comma after et al.
I'll put the current CSL in the next post.
(Hannam, 1969; Hannam & Farnsworth, 1977; Larson et al. 1981; Byers, 1985; Loescher & Robinson, 1989; Linden, 1990a,b; Johnsen & Trulsson, 2003)
(Gathercole & Keller, 1982;
van Driel et al. 2000; Dorow et al. 2002, 2003; Nishihira
et al. 2003; Natali et al. 2004)
So far, I have:
(Alexander et al., 1979; Alexander, 1983a; 1983b; Gatesy & Biewener, 1991; Ryan & Rietbergen, 2005; Matsuoka et al., 2005; Turney et al., 2007; You et al., 2008; Dendorfer et al., 2009; Arganda-Carreras et al., 2010; Wolff, 2010aundefinedb)
The troublesome points are:
Sorting by author after sorting by year
Collapsing years into Jones, 2000a,b, 2002 style
Removing the comma after et al.
I'll put the current CSL in the next post.
<style xmlns="http://purl.org/net/xbiblio/csl" xml:lang="en" class="in-text" >
<info>
<title>Journal of Anatomy </title>
<id>http://www.zotero.org/styles/janat</id>
<link href="http://www.zotero.org/styles/janat"/>
<author>
<name>Julian Onions</name>
<email>julian.onions@gmail.com</email>
</author>
<author>
<name>Michael Doube</name>
</author>
<category term="author-date"/>
<category term="generic-base"/>
<updated/>
<summary>The Journal of Anatomy style</summary>
<link href="http://www.wiley.com/bw/submit.asp?ref=0021-8782" rel="documentation"/>
<rights>This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/</rights>
</info>
<macro name="editor">
<names variable="editor" delimiter=", ">
<name and="symbol" initialize-with=". " delimiter=", "/>
<label form="short" prefix=", " text-case="lowercase" suffix="."/>
</names>
</macro>
<macro name="anon">
<text term="anonymous" form="short" text-case="capitalize-first"/>
</macro>
<macro name="author">
<names variable="author">
<name sort-separator=" " initialize-with="" name-as-sort-order="all"
delimiter=", " delimiter-precedes-last="always" />
<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="symbol"/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text macro="anon"/>
</substitute>
</names>
</macro>
<macro name="access">
<group>
<choose>
<if variable="DOI">
<text variable="DOI" prefix=" doi:"/>
</if>
<else>
<choose>
<if variable="URL">
<text variable="URL" prefix=" Available: " suffix="."/>
<group prefix=" " suffix=".">
<text term="accessed" text-case="capitalize-first" suffix=" "/>
<date variable="accessed">
<date-part name="day" suffix=" "/>
<date-part name="month" form="short" suffix=" "/>
<date-part name="year"/>
</date>
</group>
</if>
</choose>
</else>
</choose>
</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"/>
<text term="edition" form="short" suffix="."/>
</group>
</if>
<else>
<text variable="edition" suffix="."/>
</else>
</choose>
</macro>
<macro name="pages">
<text variable="page" page-range-format="expanded" suffix="."/>
</macro>
<citation>
<sort>
<key variable="issued" sort="ascending"/>
<key macro="author-short" sort="ascending" />
</sort>
<option name="et-al-min" value="3"/>
<option name="et-al-use-first" value="1"/>
<option name="disambiguate-add-year-suffix" value="true"/>
<option name="collapse" value="year-suffix" />
<option name="year-suffix-delimiter" value="," />
<layout prefix="(" suffix=")" delimiter="; ">
<group delimiter=", ">
<group delimiter=" ">
<text macro="author-short" suffix=","/>
<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="3"/>
<option name="et-al-use-first" value="3"/>
<sort>
<key macro="author" />
</sort>
<layout>
<text macro="author" font-weight="bold"/>
<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 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"/>
<text macro="editor"/>
<text variable="container-title" font-style="italic" suffix="."/>
<text variable="collection-title" suffix="."/>
<text variable="event" 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=" "/>
<text macro="editor" prefix=" "/>
</group>
<group class="container" prefix=" " suffix=".">
<text variable="container-title" font-style="italic" form="short" strip-periods="true"/>
<group prefix=" ">
<text variable="volume" font-weight="bold"/>
</group>
<group prefix=", ">
<text variable="page"/>
</group>
</group>
</else>
</choose>
<text prefix=" " macro="access" suffix="."/>
</layout>
</bibliography>
</style>
gist.github.com - the forum is not great for posting nor reading long code.
As for your questions
"Sorting by author after sorting by year"
Not quite sure what you mean here - but I think the problem is that your search key is "issued" - which uses the precise date up to the day. The way out would be to create a macro "issued-year" and then use that as the sort key - see e.g. the APA style as an example.
Also, by convention I'd put the <sort> section under and not above the options.
"Collapsing years into Jones, 2000a,b, 2002 style"
Here I don't know - that should work with your style.
"Removing the comma after et al."
but leave for single authors? I don't think that's possible - but it might be with csl 1.0 by testing for the presence of an et al term. Maybe someone can help me out here.
https://gist.github.com/800444
But still get errors:
(McMahon, 1973; 1975a; 1975b; Christiansen & Mazák, 2009; Hernandez et al., 2009; Ohser et al., 2009; Schladitz, 2009; Vasilić et al., 2009)
In this new citation in a new document, the citations are sorted according to year, then author (good) but the years 1973; 1975a; 1975b; should be 1973, 1975a,b;
It seems like it's critical to have 'keep citations sorted' checked when first adding citations.
Wolff, 2010aundefinedb
which should look like:
Wolff, 2010a,b
http://citationstyles.org/downloads/upgrade-notes.html#updating-csl-0-8-styles
http://www.zotero.org/support/dev/creating_citation_styles#validation
@adamsmith: I don't think it's possible to remove the comma after "et al.".
"Error: Bad character content for element updated from namespace http://purl.org/net/xbiblio/csl.
From line 16, column 5; to line 16, column 15
se"/>↩ <updated />↩ <"
Removing the <updated /> element results in another error, because the <info> element requires <updated />. Adding the <updated> line from the example info section at http://citationstyles.org/downloads/specification.html#info, allows validation.
I'll work on this now as a CSL 1.0 style and let you know how I get on.
I also followed the formatting example given for the after-collapse-delimiter option, but I get the string "undefined" as the year-suffix-delimiter, not "," (Foo 1983aundefinedb; Bar 1984).
<date variable="issued" form="text" date-parts="year"/>
You might prefer coding it this way anyway, since it will allow fancy variations like setting the suffix in italics. That undefined return value is nasty, though, and needs to be fixed.<text variable="year-suffix"/>
https://gist.github.com/805862
In-text citations are still a bit broken. In the following example, year collapsing breaks when a citation with different authors lies within the year range that is being collapsed.
(Cubo & Casinos, 1994; Olmos et al., 1996, Cubo & Casinos, 1997,1998a,b; Cubo et al., 1999,Cubo & Casinos, 2000a,b; Casinos & Cubo, 2001)
Removing Olmos et al., 1996:
(Cubo & Casinos, 1994, 1997,1998a,b; Cubo et al., 1999,Cubo & Casinos, 2000a,b; Casinos & Cubo, 2001)
And removing Cubo et al., 1999 results in:
(Cubo & Casinos, 1994, 1997,1998a,b,2000a,b; Casinos & Cubo, 2001)
Which is getting very close to the proper style.
Note however the inconsistent application of a space after the year comma - 1994, gets a space but the other years don't. I need to get a space after each year, like so:
Cubo & Casinos, 1994, 1997, 1998a,b, 2000a,b;
Also, years in the bibliography are no longer disambiguated with a letter suffix; the above example results in:
Cubo J, Casinos A (1998) ...Title a...
Cubo J, Casinos A (1998) ...Title b...
I can no longer reproduce the date bug I reported yesterday. I tested with the examples above and there was no sensitivity to adding a month in text or a yyyy-mm-dd style date.
http://citationstyles.org/downloads/specification.html#id54
This means that the citations are disambiguated but there's no way to tell which of the disambiguated citations the reader should look up in the bibliography.
The reason the option is citation-only is because ambiguity (typically) only occurs in citations. Year suffix disambiguation is special in that it also affects the bibliographic entries.
Year suffix disambiguation does not appear in my bibliography.
https://gist.github.com/805862
At line 139, insert this:
<text variable="year-suffix"/>
What's happening is that the processor sees that you use an explicit year-suffix text node elsewhere in the style (in the year-date macro), and assumes that when you want the year-suffix to be rendered, you will likewise insert it explicitly where it is required. (The processor could be adjusted to attempt to handle this case [where an explicit year-suffix is not used in the bibliography], but I'm personally inclined to think that it's better to add a note in the CSL specification to indicate that styles that use an explicit year-suffix should do so everywhere.)
That fixed it. Now I have disambiguated years in the bibliography.
I think what is happening is that the sort is applied first, which overrides collapsing. So the range of years that would be collapsed by same author is broken by a citation with a date in that range but with a different author. What should happen is that the collapsed sets of citations are sorted by the earliest (or latest, depending on the ascending/descending option) year in the series, then subsequent sorts are applied.
This is the current state of the style:
(Cubo & Casinos, 1994; Olmos et al., 1996, Cubo & Casinos, 1997,1998a,b; Cubo et al., 1999,Cubo & Casinos, 2000a,b; Casinos & Cubo, 2001)
the citations are sorted by date and then collapsed. You can see the effect; Cubo & Casinos have been split into 3 collapsed chunks because Olmos et al. 1996 and Cubo et al. 1999 appear in the middle of the range that Cubo & Casinos should be collapsed through. What I propose is that collapsing happens (with dates sorted within the collapse), then the collapsed citations are sorted by whatever you like - in this case date then author. Intuitively, the collapsed year ranges should be sorted by the first year listed. The result should look like:
(Cubo & Casinos, 1994, 1997,1998a,b, 2000a,b; Olmos et al., 1996; Cubo et al., 1999; Casinos & Cubo, 2001)
DOI: 10.1111/j.1469-7580.2010.01313.x
(Rajnoch et al. 2003; Metcalfe & Ferguson, 2005, 2007; Metcalfe et al. 2006)
DOI: 10.1111/j.1469-7580.2010.01324.x
(Bermúdez de Castro et al. 2008, 2010a,b; Carbonell et al. 2008)