Help fixing a citation style

Hi I am trying to "create" a style for the journal Oncogene. The information for the style can be found here: http://mts-onc.nature.com/cgi-bin/main.plex?form_type=display_auth_instructions

The Oncogene style is a combination of American Journal of Physical Anthropology and Cold Spring Harbor Laboratory Press with some additional modifications. I pretty have no idea what I am doing but I tried my best. I tried to mash together the two styles (i.e. copy/paste) from the code that I see using chrome://zotero/content/tools/csledit.xul. I almost have it working except for the repetition of the title in the bibliography. I was wondering if someone could help me fix this issue. Sorry for it being kind of messy.

<?xml version="1.0" encoding="UTF-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text"

xml:lang="en">
<info>
<title>Oncogene</title>
<id>http://www.zotero.org/styles/oncogene</id>;
<author>
<name>Jocelyn Reader</name>
<uri>http://wherever.com/</uri>;
</author>
<category term="author-date"/>
<category term="science"/>
<updated>2009-05-19T10:01:24+00:00</updated>
<summary>Style for Oncogene.</summary>
<link

href="http://mts-onc.nature.com/cgi-bin/main.plex?form_type=display_

auth_instructions" rel="documentation"/>
</info>
<macro name="editor">
<names variable="editor">
<name name-as-sort-order="all" sort-separator=" "

initialize-with="" delimiter=", " delimiter-precedes-last="always"/>
<label form="long" prefix=", " text-case="lowercase"

suffix="."/>
</names>
</macro>
<macro name="anon">
<text term="anonymous" form="short"

text-case="capitalize-first"/>
</macro>
<macro name="author">
<group suffix=".">
<names variable="author">
<name sort-separator=" " initialize-with=""

name-as-sort-order="all" delimiter=", "

delimiter-precedes-last="always"/>
<label form="short" prefix=" " suffix=""

text-case="lowercase"/>
<substitute>
<names variable="editor"/>
<text macro="anon"/>
</substitute>
</names>
</group>
</macro>
<macro name="author-short">
<names variable="author">
<name form="short" and="text" delimiter=", "

initialize-with="."/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text macro="anon"/>
</substitute>
</names>
</macro>
<macro name="access">
<group>
<text value="Available from:" suffix=" "/>
<text variable="URL"/>
</group>
</macro>
<macro name="title">
<text variable="title"/>
</macro>
<macro name="locator">
<label variable="locator" form="short"/>
<text variable="locator" prefix=" "/>
</macro>
<macro name="publisher">
<group delimiter=": ">
<text variable="publisher-place"/>
<text variable="publisher"/>
</group>
</macro>
<macro name="issued">
<date variable="issued" delimiter=" ">
<date-part name="year"/>
<date-part name="month" prefix=" "/>
<date-part name="day" prefix=" "/>
</date>
<group prefix=" [" suffix="]" delimiter=" ">
<text term="cited"/>
<date variable="accessed" >
<date-part name="year"/>
<date-part name="month" prefix=" "/>
<date-part name="day" prefix=" "/>
</date>
</group>
</macro>
<macro name="pages">
<text variable="page" prefix="p "/>
</macro>
<macro name="journal">
<text variable="container-title" form="short"

font-style="italic"/>
<choose>
<if variable="URL">
<text term="internet" prefix=" [" suffix="]"

text-case="capitalize-first"/>
</if>
</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>
<citation>
<option name="et-al-min" value="3"/>
<option name="et-al-use-first" value="1"/>
<option name="disambiguate-add-year-suffix" value="true"/>
<option name="collapse" value="year-suffix"/>
<layout prefix="(" suffix=")" delimiter="; ">
<group delimiter=", ">
<text macro="author-short"/>
<date variable="issued" delimiter=" ">
<date-part name="year" />
</date>
<text macro="locator"/>
</group>
</layout>
</citation>
<bibliography>
<option name="hanging-indent" value="false"/>
<option name="et-al-min" value="7"/>
<option name="et-al-use-first" value="6"/>
<sort>
<key macro="author"/>
<key macro="year-date"/>
</sort>
<layout>
<text macro="author" suffix=""/>
<date variable="issued" prefix=" (" suffix=").">
<date-part name="year"/>
</date>
<text macro="title" prefix=" " suffix="."/>
<choose>
<if type="article-newspaper article-magazine" match="any">
<group delimiter=" ">
<text macro="title"

prefix=" " suffix="."/>
</group>
<group prefix=" "

delimiter=", ">
<text

variable="container-title" font-style="italic"/>
<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

class="container" 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>
<group suffix="." >
<text macro="title"

prefix=" " />
<text macro="editor"

prefix=" "/>
</group>
<group class="container"

prefix=" " suffix="." delimiter=" ">
<text

variable="container-title" form="short" font-style="italic"/>
<group delimiter=":

">
<text

variable="volume" font-weight="bold"/>
<text

variable="page"/>
</group>
</group>
</else>
</choose>
<text prefix=" " macro="access"/>
</layout>
</bibliography>
</style>
  • edited May 19, 2009
    Could you paste it here: http://gist.github.com/ ?
  • Here is the link. Would you like me to paste it here as well or just provide the link.

    Thanks!

    http://gist.github.com/114341
  • You have this:</date>
    <text macro="title" prefix=" " suffix="."/>
    <choose>
    The middle line tells it to print the title for all item types. Then, in your choose block, you use the title macro in all of your if item type blocks. You can probably remove it from all of the if blocks and be OK (and this seems preferable to removing it from outside the blocks (even if you only need to remove one entry), because it reuses more code). In general, I suspect that you don't need to have so much type-specific coding in your file (but I guess you can optimize that later, once you get it working).
  • Thanks so much for the help. I deleted "<text macro="title" prefix=" " suffix="."/>" of the code:

    </date>
    <text macro="title" prefix=" " suffix="."/>
    <choose>

    since it was easier for me to figure out (instead of removing it from all of the blocks) and got it to work so far. I'm a novice at this and really need the style ASAP. With more tutelage I would be happy to try to clean it up more and share it with everyone. I figure since it's a Nature journal and that's a popular journal there will be need for this style.

    Thanks again!
  • edited May 19, 2009
    As a general rule, you should never need to use choose blocks within the citation or bibliography areas. That stuff should be confined to macros. It's precisely why you have this that you got stuck.

    Also, even within the macros, you seldom need to condition formatting on type.

    Something to work on when deadlines aren't looming ...
  • @bdarcus Thanks for the advice. I copied the code from another style and that is how they did it. I'm not good enough to actually write code just (barely) modify what is available to me. I may ask my more code literate friends to help clean it up. I wanted to attempt to put something together on my own first instead of just requesting a style without putting forth some effort first. Thanks for taking the time to read my discussion.
  • Sure; no problem.

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.