Modified Citation Style - Installation

I've modified the Harvard (Author-Date) style to use abbreviations when they are present in the "Short Title" field. The style works when I test it using chrome://zotero/content/tools/csledit.xul

When I try to install it, I get the prompt "Install style "Harvard (Author-Date) with Abbreviations" from file:///home/musky/harvard1st.csl?", click install, and receive no errors, but the style does not appear in Zotero in the list of available styles. Any ideas?

Also, ideally I'd like a way of changing the reference delimiter when the work is a short title. This is so that I can cite the original language and the translation of a primary source making clear that these are the same work with a reference like (WdL, p. 33: SL, p. 25) where "WdL" is the abbreviation of the German work and "SL" of the English one. I still want to have the semicolon delimit regular works without abbreviations, so that I get, e.g. (Nuzzo 2004, p. 4; Wetphal 2007, p. 77). I couldn't work out how to do this because <layout> cannot occur within the scope of <choose>. Is this possible with Zotero, or am I asking to much of CSL?

See below for the source of my modified style.

Cheers,
Josh

<?xml version="1.0" encoding="UTF-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" xml:lang="en" class="in-text" >
<info>
<title>Harvard (Author-Date) with Abbreviations</title>
<id></id>
<author>
<name>Joshua Mendelsohn</name>
</author>
<category term="author-date"/>
<updated>2010-16-08</updated>
<summary>Harvard author-date style with Title Abbreviations</summary>
<link href="http://libweb.anglia.ac.uk/referencing/harvard.htm" rel="documentation"/>
</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 name-as-sort-order="all" and="symbol" 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>
<macro name="author-short">
<names variable="author">
<name form="short" and="symbol" delimiter=", " delimiter-precedes-last="never" initialize-with=". "/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text macro="anon"/>
</substitute>
</names>
</macro>
<macro name="title-short">
<text variable="shortTitle" />
</macro>
<macro name="access">
<group>
<text value="Available at:" suffix=" "/>
<text variable="URL"/>
<group prefix=" [" suffix="]">
<text term="accessed" text-case="capitalize-first" suffix=" "/>
<date variable="accessed">
<date-part name="month" suffix=" "/>
<date-part name="day" suffix=", "/>
<date-part name="year"/>
</date>
</group>
</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">
<group>
<label variable="page" form="short" include-period="true" suffix=" "/>
<text variable="page"/>
</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="; ">
<choose>
<if variable="shortTitle">
<group delimiter=", ">
<text macro="title-short" font-style="italic"/>
<group>
<label variable="locator" suffix="." form="short"/>
<text variable="locator"/>
</group>
</group>
</if>
<else>
<group delimiter=", ">
<group delimiter=" ">
<text macro="author-short"/>
<text macro="year-date"/>
</group>
<group>
<label variable="locator" suffix="." form="short"/>
<text variable="locator"/>
</group>
</group>
</else></choose>
</layout>
</citation>
<bibliography>
<option name="hanging-indent" value="true"/>
<option name="et-al-min" value="4"/>
<option name="et-al-use-first" value="1"/>
<sort>
<key macro="author"/>
<key variable="title"/>
</sort>
<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="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"/>
<group prefix=", ">
<text variable="volume" />
<text variable="issue" prefix="(" suffix=")"/>
</group>
<group prefix=", ">
<label variable="locator" suffix="." form="short"/>
<text variable="page"/>
</group>
</group>
</else>
</choose>
<text prefix=" " macro="access" suffix="."/>
</layout>
</bibliography>
</style>
  • edited August 16, 2011
    When I try to install it ... the style does not appear in Zotero in the list of available styles. Any ideas?
    You need to give the style an ID (between the <id> and </id> tags)
    Also, ideally I'd like a way of changing the reference delimiter when the work is a short title. ... Is this possible with Zotero...?
    No.

    Also, your CSL 0.8 style doesn't validate (see also http://www.zotero.org/support/dev/citation_styles#validation):


    Error: Bad character content 2010-16-08 for element updated from namespace http://purl.org/net/xbiblio/csl.
    From line 10, column 19; to line 10, column 29
    >2010-16-08</updated>↩<summ

    Error: Bad value shortTitle for attribute variable on element text from namespace http://purl.org/net/xbiblio/csl.
    From line 45, column 1; to line 45, column 30
    e-short">↩<text variable="shortTitle" />↩</mac

    Error: Bad value shortTitle for attribute variable on element if from namespace http://purl.org/net/xbiblio/csl.
    From line 118, column 1; to line 118, column 26
    ↩<choose>↩<if variable="shortTitle">↩<grou
  • Thanks for your prompt reply! Got it working. Only one of those validation mistakes was actually a problem with my style. The "shortTitle" variable seems to be non-standard CSL that Zotero uses.
  • shortTitle is passed by Zotero and used internally by citeproc-js, but note that its name may change in future. (Any change will be documented in the specification, but just in case.)
  • We plan to add a proper CSL variable for the short title in the next CSL release. See https://github.com/citation-style-language/schema/issues/2

This is an old discussion that has not been active in a long time. Instead of commenting here, you should start a new discussion. If you think the content of this discussion is still relevant, you can link to it from your new discussion.