How to change citation style to show first name, add comma (,) in citation text

I am trying to edit the citation style for the Harvard style. According to the documentation I should make change to the citation element. What part of this element (shown below) should I change to create a bibliography list:

last name, first name

I do not want the first name to appear as an initial.

<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>

Also I want the citation text to appear:

Lorem ipsum dolor sit amet, (Author, 2010) consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

I assume I need to change the following element but I do not understand from the documentation what should be changed:

<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=", ">
<group delimiter=", ">
<text macro="author"/>
<text macro="year-date"/>
</group>
<group>
<label variable="locator" suffix="." form="short"/>
<text variable="locator"/>
</group>
</group>
</layout>
</citation>
  • 1.
    <name and="text" name-as-sort-order="all" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>

    i.e. take out "initialize with" and add a sort separator.


    2. the passage you cite will do (Author, 1999) - what isn't working?
  • Could you explain where the documentation states that the attribute 'initialize-with' has the effect you describe (to learn for future reference). Thanks.

    Now, the citation text in the text body (writer) is:

    Lorem ipsum dolor sit amet, (Author 2010) consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    but a comma (,) is wanted after the author name:

    Lorem ipsum dolor sit amet, (Author, 2010) consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
  • the documentation is pretty technical - it says syntax summary rather than user guide for a reason - so you'll sometimes just have to use trial and error. Here's what it says:

    "initialize-with - the text to follow each initial and a directive to use initials."

    which, admittedly, isn't super helpful, though technical it does say what it does. The next version of csl (for the Zotero version that's currently in beta) has more thorough and systematic documentation.

    for the other question - if the style doesn't give you a comma it's not properly updated or installed or something. In
    <group delimiter=", ">
    <text macro="author"/>
    <text macro="year-date"/>
    </group>

    the delimiter=", " part means "put a comma and a space between author and year.
    Are you testing this in
    chrome://zotero/content/tools/csledit.xul ?
  • Below is a copy of the file, which is referred to in the writer document. Is was edited using jedit.

    <?xml version="1.0" encoding="UTF-8"?>
    <style xmlns="http://purl.org/net/xbiblio/csl" xml:lang="en" class="in-text" >
    <info>
    <title>Harvard Reference format 1 (Author-Date European format)</title>
    <id>http://www.zotero.org/styles/harvard1e</id>;
    <link href="http://www.zotero.org/styles/harvard1"/>
    <author>
    <name></name>
    <email></email>
    </author>
    <category term="author-date"/>
    <category term="generic-base"/>
    <updated>2010-mm-ddThh:mm:ss+00:00</updated>
    <summary>The Harvard author-date style, adapted from original version by Julian Onions, julian.onions@gmail.com</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 and="text" name-as-sort-order="all" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
    <substitute>
    <names variable="editor"/>
    <names variable="translator"/>
    <text macro="anon"/>
    </substitute>
    </names>
    </macro>
    <macro name="author-long">
    <names variable="author">
    <name form="long" and="symbol" delimiter=", " delimiter-precedes-last="never" initialize-with=". "/>
    <substitute>
    <names variable="editor"/>
    <names variable="translator"/>
    <text macro="anon"/>
    </substitute>
    </names>
    </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="day" suffix=" "/>
    <date-part name="month" 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="; ">
    <group delimiter=", ">
    <group delimiter=", ">
    <text macro="author"/>
    </group>
    <group delimiter=", ">
    <group delimiter=", ">
    <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="4"/>
    <option name="et-al-use-first" value="1"/>
    <option name="entry-spacing" value="0"/>
    <option name="line-spacing" value="0"/>
    <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>
  • no, that's a mess - where does that come from? It's not even valid csl (you have one more group opening than closing tag) so this will just do nothing. Again, how exactly are you testing your styles?

    The group delimiter is what is being put between the different elements of a group. so when you have
    <group delimiter="*"
    <text macro author/>
    <text macro year/>
    <text macro locator/>
    </group>
    you get
    Author*1999*p.12
    etc.

    Try this instead.

    <layout prefix="(" suffix=")" delimiter="; ">
    <group delimiter=", ">
    <group delimiter=", ">
    <text macro="author"/>
    <text macro="year-date"/>
    </group>
    <group>
    <label variable="locator" suffix="." form="short"/>
    <text variable="locator"/>
    </group>
    </group>
    </layout>
    </citation>
  • I used the address chrome://zotero/content/tools/csledit.xul to select the Harvard citation style from the menu. I copied the csl (which validates as xml according to the text editor jedit) and made the change as advised. See below. The csl file was saved as a new file name harvardeuropeandate.csl. The csl file is opened using firefox menu bar and the style appears in the zotero styles list within writer.

    <?xml version="1.0" encoding="UTF-8"?>
    <style xmlns="http://purl.org/net/xbiblio/csl" xml:lang="en" class="in-text">
    <info>
    <title>Harvard Reference format 1 (Author-Date European format)</title>
    <id>http://www.zotero.org/styles/harvard1e</id>;
    <link href="http://www.zotero.org/styles/harvard1"/>
    <author>
    <name></name>
    <email></email>
    </author>
    <category term="author-date"/>
    <category term="generic-base"/>
    <updated>2010-mm-ddThh:mm:ss+00:00</updated>
    <summary>The Harvard author-date style, adapted from original version by Julian Onions, julian.onions@gmail.com</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="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="; ">
    <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>
    </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>
  • Hi,
    Sort Names:
    name-as-sort-order - determines the order of last name and first name(initials). No entry has all authors as firstname-lastname, “first” displays only the first author as lastname-firstname, “all” displays all authors as lastname-firstname.
    Example:
    <name
    name-as-sort-order="all"
    sort-separator="; "
    delimiter=", "
    form="long"
    delimiter-precedes-last="always" >
    </name>
    Regards
    Peter
Sign In or Register to comment.