<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="note" version="1.0" demote-non-dropping-particle="sort-only">
  <info>
    <title>Australian Legal Citation</title>
    <id>http://www.zotero.org/styles/australian-legal</id>
    <link href="http://www.zotero.org/styles/australian-legal" rel="self"/>
    <author>
      <name>Anton Hughes</name>
      <email>antonh@lawtec.net</email>
    </author>
    <author>
      <name>Bruce D'Arcus</name>
      <email>bdarcus@gmail.com</email>
    </author>
    <author>
      <name>Nancy Sims</name>
      <email>nsims@umich.edu</email>
    </author>
    <author>
      <name>Nic Suzor</name>
      <email>nic@suzor.com</email>
    </author>
    <category citation-format="note"/>
    <updated>2012-04-03T13:46:03+00:00</updated>
    <summary>A modification of the Bluebook legal citation style for Australian conditions.</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>
  <!-- sets up basics of dealing with authors -->
  <macro name="name-macro">
    <choose>
      <if type="legal_case">
        <names variable="author">
          <name and="symbol" delimiter="" delimiter-precedes-last="never"/>
          <label form="short" prefix="" suffix="." strip-periods="true"/>
          <substitute>
            <text variable="title"/>
          </substitute>
        </names>
      </if>
      <else-if variable="author" match="none">
        <!-- no author, get the editors; editors go before the title: AGLC 5.1.2 -->
        <names variable="editor translator">
          <name and="symbol" delimiter=", " delimiter-precedes-last="never"/>
          <label form="short" prefix=" (" suffix=")" strip-periods="true"/>
          <substitute>
            <!-- no editors, just get the title -->
            <text variable="title"/>
          </substitute>
        </names>
      </else-if>
      <else>
        <names variable="author">
          <name and="symbol" delimiter=", " delimiter-precedes-last="never"/>
          <label form="short" prefix=" " suffix="." strip-periods="true"/>
        </names>
      </else>
    </choose>
  </macro>
  <macro name="author-short">
    <names variable="author">
      <name form="short" and="text" delimiter=", "/>
      <label form="verb-short" prefix=", " suffix="." strip-periods="true"/>
    </names>
  </macro>
  <macro name="author">
    <choose>
      <if type="legal_case">
        <text macro="name-macro" font-style="italic"/>
      </if>
      <else-if type="interview">
        <names variable="author">
          <name and="symbol" delimiter=", "/>
          <label form="short" prefix=" Interview with " suffix="" strip-periods="true"/>
          <substitute>
            <text variable="title"/>
          </substitute>
        </names>
      </else-if>
      <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
        <text macro="name-macro"/>
      </else-if>
      <else>
        <text macro="name-macro"/>
      </else>
    </choose>
  </macro>
  <!-- sets up basics of dealing with editors and translators. Will generally only show up in book citations, as called in XXXX, below -->
  <macro name="editor">
    <!-- AGLC 5.1.2 -->
    <names variable="editor" prefix="" suffix="" delimiter=",">
      <name and="symbol" delimiter=", "/>
      <label form="short" prefix=" (" suffix=")" strip-periods="true"/>
    </names>
  </macro>
  <macro name="editor-translator">
    <!-- deprecated -->
    <choose>
      <if variable="author" match="none">
        <!-- if there's no author, do nothing, as we should have added the editors in before the title -->
      </if>
      <else>
        <names variable="editor translator" prefix="" suffix=" " delimiter=", ">
          <name and="symbol" delimiter=", "/>
          <label form="short" prefix=" " suffix=".," strip-periods="true"/>
        </names>
      </else>
    </choose>
  </macro>
  <macro name="translator">
    <!--AGLC 5.6 -->
    <names variable="translator" prefix="" suffix="" delimiter=", ">
      <name and="symbol" delimiter=", "/>
      <label form="short" prefix=" " suffix=".," strip-periods="true"/>
    </names>
  </macro>
  <macro name="interviewer">
    <names variable="interviewer">
      <name and="symbol" delimiter=", " delimiter-precedes-last="never"/>
      <label form="short" prefix=" " suffix="." strip-periods="true"/>
    </names>
  </macro>
  <!-- sets up basics of handling volume formatting -->
  <macro name="volume-macro">
    <choose>
      <if type="article-journal article-magazine article-newspaper broadcast interview manuscript map patent personal_communication song speech thesis webpage legal_case" match="any">
        <choose>
          <if variable="volume" match="none">
            <date variable="issued">
              <date-part name="year" prefix=" [" suffix="]"/>
            </date>
            <text variable="volume" prefix=" "/>
          </if>
          <else>
            <date variable="issued">
              <date-part name="year" prefix=" (" suffix=")"/>
            </date>
            <text variable="volume" prefix=" "/>
            <text variable="issue" prefix="(" suffix=")"/>
          </else>
        </choose>
      </if>
      <else>
        <group prefix=" (" suffix=")" delimiter=" ">
          <text variable="edition" suffix=", "/>
          <text variable="publisher"/>
          <date variable="issued">
            <date-part name="year"/>
          </date>
        </group>
      </else>
    </choose>
  </macro>
  <!-- sets up font variations for titles in books, articles, etc. -->
  <macro name="title">
    <choose>
      <if type="bill legislation">
        <!-- Statutes should be italicised, bill legislations should not. This test, however, doesn't work. For the moment, italicise everything. -->
        <!--	<choose>
	  <if type="statute"> -->
        <text variable="title" font-style="italic"/>
        <date variable="issued" font-style="italic">
          <date-part name="year" prefix=" "/>
        </date>
        <!--	  </if>
	  <else>
	    <text variable="title" />
   	    <date variable="issued">
              <date-part name="year" prefix=" "/>
             </date>
	  </else>
	</choose>-->
        <text variable="note" prefix=" (" suffix=")"/>
      </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-if type="article-journal article-magazine article-newspaper broadcast interview manuscript map patent personal_communication song speech thesis webpage" match="any">
        <text variable="title" quotes="true"/>
      </else-if>
      <else-if type="legal_case">
        <text variable="title" font-style="italic"/>
      </else-if>
      <else>
        <text variable="title"/>
      </else>
    </choose>
  </macro>
  <macro name="event">
    <!-- this handles a bunch of events in form "(<name of even>, <location>, <full date>)" -->
    <group prefix="(" suffix=")">
      <!-- technically, this should have "Paper presented at the " or "Speech delivered at the", but that becomes too messy. -->
      <text variable="event" suffix=", "/>
      <text variable="event-place" suffix=", "/>
      <date variable="issued">
        <date-part name="day" suffix=" "/>
        <date-part name="month" suffix=" "/>
        <date-part name="year"/>
      </date>
    </group>
  </macro>
  <!-- link to online content, called in YYYYY -->
  <macro name="access">
    <choose>
      <if variable="URL">
        <text variable="URL" prefix=" &lt;" suffix="&gt;"/>
        <group prefix=" at " suffix="">
          <!-- AGLC requires format "at 2 December 2001", no parentheses. -->
          <date variable="accessed">
            <date-part name="day" suffix=" "/>
            <date-part name="month" suffix=" "/>
            <date-part name="year"/>
          </date>
        </group>
      </if>
    </choose>
  </macro>
  <macro name="source">
    <!-- This macro seems really problematic, with a ton of redundancy. I'd move some of
    the conditional logic into the appropriate macros (like 'title') and try to remove this
    macro entirely. -->
    <choose>
      <if type="article-journal" match="any">
        <text variable="title" suffix=" " quotes="true"/>
        <text macro="volume-macro"/>
        <text macro="container"/>
        <text variable="page" prefix=" "/>
      </if>
      <else-if type="legal_case">
        <!-- I am using this to distinguish US cases from Australian ones; we don't list the court for Australian cases in AGLC -->
        <choose>
          <if variable="authority" match="none">
            <text variable="title" font-style="italic"/>
            <text macro="volume-macro" suffix=""/>
            <text macro="container"/>
            <text variable="page" prefix=" "/>
            <text variable="locator" prefix=", "/>
          </if>
          <else>
            <text variable="title" suffix=", " font-variant="normal"/>
            <text variable="volume" prefix=" " suffix=""/>
            <text macro="container"/>
            <text variable="page" prefix=" "/>
            <text variable="locator" prefix=", "/>
            <group prefix=" (" suffix=")">
              <text variable="authority" suffix=", "/>
              <date variable="issued">
                <date-part name="year"/>
              </date>
            </group>
          </else>
        </choose>
      </else-if>
      <else-if type="interview">
        <!-- AGLC 6.11 -->
        <group prefix=" (" suffix=")">
          <text variable="medium" suffix=", "/>
          <date variable="issued">
            <date-part name="day" suffix=" "/>
            <date-part name="month" suffix=" "/>
            <!--- DD mon YYYY -->
            <date-part name="year"/>
          </date>
        </group>
      </else-if>
      <else-if type="thesis">
        <!-- AGLC 6.7 -->
        <text variable="title" font-style="italic"/>
        <group prefix=" (" suffix=")">
          <text variable="genre" suffix=", "/>
          <text variable="publisher" suffix=", "/>
          <date variable="issued">
            <date-part name="year"/>
          </date>
        </group>
      </else-if>
      <else-if type="speech">
        <!-- AGLC 6.9, 6.10 for presentations, oral conference papers, speeches -->
        <text variable="title" quotes="true"/>
        <text macro="event" prefix=" "/>
      </else-if>
      <else-if type="article-newspaper article-magazine" match="any">
        <text variable="title" suffix=", " quotes="true"/>
        <!--AGLC 6.2 -->
        <text variable="volume" suffix=" "/>
        <text macro="container" suffix=", " font-style="italic"/>
        <text macro="issuance"/>
        <group delimiter="">
          <text value="at" prefix=", "/>
          <text variable="page" prefix=" "/>
        </group>
      </else-if>
      <else-if type="chapter paper-conference" match="any">
        <text variable="title" suffix=" " quotes="true"/>
        <!-- AGLC 5.5, chapters in edited books -->
        <text macro="container" suffix=" "/>
        <text macro="issuance" prefix=" (" suffix=")"/>
        <text variable="volume" prefix=" vol. " suffix=" "/>
        <text variable="page" prefix=" "/>
      </else-if>
      <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
        <text variable="title" font-style="italic"/>
        <text macro="container" prefix=" "/>
        <text macro="issuance" prefix=" (" suffix=")"/>
        <text variable="volume" prefix=" vol. " suffix=" "/>
      </else-if>
      <else-if type="webpage">
        <!-- AGLC 6.14 -->
        <text variable="title" font-style="italic"/>
        <text macro="issuance" prefix=" (" suffix=")"/>
        <text macro="container" prefix=" "/>
      </else-if>
      <else>
        <text variable="volume" suffix=" "/>
        <text variable="title" quotes="true"/>
        <text macro="container" prefix=" "/>
        <text macro="issuance" prefix=" (" suffix=")"/>
      </else>
    </choose>
  </macro>
  <macro name="issuance">
    <choose>
      <if type="article-journal article-magazine article-newspaper broadcast interview manuscript map patent personal_communication song speech thesis webpage" match="any">
        <group prefix="" suffix="">
          <choose>
            <if type="article-newspaper thesis" match="any">
              <date variable="issued">
                <date-part name="day" suffix=" "/>
                <date-part name="month" suffix=" "/>
                <!--- DD mon YYYY -->
              </date>
            </if>
          </choose>
          <date variable="issued">
            <date-part name="year"/>
          </date>
        </group>
      </if>
      <else>
        <text macro="translator" suffix=" "/>
        <!-- editors go up front now; only translators go aftewards. AGLC 5.1.2, 5.1.5, 5.1.6 -->
        <text variable="edition" suffix=" ed. "/>
        <!-- replaced a text element with a missing variable reference -->
        <date variable="issued">
          <date-part name="year"/>
        </date>
      </else>
    </choose>
  </macro>
  <!-- sets up citing to specific page numbers -->
  <macro name="at_page">
    <group delimiter="">
      <choose>
        <if position="ibid">
          <!-- "Ibid 23" -->
        </if>
        <else-if position="subsequent">
          <!-- "above n _, 23" -->
          <text value="," prefix=""/>
        </else-if>
        <else-if type="bill book graphic legal_case legislation motion_picture report song thesis" match="any">
          <!-- for legislation, books, and theses, just us a space -->
        </else-if>
        <else>
          <text value="," prefix=""/>
          <!-- everything else, use a comma -->
        </else>
      </choose>
      <text variable="locator" prefix=" "/>
    </group>
  </macro>
  <!-- sets up the "in" in front of book sections, etc. -->
  <macro name="container">
    <choose>
      <if type="chapter paper-conference" match="any">
        <group delimiter="">
          <text term="in" text-case="lowercase" prefix=" "/>
          <text macro="editor" prefix=" "/>
          <text variable="container-title" font-style="italic" prefix=" "/>
        </group>
      </if>
      <else-if type="legal_case">
        <text variable="container-title" form="short" prefix=" "/>
      </else-if>
      <else-if type="article-journal">
        <text variable="container-title" font-style="italic" prefix=" "/>
      </else-if>
      <else>
        <text variable="container-title"/>
      </else>
    </choose>
  </macro>
  <citation et-al-min="4" et-al-use-first="1">
    <layout suffix="." delimiter="; ">
      <choose>
        <!-- always cite legislation in full -->
        <if type="bill legislation">
          <text macro="title"/>
          <text macro="at_page"/>
        </if>
        <else-if position="ibid">
          <text value="ibid" text-case="capitalize-first"/>
          <text macro="at_page" suffix="."/>
          <!-- period will not show up - this is for find-and-replace later. -->
        </else-if>
        <else-if position="subsequent">
          <choose>
            <if type="legal_case">
              <!-- don't use 'above' for cases -->
              <text macro="author"/>
              <text macro="source"/>
              <text macro="access"/>
            </if>
            <else>
              <text macro="author-short" suffix=","/>
              <!-- insert short title if it is needed. -->
              <!-- there seems to be a problem with the current processor, which requires two dates to be identitical before disambiguate="true": see http://forums.zotero.org/discussion/2688/disambiguate-by-adding-title/. For the moment, always append a short title.
        <choose>
            <if disambiguate="true"> -->
              <text variable="title" form="short" prefix=" " suffix="," quotes="true"/>
              <!-- AGLC 1.2.2 -->
              <!--            </if>
          </choose>-->
              <text value="above" prefix=" "/>
              <text value="n " prefix=" "/>
              <!-- CSL does not currently support reference to a note number, so we leave a blank space for correction now -->
              <text value="___"/>
              <text macro="at_page"/>
            </else>
          </choose>
        </else-if>
        <!-- position="subsequent" -->
        <else>
          <!-- new citation -->
          <choose>
            <if type="legal_case">
              <text macro="author"/>
              <text macro="source"/>
              <text macro="access"/>
              <!-- I had to move the page reference for cases within the source macro, because it sits between the reporter and the year in US blue book style -->
            </if>
            <else-if type="interview">
              <text macro="interviewer" suffix=" "/>
              <text value="Interview with "/>
              <text macro="author" suffix=" "/>
              <text macro="source"/>
              <text macro="at_page"/>
              <text macro="access"/>
            </else-if>
            <else>
              <text macro="author" suffix=", "/>
              <text macro="source"/>
              <text macro="at_page"/>
              <text macro="access"/>
              <!-- rule 4.9, URL comes after pinpoint ref -->
            </else>
          </choose>
        </else>
      </choose>
    </layout>
  </citation>
</style>

