Editing styles in Zotero – help needed!

I am trying to edit a style in Zotero to suit the formatting requirements of the journal Australian Archaeology, however I seem to have hit a couple of problems.

I’m subtly modifying the Harvard style #1 created by Julian Onions. It’s surprisingly easy to make slight changes, in no small part due to this great guide by the Zotero crew, however I’m having several difficulties so I am posting this here in the hope that some kind passer by or forum user may be able to help…

Problem 1

I’m not clear on how to insert parentheses around the ‘ed’ abbreviation in my stylesheet for an edited book (as opposed to a book section). I’m assuming this needs to happen in the macro editor definition and have amended it as shown below to make this work for book chapters/sections:

<macro name=”editor”>
<names variable=”editor” delimiter=”, “>
<name and=”text” initialize-with=”. ” delimiter=”, “/>
<label form=”short” prefix=”, (” text-case=”lowercase” suffix=”), “/>
</names>
</macro>

While this works for book sections, this doesn’t insert (ed) behind the editors names on an edited book – just ed. I’m assuming that using the prefix/suffix formatting parameters may is how one achieves this, but I’ve tried to insert this at various points in the layout section with no success! What follows is my layout section as it presently stands:

<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 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=”pages” />
<text macro=”publisher” prefix=” “/>
</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”/>
<group prefix=”, “>
<text variable=”volume” />
<text variable=”issue” prefix=”(” suffix=”)”/>
</group>
<group prefix=”, “>
<label variable=”page” suffix=”.” form=”short”/>
<text variable=”page”/>
</group>
</group>
</else>
</choose>
<text prefix=” ” macro=”access” suffix=”.”/>
</layout>

If anyone knows if the prefix/suffix formatting fields will work and if so, where to insert them I’d be most appreciative! I’ve tried inserting them in a few locations with no luck.

Problem 2:

This problem relates to the locator variable in the citation section. I need my citations to look like (Johnson 1989:98). The citation layout is as follows:

<group>
<label variable=”locator” suffix=”:” form=”short“/>
<text variable=”locator”/>
</group

This outputs a citation as (Johnson 1989 p.98). It’s easy to remove the period, what I’m not clear on is removing the ‘p’: altering “short” to “long” just outputs page instead of ‘p.’; removing the field ‘form’ or deleting the text highlighted in blue sees this default back to ‘page’. Is there a term that I can insert in place of ‘short’ to suppress the page output entirely? I’ve tried ‘false’ ‘null’ and even deleted the ‘form=”short”‘ section entirely but the result is the same.

Any thoughts or ideas appreciated, either here, by email or over twitter!

You can download the full CSL file here with my alterations to the standard Harvard 1 style: Harvard – Australian Archaeology

(edit) Solutions!

Re issue 1, Avram Lyon (see comments) suggests the following ammendement to the citations section of the layout. Ammendments highlighted in blue:

<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=”; “>
<group delimiter=” “>
<text macro=”author-short”/>
<group delimiter=”:”>
<text macro=”year-date”/>
<text variable=”locator”/>
</group>
</group>

</layout>
</citation>

Another solution was posted on the Zotero forums, however I’m yet to make this work but will update here if/when it does.

Issue 2 was solved on the forums with the code below, which is inserted into the author macro:

<macro name=”author”>
<names variable=”author”>
<name name-as-sort-order=”all” and=”text” sort-separator=”, ” initialize-with=”.”
delimiter-precedes-last=”never” delimiter=”, “/>
<label form=”short” prefix=” (” suffix=”).” text-case=”lowercase”/>
<substitute>
<names variable=”editor”/>
<text macro=”anon”/>
</substitute>
</names>
</macro>

  • http://www.gimranov.com/avram/w Avram Lyon

    Re Problem 2: What about removing the section altogether and grouping the locator (without a label) into the year group?

  • http://www.gimranov.com/avram/w Avram Lyon

    And since WP is stripping out my CSL, and you don’t mention how to use code blocks on this page, see this Gist for my reworking: https://gist.github.com/758294

  • http://mickmorrison.com Mick

    Thanks Avram, much appreciated. I shall give that a try and report back. I haven’t had a need to post code here before, and frankly wouldn’t know how to show code in comments anyway!

  • http://www.gimranov.com/avram/w Avram Lyon

    I missed the “:” delimiter in my original Gist– I’ve updated it to include the delimiter.

    • http://mickmorrison.com Mick

      Avram thanks for your help, this fix works fine – I’ve updated the post in case this comes up in someone’s search query.

  • Pingback: Tweets that mention Editing styles in Zotero – help needed! -- Topsy.com