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>
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>
<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?
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.
"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 ?
<?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>
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>
<?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>
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