Help needed for Environmental Health Perspectives (EHP)

HI all,
I've modified a style for EHP, but I still have some issues that I need an expert help with:
1. multiple authors in the citation show with only the first author: "Beker 2003" and only after the second citation in the text it shows properly as "Beker et al. 2003". Should be like: "Beker et al. 2010" for more then 3 authors or "Beker and Bartell 2010"
2. Two citations of the same first author and year show as: "Beker 2003a,b". Should be: "Beker 2003a, 2003b"
3. in the reference list, I have a space between the volume and page range: "25: 110-117". should be without space: "25:110-117"

The journal style guide is available here: http://ehp03.niehs.nih.gov/static/instructions.action

Here is the csl file I wrote:

<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0">
<info>
<title>Environmental Health Perspectives (dev)</title>
<id>C:\Data\Tools\Zotero</id>
<author>
<name>Ilan Levy</name>
</author>
<category field="science"/>
<updated>2011-04-29T11:32:19+05:00</updated>
<summary>A style for EHP journal</summary>
<link href="http://ehp03.niehs.nih.gov/home.action" rel="documentation"/>
<rights>This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/</rights>;
</info>
<macro name="editor">
<names variable="editor">
<name and="text" delimiter=", " initialize-with="." />
<label form="short" text-case="lowercase" suffix=". " />
</names>
</macro>
<macro name="series-editor">
<names variable="original-author">
<label form="short" text-case="capitalize-first" suffix=". "/>
<name and="text" delimiter=", "/>
</names>
</macro>
<macro name="author">
<names variable="author">
<name name-as-sort-order="all" sort-separator=" " delimiter=", " delimiter-precedes-last="always" initialize-with=""/>
<label form="short" prefix=", " suffix="." text-case="lowercase"/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
</substitute>
</names>
</macro>
<macro name="author-short">
<names variable="author">
<name form="short" and="text" delimiter=", "/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
</substitute>
</names>
</macro>
<macro name="access">
<choose>
<if variable="URL">
<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>
</if>
</choose>
</macro>
<macro name="title">
<choose>
<if type="thesis">
<text variable="title"/>
</if>
<else-if type="book">
<text variable="title" font-style="italic"/>
</else-if>
<else>
<text variable="title"/>
</else>
</choose>
</macro>
<macro name="publisher">
<group delimiter=", " >
<text variable="publisher"/>
<text variable="publisher-place"/>
</group>
</macro>
<macro name="year-date">
<date variable="issued">
<date-part name="year"/>
</date>
</macro>
<macro name="day-month">
<date variable="issued">
<date-part name="month"/>
<date-part name="day" prefix=" "/>
</date>
</macro>
<macro name="page">
<label variable="page" suffix=". " form="short"/>
<text variable="page"/>
</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>
<citation et-al-min="1" et-al-use-first="1" et-al-subsequent-min="3" et-al-subsequent-use-first="1" disambiguate-add-year-suffix="true" year-suffix-delimiter=",">
<sort>
<key variable="author"/>
<key variable="issued"/>
</sort>
<layout prefix="(" suffix=")" delimiter="; ">
<group delimiter=" ">
<text macro="author-short"/>
<date variable="issued">
<date-part name="year"/>
</date>
<group>
<label variable="locator" suffix="." form="short" strip-periods="true"/>
<text variable="locator" prefix=" "/>
</group>
</group>
</layout>
</citation>
<bibliography hanging-indent="true" et-al-min="6" et-al-use-first="6">
<sort>
<key macro="author"/>
<key variable="title"/>
</sort>
<layout suffix=".">
<group delimiter=" ">
<text macro="author" suffix="."/>
<text macro="year-date" suffix="."/>
</group>
<choose>
<if type="article-newspaper article-magazine" match="any">
<group delimiter=" ">
<text macro="title" prefix=" " suffix="."/>
</group>
<group prefix=" " delimiter=", ">
<text variable="container-title"/>
<text macro="day-month"/>
<text variable="edition"/>
</group>
</if>
<else-if type="thesis">
<text macro="title" prefix=" " suffix="."/>
<group prefix=" " delimiter=", ">
<text macro="edition"/>
<text macro="editor" suffix="."/>
<text variable="genre"/>
<text macro="publisher"/>
</group>
</else-if>
<else-if type="book">
<group delimiter=" ">
<text macro="title" prefix=" " suffix="."/>
<text macro="edition"/>
<text macro="editor" suffix="."/>
<text macro="publisher"/>
</group>
</else-if>
<else-if type="chapter">
<group delimiter=" ">
<text macro="title" prefix=" " suffix="."/>
<group delimiter=", ">
<group delimiter=" ">
<text term="in" text-case="capitalize-first"/>
<text variable="container-title" font-style="italic"/>
<text macro="editor" prefix=" (" suffix=")"/>
</group>
<group delimiter=" ">
<text variable="volume" prefix="Vol. " suffix=" of"/>
<text variable="collection-title" font-style="italic"/>
<text macro="series-editor"/>
</group>
<text macro="page"/>
<text macro="publisher" prefix=" "/>
</group>
</group>
</else-if>
<else>
<choose>
<if variable="DOI">
<group suffix="" >
<text macro="title" prefix=" " suffix="." />
<text macro="editor" prefix=" "/>
</group>
<group prefix=" " suffix="" delimiter=" ">
<text variable="container-title" form="short" />
<group delimiter=": ">
<text variable="volume"/>
<text variable="page"/>
</group>
</group>
<text variable="DOI" prefix="; doi:" suffix="."/>
</if>
<else>
<group suffix="." >
<text macro="title" prefix=" " suffix="."/>
<text macro="editor" prefix=" "/>
</group>
<group prefix=" " suffix="." delimiter=" ">
<text variable="container-title" form="short"/>
<group delimiter=": ">
<text variable="volume"/>
<text variable="page"/>
</group>
</group>
</else>
</choose>
</else>
</choose>
</layout>
</bibliography>
</style>
  • edited June 20, 2011
    1 and 2.
    change
    <citation et-al-min="1" et-al-use-first="1" et-al-subsequent-min="3" et-al-subsequent-use-first="1" disambiguate-add-year-suffix="true" year-suffix-delimiter=",">
    to
    <citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" collapse="year">

    3.
    change
    <group delimiter=": ">
    <text variable="volume"/>
    <text variable="page"/>
    </group>

    to
    <group delimiter=":">
    <text variable="volume"/>
    <text variable="page"/>
    </group>

    i.e. delete the space after the colon in the delimiter.
    see here for sharing styles:
    http://www.zotero.org/support/dev/citation_styles/sharing styles
    please carefully read over the requirements, you need to fix you info section before we can upload this. Also, for future references, please post long pieces of code - such as entire styles - to gist.github.com - they are much easier to read there.
  • Thanks adamsmith.
    I've made the changes and validated the csl. The only error that comes up is that the link is missing the rel attribute. Don't know if this is important (I see the same error when I try to validate other styles already in the repository, e.g., harvard1.csl).

    I've put the file in https://gist.github.com/1038000, if someone can put it to the repository.

    Thanks again,
    Ilan Levy
  • Thanks!
    Which style is this based on? It's common courtesy (and probably required per license) to credit the style you edited or its contributors, as per the instructions:
    If your style is largely derived from an existing style, list the authors and contributors of that style as contributors in your style. Add yourself as the style's author. Alternatively, you can mark the original style as a template by including a link to it in the info section of your style, e.g. <link href="http://www.zotero.org/styles/original-style" rel="template"/>
    Also, the rel="self" with the link is indeed required - I'm not sure why you're getting that error for harvard1* - if you look at the style - at least the version on the repository - you'll see
    <link href="http://www.zotero.org/styles/harvard1" rel="self"/>

    You really don't want to have a style installed that doesn't validate - we had to troubleshoot dozens of people with non-validating styles after the switch to csl 1.0.


    *actually - my suspicion would be that you're looking at a Harvard style in old csl (0.8.1). Those style, which are valid against the old schema, are converted internally to csl 1.0 - if you validate them against the csl 1.0 schema you'd get a whole bunch of errors.
  • Yes, I saw that section in the instructions, but I really cannot remember from which style I started. Looking at the time stamps on the local files, my best guess is harvard1, so I added Julian Onions as a contributor.

    You're right about the link. I used the old harvard1.csl. I just added rel="self" and it validates with no errors.

    One more request: I get a wrong bibliography for web pages. I do not see an entry for <else-if type="web"> or something like it, and don't know how to create one from scratch.
    What I get is:
    Environment Canada. 2006. National Pollutant Release Inventory. Tracking Pollution in Canada.
    should be like:
    Environment Canada. 2006. National Pollutant Release Inventory. Tracking Pollution in Canada. Available: http://www.ec.gc.ca/inrp-npri/default.asp [accessed 24 June 2010].
  • find the access macro and change it to:

    <macro name="access">
    <choose>
    <if variable="URL">
    <text variable="URL" prefix=" Available: "/>
    <group prefix=" [" suffix="]">
    <text term="accessed" suffix=" "/>
    <date variable="accessed">
    <date-part name="day" suffix=" "/>
    <date-part name="month" suffix=" "/>
    <date-part name="year"/>
    </date>
    </group>
    </if>
    </choose>
    </macro>

    then put
    <text macro="access"/>
    as the last item in your bibliography, i.e. right between </choose> and </layout>
    This will apply to items other than webpages (specifically all items that have a URL but no page range), but in my experience that usually makes sense.
    If you really really don't want that, change
    <if variable="URL"> in the macro to
    <if type="webpage">
    but I'd really go with the more generic solution.
  • Works like a charm!
    I used the second option of adding the URL only to webpages (with <if type="webpage">) because the first one added the URL to all references, even journal articles.

    I've just update the gist: https://gist.github.com/1038000

    Could you put it in the repository?

    Many thanks,
    Ilan Levy
  • done - should show up soon (I added a citation format category - one of the things that'll make this style easier to find in the repository).
Sign In or Register to comment.