Help with changing csl style

edited March 23, 2018
Hi. I was hoping someone could help me. I'm trying to fit a style as per manual for my bachelor essay. I've never touched a csl file before, so it's been trial and error so far but now I've gotten stuck and need to help. This would really help me and the whole class since the teacher whiches so use it for the school if I manage to change it.
So far I've managed to set everything up as it should. Except the editors. They end up in the wrong place and the title of the chapter is repeated, not sure how I take that way. Also the "I : " should be "I: " and I can't seem to take away that blankspace inbetween either.
So I'm really hoping someone here could help me get the last parts right.

Here it how it looks:
Jesch, J. 2008. Poetry in the Viking age. I : Poetry in the Viking age. S. Brink & N. Price. (red.). The Viking World. The Routledge Worlds. Abingdon. Routledge: 291–297.

How I want it to look:
Jesch, J. 2008. Poetry in the Viking age. I: The Viking World. S. Brink & N. Price. (red.). The Routledge Worlds. Abingdon. Routledge: 291–297.

The code:
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="SV">
<info>
<title>Harvard - Uppsala universitet. Arkeologi, osteologi och antik historia</title>
<title-short>CPUT Harvard</title-short>
<id>http://www.zotero.org/styles/harvard-cape-peninsula-university-of-technology</id>
<link href="http://www.zotero.org/styles/harvard-cape-peninsula-university-of-technology" rel="self"/>
<link href="http://www.zotero.org/styles/harvard-cite-them-right" rel="template"/>
<link href="http://www.cput.ac.za/files/images_folder/cpgs/Harvard.pdf" rel="documentation"/>
<author>
<name>Lara Skelly</name>
<email>laralibrarian@gmail.com</email>
</author>
<category citation-format="author-date"/>
<category field="generic-base"/>
<summary>The CPUT Harvard style</summary>
<updated>2017-04-03T00:20:53+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</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" strip-periods="true"/>
</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">
<choose>
<if variable="URL">
<text variable="URL"/>
<group prefix=" (" suffix=")">
<text term="accessed" suffix=": "/>
<date form="numeric" variable="accessed"/>
<date variable="accessed">
<date-part name="" suffix=" "/>
</date>
</group>
</if>
</choose>
</macro>
<macro name="title">
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song 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" form="short"/>
</else>
</choose>
</macro>
<macro name="edition">
<choose>
<if is-numeric="edition">
<group delimiter=" ">
<number variable="edition" form="ordinal"/>
<text term="edition" form="short"/>
</group>
</if>
<else>
<text variable="edition" suffix="."/>
</else>
</choose>
</macro>
<macro name="pages">
<group>
<text variable="page"/>
</group>
</macro>
<citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true">
<layout prefix="(" suffix=")" delimiter="; ">
<group>
<text macro="author-short"/>
<text macro="year-date" prefix=" " suffix=""/>
</group>
<group>
<choose>
<if locator="page">
<text variable="locator" prefix=": "/>
</if>
<else>
<group>
<label variable="locator" suffix="." form="short"/>
<text variable="locator"/>
</group>
</else>
</choose>
</group>
</layout>
</citation>
<bibliography hanging-indent="true">
<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="bill book graphic legal_case legislation motion_picture report song" match="any">
<group prefix=" " delimiter=" " suffix=".">
<text macro="title" suffix="."/>
<text macro="edition"/>
<text macro="editor"/>
</group>
<text prefix=" " suffix="." macro="publisher"/>
</if>
<else-if type="chapter paper-conference" match="any">
<text macro="title" prefix=" " suffix="."/>
<group prefix=" " delimiter=" ">
<text term="in" text-case="capitalize-first"/>
<text macro="title" prefix=": " suffix="."/>
<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 prefix=" " suffix=".">
<text variable="container-title" font-style="italic"/>
<group prefix=", ">
<text variable="volume"/>
<text variable="issue" prefix="(" suffix=")"/>
</group>
<group prefix=": ">
<text variable="page"/>
</group>
</group>
</else>
</choose>
<text prefix=" " macro="access" suffix="."/>
</layout>
</bibliography>
</style>

  • I'm a bit confused what is what in the citation above, could you give me a sense of the metadata you're feeding in?
  • Since I'm a total noob and partly language barrier, I don't understand what you mean with metadata? Do you mean what is what in the citation?

    How it should look dissected:

    Author. Last name first, initial of first name.
    Jesch, J.

    Year published.
    2008.

    Chapter name.
    Poetry in the Viking age.

    In: (in this case, it's supposed to be in swedish and I means in).
    I:

    The book title.
    The Viking World.

    Editors ( the (red.). is short for redaktör in swedish meaning editor).
    S. Brink & N. Price. (red.).

    The publisher.
    The Routledge Worlds.

    Place:
    Abingdon. Routledge:

    pages of the chapter
    291–297.

    I hope that answers your question, otherwise as me like I'm really stupid ^^'

    I also noticed not that the editors has their initial first name first, and last name last when it should be the other way around. Bink, S & Price, N.

  • Change
    <else-if type="chapter paper-conference" match="any">
    <text macro="title" prefix=" " suffix="."/>
    <group prefix=" " delimiter=" ">
    <text term="in" text-case="capitalize-first"/>
    <text macro="title" prefix=": " suffix="."/>
    <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>


    to

    <else-if type="chapter paper-conference" match="any">
    <text macro="title" prefix=" " suffix="."/>
    <group prefix=" " delimiter=" ">
    <text term="in" suffix=":" text-case="capitalize-first"/>
    <text variable="container-title" font-style="italic" suffix="."/>
    <text macro="editor"/>
    <group suffix="." delimiter=": ">
    <text macro="publisher"/>
    <text macro="pages"/>
    </group>
    </group>
    </else-if>



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


    to

    <macro name="editor">
    <names variable="editor" delimiter=" ">
    <name and="symbol" initialize-with=". " delimiter=", " name-as-sort-order="all"/>
    <label form="short" prefix=". (" text-case="lowercase" suffix=")."/>
    </names>
    </macro>
  • Thank you so much. That fixed it. Now everything works at it should. You'll save me and other student tons of time. Thank you again so much.
Sign In or Register to comment.