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.
  • <?xml version="1.0" encoding="UTF-8"?>
    <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>
  • In the future, please put long pieces of code to a public gist on
    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.
  • OK, I tried some of your suggestions:
    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.
  • I also sometimes get this in my collapsed citations:
    Wolff, 2010aundefinedb
    which should look like:
    Wolff, 2010a,b
  • @mdoube: I presume you're running the 2.1 beta? Mixing up CSL 0.8 and CSL 1.0 features in a single style is bound to give problems. If you need features from CSL 1.0, upgrade your style to the CSL 1.0 format and make sure it validates against the CSL 1.0 schema. See:

    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.".
  • @Rintze: yes, I'm on the 2.1 beta, and I can see how mixing CSL versions is a big bag of dumb. So, I followed your instructions and automatically updated () my style (https://gist.github.com/803275), but it fails validation (validator.nu) with:

    "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.
  • that's a quirk of validation - it requires an actual time stamp in the update field - just copy one from any existing style in the test panel (once the style gets uploaded to the repository, it will automatically add a new time stamp, so the date you put in really doesn't matter)
  • I found what I think is a bug; collapse="year-suffix" breaks if the Date field contains e.g. Jun 1983 for one entry and 1983-10-11 for another entry. The result is a partial collapse (in my case, Foo 1983a, 1983b; instead of Foo 1983a,b;)

    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).
  • Those certainly do look like bugs. I'll take a look tomorrow.
  • For the undefined issue, you can get it working by setting the year suffix explicitly, like this:<date variable="issued" form="text" date-parts="year"/>
    <text variable="year-suffix"/>
    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.
  • I am unable to reproduce the issue you're having with "Jun 1983" for one date and "1983-10-11" for the other in the processor itself. Could you post your style here, and post the link back to this thread? https://gist.github.com/
  • edited February 1, 2011
    Thanks for your help. Current state of the style is here:
    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...
  • @fbennett
    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.
  • Seems like disambiguating by adding a year suffix should be global, but it's currently a citation-only option.
    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 CSL 1.0 specification doesn't mention it (although it should), but the year suffixes used for disambiguation in citations should also appear in the bibliography. Is this not the case for you?

    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.
  • @Rintze

    Year suffix disambiguation does not appear in my bibliography.
    https://gist.github.com/805862
  • edited February 2, 2011
    @mdoube,

    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.)
  • @fbennett
    That fixed it. Now I have disambiguated years in the bibliography.
  • Glad to hear!
  • Unfortunately, in-text citation collapsing is still broken as mentioned above. This seems to be an interaction between collapsing and sorting. If I change the sort order from "date then author" to "author then date", collapsing works as expected.

    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.
  • You're right that the sort is applied first before collapsing, but I don't understand why that is a problem. If the sort keys are author, then date, the cites collapse and the dates for each author come out in ascending (or descending) order. If you are wanting a different effect, can you post an example of a finished citation, formatted correctly?
  • OK, perhaps I wasn't clear. The desired sorting is date, then author (the swap above was a test to see if sorting was the problem).

    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)
  • Okay, I understand. What you describe isn't an atomic sort (where the sort key of an item is determined by its own content, without reference to other items in the set), but grouping. CSL doesn't support grouped sorting, and I'm afraid that it's unlikely to be implemented in the near future; your best bet is to use the position adjustment arrows available in 2.1 to arrange the cites in the desired order. Meanwhile, can you provide a published style guide that requires this form of grouped sorting?
  • OK, that's a shame. J Anat doesn't publish a style guide unfortunately, referring instead to recent articles, which is what I use as a guide. From the Feb 2011 edition:

    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)
Sign In or Register to comment.