Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save munrobasher/7e8e947e83efc0aacce5d82c6be97152 to your computer and use it in GitHub Desktop.
Save munrobasher/7e8e947e83efc0aacce5d82c6be97152 to your computer and use it in GitHub Desktop.
No citation number causes weird preview output
<?xml version="1.0" encoding="utf-8"?>
<!-- Author Date Style
31/05/2018 New: Original version [RN]
06/06/2018 Fix: Syntax error in author-short macros fixed [RN]
11/06/2018 Mod: Citation number removed [RN]
-->
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-US" page-range-format="expanded">
<!-- Information about style -->
<info>
<title>Helios Author Date</title>
<id>http://www.zotero.org/styles/helios-author-date</id>
<link href="http://www.zotero.org/styles/vancouver" rel="self"/>
<link href="http://www.nlm.nih.gov/bsd/uniform_requirements.html" rel="documentation"/>
<author>
<name>Susan Thorp</name>
<email>susan.thorp@heliosmedcomms.com</email>
</author>
<contributor>
<name>Rob Nicholson</name>
<email>rob.nicholson@heliosmedcomms.com</email>
</contributor>
<category citation-format="author-date"/>
<category field="medicine"/>
<summary>This is the standard Helios author date style for citations.</summary>
<updated>2018-06-11T08:52:03+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>
<!-- Author: render the author string -->
<macro name="author">
<names variable="author">
<name sort-separator=" " initialize-with="" name-as-sort-order="all" delimiter=", " delimiter-precedes-last="always"/>
<label form="short" prefix=", "/>
<substitute><text macro="editor"/></substitute>
</names>
</macro>
<!-- Author-Short: render the short author string -->
<macro name="author-short">
<names variable="author">
<name form="short" and="text" delimiter=", " initialize-with=""/>
<substitute><text macro="editor"/></substitute>
</names>
</macro>
<!-- Editor: render list of editors -->
<macro name="editor">
<names variable="editor">
<name name-as-sort-order="all" sort-separator=" " initialize-with=""/>
<label form="long" prefix=", " suffix=". " />
</names>
</macro>
<!-- Issued: get issued date or accessed if not present and website -->
<macro name="issued">
<choose>
<if variable="issued">
<date variable="issued"><date-part name="year"/></date>
</if>
<else-if variable="accessed">
<choose>
<if type="webpage">
<date variable="accessed"><date-part name="year"/></date>
</if>
<else>
<text term="no date" form="short"/>
</else>
</choose>
</else-if>
<else>
<text term="no date" form="short"/>
</else>
</choose>
</macro>
<!-- Publisher: <publisher-place>: <publisher> -->
<macro name="publisher">
<group delimiter=": ">
<text variable="publisher-place"/>
<text variable="publisher"/>
</group>
</macro>
<!-- article-journal -->
<macro name="render-article-journal">
<text macro="author" suffix=". "/>
<date variable="issued" suffix=". "><date-part name="year"/></date>
<text variable="title" suffix=". "/>
<group delimiter=";" suffix=". ">
<text variable="container-title" form="short" strip-periods="true"/>
<choose>
<if variable="page">
<group delimiter=":">
<text variable="volume"/>
<text variable="page"/>
</group>
</if>
<else-if variable="DOI">
<group suffix=" [Epub ahead of print]">
<text variable="DOI" prefix="doi "/>
<date variable="issued" prefix=": ">
<date-part name="month" form="short" strip-periods="true" suffix=" "/>
<date-part name="day"/>
</date>
</group>
</else-if>
</choose>
</group>
</macro>
<!-- chapter (book section) -->
<macro name="render-chapter">
<text macro="author" suffix=". "/>
<date variable="issued" suffix=". "><date-part name="year"/></date>
<text variable="title" suffix=". "/>
<text term="in" suffix=": " text-case="capitalize-first"/>
<text macro="editor"/>
<group suffix=". ">
<text variable="container-title"/>
<text variable="edition" prefix=" (" suffix=")"/>
</group>
<group delimiter=" " suffix=".">
<text macro="publisher"/>
<text variable="page" prefix=" p. "/>
</group>
</macro>
<!-- book -->
<macro name="render-book">
<text macro="author" suffix=". "/>
<date variable="issued" suffix=". "><date-part name="year"/></date>
<group delimiter=" " suffix=". ">
<text variable="title"/>
<text variable="edition" prefix="(" suffix=")"/>
</group>
<text macro="publisher" suffix="."/>
</macro>
<!-- webpage -->
<macro name="render-webpage">
<text macro="author" suffix=". "/>
<date variable="issued" suffix=". ">
<date-part name="day"/>
<date-part name="month" prefix=" "/>
<date-part name="year" prefix=" "/>
</date>
<text variable="title" suffix=". "/>
<choose>
<if variable="URL">
<group delimiter=" " suffix=".">
<text variable="URL" prefix="Available from: "/>
<group delimiter=" " prefix="(" suffix=").">
<text term="accessed" text-case="capitalize-first"/>
<date variable="accessed">
<date-part name="day"/>
<date-part name="month" prefix=" "/>
<date-part name="year" prefix=" "/>
</date>
</group>
</group>
</if>
</choose>
</macro>
<!-- report -->
<macro name="render-report">
<text macro="author" suffix=". "/>
<date variable="issued" suffix=". "><date-part name="year"/></date>
<group delimiter=" " suffix=".">
<text variable="title"/>
<text variable="page"/>
</group>
</macro>
<!-- Defines the layout of the citation -->
<citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="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>
<!-- Defines the layout of the bibliography -->
<bibliography et-al-min="7" et-al-use-first="3" second-field-align="flush">
<layout>
<!-- <text variable="citation-number" suffix=". "/> -->
<!-- Uncomment this line to include the type for debugging. Comment it back out when finished as it fails validation -->
<!-- <text variable="type" prefix="{" suffix="} "/> -->
<choose>
<if type="article-journal" match="any"><text macro="render-article-journal"/></if>
<else-if type="chapter" match="any"><text macro="render-chapter"/></else-if>
<else-if type="webpage" match="any"><text macro="render-webpage"/></else-if>
<else-if type="book" match="any"><text macro="render-book"/></else-if>
<else-if type="report" match="any"><text macro="render-report"/></else-if>
<else><text value="Type not supported: "/><text variable="title"/></else>
</choose>
</layout>
</bibliography>
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment