Skip to content

Instantly share code, notes, and snippets.

@blahah
Last active June 27, 2016 02:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blahah/5681588 to your computer and use it in GitHub Desktop.
Save blahah/5681588 to your computer and use it in GitHub Desktop.
a CSL style suitable for Zotero, Mendeley, etc. designed for use on StackExchange sites (especially biology.stackexchange.com)
<?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="en-US">
<info>
<title>Biology.SE</title>
<id>http://phyta.org/biology-stackexchange-style</id>
<link href="https://gist.github.com/Blahah/5681588" rel="self"/>
<author>
<name>Richard Smith</name>
<email>richardsmith404@gmail.com</email>
</author>
<category field="biology"/>
<category citation-format="author-date"/>
<updated>2012-04-28T16:01:02+00:00</updated>
<summary>A style for posting in StackExchange question/answer markdown</summary>
<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="editor">
<names variable="editor">
<label form="short" text-case="lowercase" suffix=" "/>
<name and="text" delimiter=", " initialize-with=".">
<name-part name="family" text-case="capitalize-first"/>
<name-part name="given" text-case="capitalize-first"/>
</name>
</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">
<group prefix="**" suffix="**">
<names variable="author">
<name name-as-sort-order="all" sort-separator=" " delimiter=", " delimiter-precedes-last="always" initialize-with=""/>
<label form="short" prefix=", "/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
</substitute>
</names>
</group>
</macro>
<macro name="author-short">
<group prefix="**" suffix="**">
<names variable="author">
<name form="short" and="text" delimiter=", "/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
</substitute>
</names>
</group>
</macro>
<macro name="haslink">
<choose>
<if variable="DOI">
<text value="["/>
</if>
<else-if variable="URL">
<text value="["/>
</else-if>
</choose>
</macro>
<macro name="link">
<choose>
<if variable="DOI">
<text prefix="(http://dx.doi.org/" variable="DOI" suffix=")"/>
</if>
<else-if variable="URL">
<text prefix="(" variable="URL" suffix=")"/>
</else-if>
</choose>
</macro>
<macro name="title">
<choose>
<if type="thesis">
<text variable="title"/>
</if>
<else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
<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"/>
</group>
</if>
<else>
<text variable="edition" suffix="."/>
</else>
</choose>
</macro>
<citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" collapse="year">
<layout prefix="(" suffix=")" delimiter="; ">
<group delimiter=", ">
<group delimiter=" ">
<text macro="author-short"/>
<text macro="year-date"/>
</group>
<text variable="locator"/>
</group>
</layout>
</citation>
<bibliography hanging-indent="true" et-al-min="11" et-al-use-first="10">
<sort>
<key macro="author"/>
<key variable="title"/>
</sort>
<layout prefix=" - " suffix="">
<group delimiter=" ">
<text macro="haslink"/>
<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" 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="bill book graphic legal_case legislation motion_picture report song" match="any">
<group delimiter=" ">
<text macro="title" prefix=" " suffix="."/>
<text macro="edition"/>
<text macro="editor" suffix="."/>
<text macro="publisher"/>
</group>
</else-if>
<else-if type="chapter paper-conference" match="any">
<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>
<group suffix=".">
<text macro="title" prefix=" "/>
<text macro="editor" prefix=" "/>
</group>
<group prefix=" " suffix="." delimiter=" ">
<text variable="container-title" form="short" font-style="italic" strip-periods="true"/>
<group delimiter=": ">
<text variable="volume" font-weight="bold"/>
<text variable="page"/>
</group>
</group>
</else>
</choose>
<text prefix="]" macro="link" suffix=""/>
</layout>
</bibliography>
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment