[SOLVED] DOI in bibliography
Hi Forumites.
I'm trying to write a new style for the British Journal of Cancer since the one in the repository does not meet the journal guidelines (see http://www.nature.com/bjc/authors/submit.html#manuscripts for reference & biblio guidelines).
I seem to have a working style now except for the inclusion of DOI information. Basically I'm not sure how/where to include that in the new style. Any advice would be appreciated.
Thanks
duff (see style below)
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" version="1.0" class="in-text" default-locale="en-US" demote-non-dropping-particle="sort-only" page-range-format="expanded">
<info>
<title>British Journal of Cancer</title>
<id>http://www.zotero.org/styles/british-journal-of-cancer</id>
<link href="http://www.zotero.org/styles/british-journal-of-cancer" rel="self"/>
<author>
<name>Iain Gallagher</name>
<email>iaingallagher@gmail.com</email>
</author>
<category citation-format="author-date"/>
<category field="medicine"/>
<issn>0092-8674</issn>
<updated>2011-12-05T16:20:00+00:00</updated>
<summary>Style for the British Journal of Cancer</summary>
<link href="http://www.nature.com/bjc/authors/submit.html#how-to-submit" rel="documentation"/>
<rights>This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/</rights>
</info>
<macro name="author-short">
<names variable="author">
<name form="short" and="text"/>
</names>
</macro>
<macro name="author">
<names variable="author">
<name name-as-sort-order="all" initialize-with="." and="text" delimiter-precedes-last="always"/>
</names>
</macro>
<macro name="issued">
<date variable="issued">
<date-part name="year"/>
</date>
</macro>
<macro name="publisher">
<group prefix="(" delimiter=": " suffix=")">
<text variable="publisher-place"/>
<text variable="publisher"/>
</group>
</macro>
<macro name="editor">
<names variable="editor">
<name initialize-with="." and="text" delimiter-precedes-last="always"/>
<label form="short" prefix=", " text-case="lowercase" suffix="." strip-periods="true"/>
</names>
</macro>
<citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" collapse="year">
<sort>
<key macro="issued"/>
<key macro="author"/>
</sort>
<layout prefix="(" suffix=")" delimiter="; ">
<group delimiter=", ">
<text macro="author-short"/>
<text macro="issued"/>
</group>
</layout>
</citation>
<bibliography>
<sort>
<key macro="author"/>
<key macro="issued"/>
<key variable="title"/>
</sort>
<layout suffix=".">
<group delimiter=" ">
<text macro="author"/>
<text macro="issued" prefix="(" suffix=")."/>
<choose>
<if type="article article-magazine article-newspaper article-journal review" match="any">
<text variable="title" suffix="."/>
<text variable="container-title" form="short" text-case="title"/>
<text variable="volume" font-style="normal" font-weight="bold" suffix=","/>
<text variable="page"/>
</if>
<else-if type="chapter paper-conference" match="any">
<text variable="title" suffix="."/>
<text variable="container-title" prefix="In " suffix="," text-case="title"/>
<text macro="editor"/>
<text macro="publisher" suffix=","/>
<label variable="page" suffix="." form="short" strip-periods="true"/>
<text variable="page"/>
</else-if>
<else-if type="thesis">
<text variable="title" suffix="."/>
<text variable="genre" suffix="."/>
<text variable="publisher"/>
</else-if>
<else>
<text variable="title"/>
<text macro="publisher"/>
</else>
</choose>
</group>
</layout>
</bibliography>
</style>
I'm trying to write a new style for the British Journal of Cancer since the one in the repository does not meet the journal guidelines (see http://www.nature.com/bjc/authors/submit.html#manuscripts for reference & biblio guidelines).
I seem to have a working style now except for the inclusion of DOI information. Basically I'm not sure how/where to include that in the new style. Any advice would be appreciated.
Thanks
duff (see style below)
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" version="1.0" class="in-text" default-locale="en-US" demote-non-dropping-particle="sort-only" page-range-format="expanded">
<info>
<title>British Journal of Cancer</title>
<id>http://www.zotero.org/styles/british-journal-of-cancer</id>
<link href="http://www.zotero.org/styles/british-journal-of-cancer" rel="self"/>
<author>
<name>Iain Gallagher</name>
<email>iaingallagher@gmail.com</email>
</author>
<category citation-format="author-date"/>
<category field="medicine"/>
<issn>0092-8674</issn>
<updated>2011-12-05T16:20:00+00:00</updated>
<summary>Style for the British Journal of Cancer</summary>
<link href="http://www.nature.com/bjc/authors/submit.html#how-to-submit" rel="documentation"/>
<rights>This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/</rights>
</info>
<macro name="author-short">
<names variable="author">
<name form="short" and="text"/>
</names>
</macro>
<macro name="author">
<names variable="author">
<name name-as-sort-order="all" initialize-with="." and="text" delimiter-precedes-last="always"/>
</names>
</macro>
<macro name="issued">
<date variable="issued">
<date-part name="year"/>
</date>
</macro>
<macro name="publisher">
<group prefix="(" delimiter=": " suffix=")">
<text variable="publisher-place"/>
<text variable="publisher"/>
</group>
</macro>
<macro name="editor">
<names variable="editor">
<name initialize-with="." and="text" delimiter-precedes-last="always"/>
<label form="short" prefix=", " text-case="lowercase" suffix="." strip-periods="true"/>
</names>
</macro>
<citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" collapse="year">
<sort>
<key macro="issued"/>
<key macro="author"/>
</sort>
<layout prefix="(" suffix=")" delimiter="; ">
<group delimiter=", ">
<text macro="author-short"/>
<text macro="issued"/>
</group>
</layout>
</citation>
<bibliography>
<sort>
<key macro="author"/>
<key macro="issued"/>
<key variable="title"/>
</sort>
<layout suffix=".">
<group delimiter=" ">
<text macro="author"/>
<text macro="issued" prefix="(" suffix=")."/>
<choose>
<if type="article article-magazine article-newspaper article-journal review" match="any">
<text variable="title" suffix="."/>
<text variable="container-title" form="short" text-case="title"/>
<text variable="volume" font-style="normal" font-weight="bold" suffix=","/>
<text variable="page"/>
</if>
<else-if type="chapter paper-conference" match="any">
<text variable="title" suffix="."/>
<text variable="container-title" prefix="In " suffix="," text-case="title"/>
<text macro="editor"/>
<text macro="publisher" suffix=","/>
<label variable="page" suffix="." form="short" strip-periods="true"/>
<text variable="page"/>
</else-if>
<else-if type="thesis">
<text variable="title" suffix="."/>
<text variable="genre" suffix="."/>
<text variable="publisher"/>
</else-if>
<else>
<text variable="title"/>
<text macro="publisher"/>
</else>
</choose>
</group>
</layout>
</bibliography>
</style>
to add a doi you should put something like this in the bibliography section:
<text variable="DOI" prefix=", doi:"/> (change the prefix to what is correct)
you can write it after <text variable="page"/> for example
I solved this myself thanks - should have added a [SOLVED] but time slips away. Hope you didn't go to any trouble.
My code:
<macro name="DOI">
<group prefix="doi:">
<text variable="DOI"/>
</group>
</macro>
Placed this with the other macros.
Then in the bibliography definition add the DOI as last object / entry.
<choose>
<if type="article article-magazine article-newspaper article-journal review" match="any">
<text variable="title" suffix="."/>
<text variable="container-title" form="short" font-style="italic" text-case="title"/>
<text variable="volume" font-style="normal" font-weight="bold" suffix=","/>
<text variable="page"/>
<text macro="DOI"/>
</if>
https://github.com/citation-style-language/styles/wiki/Submitting-Styles
best
duff