<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" and="text" class="note" demote-non-dropping-particle="display-and-sort" et-al-min="4" et-al-use-first="1" initialize-with=". " page-range-format="minimal" version="1.0" default-locale="en-GB">
  <!-- This file was generated by the Style Variant Builder <https://github.com/citation-style-language/style-variant-builder>. To contribute changes, modify the template and regenerate variants. -->
  <info>
    <title>New Hart's Rules: The Oxford Style Guide 2nd edition (notes, author initials, publisher)</title>
    <title-short>NHR (notes [17.2], author initials [18.2.2], publisher [18.2.10])</title-short>
    <id>http://www.zotero.org/styles/new-harts-rules-notes-initials-publisher</id>
    <link href="http://www.zotero.org/styles/new-harts-rules-notes-initials-publisher" rel="self"/>
    <link href="http://www.zotero.org/styles/new-harts-rules-notes" rel="template"/>
    <link href="https://en.wikipedia.org/wiki/Hart's_Rules" rel="documentation"/>
    <link href="http://zotero.org/groups/2205533/collections/499SCKUW" rel="documentation"/>
    <author>
      <name>Andrew Dunning</name>
      <uri>https://orcid.org/0000-0003-0464-5036</uri>
    </author>
    <category citation-format="note"/>
    <category field="anthropology"/>
    <category field="communications"/>
    <category field="generic-base"/>
    <category field="geography"/>
    <category field="history"/>
    <category field="humanities"/>
    <category field="linguistics"/>
    <category field="literature"/>
    <category field="philosophy"/>
    <category field="political_science"/>
    <category field="psychology"/>
    <category field="science"/>
    <category field="social_science"/>
    <category field="sociology"/>
    <category field="theology"/>
    <summary>Oxford source citations, notes system, author forenames reduced to initials (NHR 18.2.2), publisher name (NHR 18.2.10)</summary>
    <updated>2026-02-09T21:13:33+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>
  <locale xml:lang="en">
    <date form="text">
      <date-part name="day" suffix=" "/>
      <date-part form="short" name="month" suffix=" "/>
      <date-part name="year"/>
    </date>
    <terms>
      <!-- Like Chicago, Oxford omits 'by' from `verb-short` forms; it abbreviates only the most common roles -->
      <term name="advance-online-publication">published online</term>
      <term form="verb-short" name="collection-editor">ed.</term>
      <term form="verb-short" name="compiler">comp.</term>
      <term form="verb-short" name="editor">ed.</term>
      <term form="short" name="editor-translator">
        <single>ed. and trans.</single>
        <multiple>eds and trans.</multiple>
      </term>
      <term form="short" name="editortranslator">
        <single>ed. and trans.</single>
        <multiple>eds and trans.</multiple>
      </term>
      <term form="verb-short" name="editor-translator">ed. and trans.</term>
      <term form="verb-short" name="editortranslator">ed. and trans.</term>
      <term form="verb-short" name="illustrator">illus.</term>
      <term name="manuscript">unpublished manuscript</term>
      <term form="short" name="paper-conference">paper</term>
      <term form="verb-short" name="translator">trans.</term>
    </terms>
  </locale>
  <!-- This file's main source is the New Oxford Style Manual (2016), with reference also to the Oxford Style Manual (2003) <https://archive.org/details/oxfordstylemanua0000unse>, which provides more detailed guidance on many points. -->
  <!-- Contents:
    
       This file interprets Oxford style using APA's four basic reference elements:

        1. Author
        2. Date (author-date system only)
        3. Title and descriptions
            3.1. Title
            3.2. Description
            3.3. Identifiers (contributors, edition, volume)
        4. Source
            4.1. Serial sources
            4.2. Monographic sources
            4.3. Series
            4.4. Event
            4.5. Publisher
            4.6. Date
            4.7. Locator (including page references)
            4.8. Medium
            4.9. Archival location
            4.10. URL or persistent identifier
       
       Freeform annotations to bibliography entries: 
        
        5. Notes
       
       Legal references (NHR 13) use OSCOLA:

        6. Legal references
  -->
  <!-- Categories of CSL item types:

       Serial
       : article-journal article-magazine article-newspaper periodical post-weblog review review-book

       Serial or Monographic
       : interview paper-conference

         Monographic with any of `collection-editor compiler editor editorial-director`.
         A serial `paper-conference` is unpublished if it lacks any of `issue page supplement-number volume`.

       Monographic
       : article book broadcast chapter classic collection dataset document
         entry entry-dictionary entry-encyclopedia event figure
         graphic manuscript map motion_picture musical_score
         pamphlet patent performance personal_communication post report
         software song speech standard thesis webpage

       Legal
       : bill hearing legal_case legislation regulation treaty
  -->
  <!-- Variable labels -->
  <macro name="label-chapter-number">
    <group delimiter=" ">
      <choose>
        <if is-numeric="chapter-number" type="song">
          <text value="track"/>
        </if>
        <else-if is-numeric="chapter-number">
          <label form="short" variable="chapter-number"/>
        </else-if>
      </choose>
      <text variable="chapter-number"/>
    </group>
  </macro>
  <macro name="label-chapter-number-long">
    <group delimiter=" ">
      <choose>
        <if is-numeric="chapter-number" type="song">
          <text value="track"/>
        </if>
        <else-if is-numeric="chapter-number">
          <label variable="chapter-number"/>
        </else-if>
      </choose>
      <text variable="chapter-number"/>
    </group>
  </macro>
  <macro name="label-chapter-number-long-capitalized">
    <group delimiter=" ">
      <choose>
        <if is-numeric="chapter-number" type="song">
          <text text-case="capitalize-first" value="track"/>
        </if>
        <else-if is-numeric="chapter-number">
          <label text-case="capitalize-first" variable="chapter-number"/>
        </else-if>
      </choose>
      <text variable="chapter-number"/>
    </group>
  </macro>
  <macro name="label-edition">
    <group delimiter=" ">
      <choose>
        <if is-numeric="edition">
          <number form="ordinal" variable="edition"/>
          <label form="short" variable="edition"/>
        </if>
        <else-if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">
          <!-- serial types: full label (cf. CMOS18 14.89) -->
          <text variable="edition"/>
          <label variable="edition"/>
        </else-if>
        <else-if match="any" variable="collection-editor compiler editor editorial-director">
          <!-- monographic types -->
          <text variable="edition"/>
        </else-if>
        <else-if match="any" type="interview paper-conference">
          <!-- serial types -->
          <text variable="edition"/>
          <label variable="edition"/>
        </else-if>
        <else>
          <text variable="edition"/>
        </else>
      </choose>
    </group>
  </macro>
  <macro name="label-edition-capitalized">
    <group delimiter=" ">
      <choose>
        <if is-numeric="edition">
          <number form="ordinal" variable="edition"/>
          <label form="short" variable="edition"/>
        </if>
        <else-if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">
          <!-- serial types: full label (cf. CMOS18 14.89) -->
          <text text-case="title" variable="edition"/>
          <label text-case="capitalize-first" variable="edition"/>
        </else-if>
        <else-if match="any" variable="collection-editor compiler editor editorial-director">
          <!-- monographic types -->
          <text text-case="capitalize-first" variable="edition"/>
        </else-if>
        <else-if match="any" type="interview paper-conference">
          <!-- serial types -->
          <text text-case="title" variable="edition"/>
          <label text-case="capitalize-first" variable="edition"/>
        </else-if>
        <else>
          <!-- monographic types -->
          <text text-case="capitalize-first" variable="edition"/>
        </else>
      </choose>
    </group>
  </macro>
  <macro name="label-issue">
    <group delimiter=" ">
      <label form="short" variable="issue"/>
      <text variable="issue"/>
    </group>
  </macro>
  <macro name="label-locator">
    <group delimiter=" ">
      <choose>
        <if locator="column page" match="any"/>
        <else-if is-numeric="locator">
          <label form="short" variable="locator"/>
        </else-if>
        <!-- a non-numeric canonical reference is described by its formatting and does not need a label, similar to a timestamp (NHR 17.2.5) -->
        <else-if locator="chapter line verse" match="any"/>
        <else>
          <label form="short" variable="locator"/>
        </else>
      </choose>
      <text variable="locator"/>
    </group>
  </macro>
  <macro name="label-locator-all">
    <group delimiter=" ">
      <label form="short" variable="locator"/>
      <text variable="locator"/>
    </group>
  </macro>
  <macro name="label-number">
    <group delimiter=" ">
      <choose>
        <if type="standard"/>
        <else-if is-numeric="number">
          <label form="short" variable="number"/>
        </else-if>
      </choose>
      <text variable="number"/>
    </group>
  </macro>
  <macro name="label-number-article">
    <group delimiter=" ">
      <choose>
        <if is-numeric="number">
          <text form="short" term="article-locator"/>
        </if>
      </choose>
      <text variable="number"/>
    </group>
  </macro>
  <macro name="label-number-of-volumes">
    <group delimiter=" ">
      <text variable="number-of-volumes"/>
      <choose>
        <if is-numeric="number-of-volumes">
          <label form="short" variable="number-of-volumes"/>
        </if>
      </choose>
    </group>
  </macro>
  <macro name="label-page">
    <group delimiter=" ">
      <label form="short" variable="page"/>
      <text variable="page"/>
    </group>
  </macro>
  <macro name="label-part-number">
    <group delimiter=" ">
      <choose>
        <if is-numeric="part-number">
          <!-- TODO: Replace with `part-number` label when CSL provides one -->
          <text form="short" term="part"/>
        </if>
      </choose>
      <text variable="part-number"/>
    </group>
  </macro>
  <macro name="label-section">
    <group delimiter=" ">
      <choose>
        <if is-numeric="section">
          <label variable="section"/>
        </if>
      </choose>
      <text text-case="title" variable="section"/>
    </group>
  </macro>
  <macro name="label-supplement-number">
    <group delimiter=" ">
      <choose>
        <!-- TODO: Replace with `supplement-number` label when CSL provides one -->
        <if variable="issue supplement-number">
          <!-- if there is both an issue and supplement number, do not label both as 'no.' -->
          <text form="short" term="supplement"/>
        </if>
        <else-if is-numeric="supplement-number" variable="volume-title">
          <!-- if there is a volume title, it is already described as a supplement -->
          <text form="short" term="issue"/>
        </else-if>
        <else-if is-numeric="supplement-number" type="periodical" variable="title">
          <text form="short" term="issue"/>
        </else-if>
        <else-if is-numeric="supplement-number">
          <text form="short" term="supplement"/>
        </else-if>
      </choose>
      <text variable="supplement-number"/>
    </group>
  </macro>
  <macro name="label-version">
    <group delimiter=" ">
      <label variable="version"/>
      <text variable="version"/>
    </group>
  </macro>
  <macro name="label-volume">
    <group delimiter=" ">
      <choose>
        <if is-numeric="volume">
          <label form="short" variable="volume"/>
        </if>
      </choose>
      <text variable="volume"/>
    </group>
    <!-- in OGS and other styles, label a volume by rendering it in Roman numerals (NHR 18.2.7): -->
    <!-- <choose><if is-numeric="volume"><number form="roman" variable="volume"/></if><else><text variable="volume"/></else></choose>-->
  </macro>
  <!-- 1. Author -->
  <macro name="author-bib">
    <group delimiter=", ">
      <names variable="composer">
        <name delimiter-precedes-et-al="after-inverted-name" delimiter-precedes-last="always" initialize="true" name-as-sort-order="first"/>
        <!-- for OGS: -->
        <!-- <name delimiter-precedes-et-al="after-inverted-name" delimiter-precedes-last="always" font-variant="small-caps" initialize="true" name-as-sort-order="first"/><et-al font-variant="normal"/>-->
        <label form="short" prefix=", "/>
        <!-- for OGS or variants with bracketed roles: -->
        <!-- <label form="short" prefix=" (" suffix=")"/> -->
        <substitute>
          <names variable="author"/>
          <names variable="guest"/>
          <names variable="host"/>
          <choose>
            <if type="song">
              <names variable="performer"/>
            </if>
          </choose>
          <choose>
            <if type="classic">
              <!-- editors in author position only for an edited collection (NHR 18.2.2) -->
              <text macro="author-title-substitute"/>
            </if>
          </choose>
          <names variable="illustrator"/>
          <choose>
            <if match="none" type="standard">
              <names variable="editor-translator"/>
              <names variable="editor"/>
              <names variable="translator"/>
              <names variable="collection-editor"/>
            </if>
          </choose>
          <names variable="director"/>
          <names variable="producer"/>
          <names variable="executive-producer"/>
          <names variable="series-creator"/>
          <names variable="editorial-director"/>
          <names variable="compiler"/>
          <choose>
            <if match="any" type="event performance speech">
              <names variable="chair"/>
              <names variable="organizer"/>
            </if>
          </choose>
          <names variable="curator"/>
          <choose>
            <if match="any" type="software webpage">
              <!-- list under a publisher, developer, or owner/sponsor name (NHR 18.8.1-5) -->
              <text variable="publisher"/>
            </if>
            <else-if type="standard">
              <!-- `standard` listed in bibliography under organization, but note omits this (cf. CMOS18 14.159) -->
              <text variable="authority"/>
            </else-if>
          </choose>
          <choose>
            <if type="webpage">
              <!-- website title substituted if no `publisher` (NHR 18.8.1-5) -->
              <text text-case="title" variable="container-title"/>
            </if>
          </choose>
          <text macro="author-title-substitute"/>
          <choose>
            <if match="any" variable="container-title event-date event-place event-title genre title publisher publisher-place"/>
            <else-if type="manuscript">
              <text macro="source-archive"/>
            </else-if>
          </choose>
        </substitute>
      </names>
    </group>
  </macro>
  <macro name="author-note">
    <group delimiter=", ">
      <names variable="composer">
        <name initialize="true"/>
        <label form="short" prefix=", "/>
        <!-- for OGS or variants with bracketed roles: -->
        <!-- <label form="short" prefix=" (" suffix=")"/> -->
        <substitute>
          <names variable="author"/>
          <names variable="guest"/>
          <names variable="host"/>
          <choose>
            <if type="song">
              <names variable="performer"/>
            </if>
          </choose>
          <choose>
            <if match="any" type="classic performance">
              <!-- note contributors fall after the title of `classic` (cf. CMOS18 14.147), `performance` (cf. CMOS18 14.166) -->
              <text macro="author-title-substitute"/>
            </if>
          </choose>
          <names variable="illustrator"/>
          <choose>
            <if match="none" type="standard">
              <names variable="editor-translator"/>
              <names variable="editor"/>
              <names variable="translator"/>
              <names variable="collection-editor"/>
            </if>
          </choose>
          <names variable="director"/>
          <choose>
            <!-- serial `broadcast` prioritizes title (cf. CMOS18 14.165, 14.168) -->
            <if type="broadcast" variable="container-title number title"/>
            <else>
              <names variable="producer"/>
              <names variable="executive-producer"/>
              <names variable="series-creator"/>
              <choose>
                <if type="broadcast">
                  <names variable="contributor"/>
                </if>
              </choose>
            </else>
          </choose>
          <names variable="editorial-director"/>
          <names variable="compiler"/>
          <choose>
            <if match="any" type="event performance speech">
              <names variable="chair"/>
              <names variable="organizer"/>
            </if>
          </choose>
          <names variable="curator"/>
          <choose>
            <if match="any" type="software webpage">
              <!-- list under a publisher, developer, or owner/sponsor name (NHR 18.8.1-5) -->
              <text variable="publisher"/>
            </if>
            <else-if type="standard">
              <!-- `standard` listed in bibliography under organization (cf. CMOS18 14.159) -->
              <text variable="authority"/>
            </else-if>
          </choose>
          <choose>
            <if type="webpage">
              <!-- website title substituted if no `publisher` (NHR 18.8.1-5) -->
              <text text-case="title" variable="container-title"/>
            </if>
          </choose>
          <text macro="author-title-substitute"/>
          <choose>
            <if match="any" variable="container-title event-date event-place event-title genre title publisher publisher-place"/>
            <else-if type="manuscript">
              <text macro="source-archive"/>
            </else-if>
          </choose>
        </substitute>
      </names>
    </group>
  </macro>
  <macro name="author-short">
    <choose>
      <if match="any" type="interview personal_communication">
        <text macro="author-short-and-recipient"/>
      </if>
      <else>
        <names variable="composer">
          <name form="short" initialize="true"/>
          <substitute>
            <names variable="author"/>
            <names variable="guest"/>
            <names variable="host"/>
            <choose>
              <if type="song">
                <names variable="performer"/>
              </if>
            </choose>
            <choose>
              <if match="any" type="classic performance">
                <!-- note contributors fall after the title of `classic` (cf. CMOS18 14.147), `performance` (cf. CMOS18 14.166) -->
                <text macro="author-title-substitute-short"/>
              </if>
            </choose>
            <names variable="illustrator"/>
            <choose>
              <if match="none" type="standard">
                <names variable="editor-translator"/>
                <names variable="editor"/>
                <names variable="translator"/>
                <names variable="collection-editor"/>
              </if>
            </choose>
            <names variable="director"/>
            <choose>
              <!-- serial `broadcast` prioritizes title (cf. CMOS18 14.165, 14.168) -->
              <if type="broadcast" variable="container-title number title"/>
              <else>
                <names variable="producer"/>
                <names variable="executive-producer"/>
                <names variable="series-creator"/>
                <choose>
                  <if type="broadcast">
                    <names variable="contributor"/>
                  </if>
                </choose>
              </else>
            </choose>
            <names variable="editorial-director"/>
            <names variable="compiler"/>
            <choose>
              <if match="any" type="event performance speech">
                <names variable="chair"/>
                <names variable="organizer"/>
              </if>
            </choose>
            <names variable="curator"/>
            <choose>
              <if match="any" type="software webpage">
                <!-- list under a publisher, developer, or owner/sponsor name (NHR 18.8.1-5) -->
                <text form="short" variable="publisher"/>
              </if>
              <else-if type="standard">
                <!-- `standard` listed in bibliography under organization, but note omits this (cf. CMOS18 14.159) -->
                <text form="short" variable="authority"/>
              </else-if>
            </choose>
            <choose>
              <if type="webpage">
                <!-- website title substituted if no `publisher` (NHR 18.8.1-5) -->
                <text form="short" text-case="title" variable="container-title"/>
              </if>
            </choose>
            <choose>
              <if match="any" variable="container-title event-date event-place event-title genre title publisher publisher-place"/>
              <else-if type="manuscript">
                <text macro="source-archive-short"/>
              </else-if>
            </choose>
          </substitute>
        </names>
      </else>
    </choose>
  </macro>
  <!-- Author elements -->
  <macro name="author-short-and-recipient">
    <group delimiter=" ">
      <choose>
        <!-- inaccessible `interview` or `personal_commmunication`: in-text citation (NHR 17.3.2, cf. CMOS18 14.111) -->
        <if match="none" variable="archive archive-place container-title DOI number publisher references URL">
          <choose>
            <if position="first">
              <!-- at the first citation in shortened forms, give the full name -->
              <names variable="author">
                <name initialize="false"/>
                <!-- never initialize -->
                <substitute>
                  <text macro="title-and-descriptions-short"/>
                </substitute>
              </names>
            </if>
            <else>
              <names variable="author">
                <name form="short" initialize="true"/>
                <substitute>
                  <text macro="title-and-descriptions-short"/>
                </substitute>
              </names>
            </else>
          </choose>
          <choose>
            <if variable="genre"/>
            <!-- recipient appears in the description if there is a `genre`; otherwise after `author` -->
            <else-if position="first">
              <names variable="recipient">
                <label form="verb" suffix=" "/>
                <name initialize="false"/>
                <!-- never initialize -->
              </names>
            </else-if>
            <else>
              <names variable="recipient">
                <label form="verb" suffix=" "/>
                <name form="short" initialize="true"/>
              </names>
            </else>
          </choose>
        </if>
        <!-- accessible `interview` or `personal_communication`: standard citation -->
        <else-if variable="author recipient">
          <names variable="author">
            <name form="short" initialize="true"/>
          </names>
          <choose>
            <if match="none" variable="genre">
              <names variable="recipient">
                <label form="verb" suffix=" "/>
                <name form="short" initialize="true"/>
              </names>
            </if>
          </choose>
        </else-if>
        <else>
          <names variable="author">
            <name form="short" initialize="true"/>
            <substitute>
              <text macro="title-and-descriptions-short"/>
            </substitute>
          </names>
        </else>
      </choose>
    </group>
  </macro>
  <macro name="author-title-substitute">
    <choose>
      <if match="any" type="review review-book" variable="reviewed-author reviewed-genre reviewed-title">
        <!-- If a review has no `reviewed-genre` or `reviewed-title`, assume that `title` contains the title of the reviewed work; the description provides it. -->
        <choose>
          <if variable="reviewed-genre title">
            <text macro="title"/>
          </if>
          <else-if variable="reviewed-genre reviewed-title title">
            <text macro="title"/>
          </else-if>
          <else>
            <text macro="title-and-descriptions"/>
          </else>
        </choose>
      </if>
      <else-if variable="title">
        <text macro="title"/>
      </else-if>
      <else>
        <!-- if an item has no `title`, substitute with descriptions and capitalize -->
        <group delimiter=", ">
          <text macro="description-capitalized"/>
          <text macro="identifier"/>
        </group>
      </else>
    </choose>
  </macro>
  <macro name="author-title-substitute-short">
    <choose>
      <if match="any" type="review review-book" variable="reviewed-author reviewed-genre reviewed-title">
        <!-- If a review has no `reviewed-genre` or `reviewed-title`, assume that `title` contains the title of the reviewed work; the description provides it. -->
        <choose>
          <if variable="reviewed-genre title">
            <text macro="title-short"/>
          </if>
          <else-if variable="reviewed-genre reviewed-title title">
            <text macro="title-short"/>
          </else-if>
          <else>
            <text macro="title-and-descriptions-short"/>
          </else>
        </choose>
      </if>
      <else-if variable="title">
        <text macro="title-short"/>
      </else-if>
      <else>
        <!-- if an item has no `title`, substitute with descriptions and capitalize -->
        <group delimiter=", ">
          <text macro="description-capitalized"/>
          <text macro="identifier"/>
        </group>
      </else>
    </choose>
  </macro>
  <!-- 2. Date -->
  <macro name="date-short">
    <group delimiter="-">
      <choose>
        <if variable="issued">
          <group delimiter=" ">
            <text macro="date-original-year" prefix="[" suffix="]"/>
            <group>
              <choose>
                <if match="none" type="interview personal_communication">
                  <text macro="date-issued-year"/>
                </if>
                <!-- accessible `interview` or `personal_communication` items appear in the bibliography; inaccessible items are in-text only -->
                <else-if match="any" variable="archive archive-place container-title DOI number publisher references URL">
                  <text macro="date-issued-year"/>
                </else-if>
                <else>
                  <text macro="date-issued-full"/>
                </else>
              </choose>
              <text variable="year-suffix"/>
            </group>
          </group>
        </if>
        <else-if variable="available-date">
          <date date-parts="year" form="numeric" variable="available-date"/>
        </else-if>
        <else-if variable="event-date">
          <text macro="date-event-year"/>
        </else-if>
        <else-if variable="status">
          <!-- Print the status variable rather than use generic CSL terms (`in press`, etc.) -->
          <text text-case="lowercase" variable="status"/>
          <text variable="year-suffix"/>
        </else-if>
        <else-if match="any" type="interview personal_communication">
          <choose>
            <if match="any" variable="archive archive-place container-title DOI number publisher references URL">
              <!-- only give n.d. for accessible personal communication (cf. CMOS18 14.111)-->
              <text form="short" term="no date"/>
              <text variable="year-suffix"/>
            </if>
          </choose>
        </else-if>
        <else-if match="any" type="classic collection entry entry-dictionary entry-encyclopedia manuscript">
          <!-- do not give n.d. for archival collections (cf. CMOS18 14.128), `classic` (cf. 14.143), manuscripts (NHR 18.6.2), or reference entries (cf. 14.131) -->
          <text variable="year-suffix"/>
        </else-if>
        <else>
          <text form="short" term="no date"/>
          <text variable="year-suffix"/>
        </else>
      </choose>
    </group>
  </macro>
  <!-- Date elements -->
  <macro name="date-event-full">
    <choose>
      <if is-uncertain-date="issued">
        <choose>
          <if type="book broadcast chapter classic entry interview motion_picture musical_score pamphlet paper-conference post report software song standard webpage">
            <group prefix="[" suffix="]">
              <date form="text" suffix="?" variable="event-date"/>
            </group>
          </if>
          <else>
            <date form="text" suffix="?" variable="event-date"/>
          </else>
        </choose>
      </if>
      <else>
        <date form="text" variable="event-date"/>
      </else>
    </choose>
  </macro>
  <macro name="date-event-year">
    <choose>
      <if is-uncertain-date="issued">
        <choose>
          <if type="book broadcast chapter classic entry interview motion_picture musical_score pamphlet paper-conference post report software song standard webpage">
            <group prefix="[" suffix="]">
              <date date-parts="year" form="numeric" suffix="?" variable="event-date"/>
            </group>
          </if>
          <else>
            <date date-parts="year" form="numeric" suffix="?" variable="event-date"/>
          </else>
        </choose>
      </if>
      <else>
        <date date-parts="year" form="numeric" variable="event-date"/>
      </else>
    </choose>
  </macro>
  <macro name="date-issued-full">
    <choose>
      <if is-uncertain-date="issued">
        <choose>
          <if type="book chapter classic entry entry-dictionary entry-encyclopedia interview musical_score pamphlet paper-conference report thesis">
            <group prefix="[" suffix="]">
              <date form="text" suffix="?" variable="issued"/>
            </group>
          </if>
          <else>
            <date form="text" suffix="?" variable="issued"/>
          </else>
        </choose>
      </if>
      <else>
        <date form="text" variable="issued"/>
      </else>
    </choose>
  </macro>
  <macro name="date-issued-year">
    <choose>
      <if is-uncertain-date="issued">
        <choose>
          <if type="book chapter classic entry entry-dictionary entry-encyclopedia interview musical_score pamphlet paper-conference report thesis">
            <group prefix="[" suffix="]">
              <date date-parts="year" form="numeric" suffix="?" variable="issued"/>
            </group>
          </if>
          <else>
            <date date-parts="year" form="numeric" suffix="?" variable="issued"/>
          </else>
        </choose>
      </if>
      <else>
        <date date-parts="year" form="numeric" variable="issued"/>
      </else>
    </choose>
  </macro>
  <macro name="date-issued-year-month">
    <choose>
      <if is-uncertain-date="issued">
        <choose>
          <if type="book chapter classic entry entry-dictionary entry-encyclopedia interview musical_score pamphlet paper-conference report thesis">
            <group prefix="[" suffix="]">
              <date date-parts="year-month" form="text" suffix="?" variable="issued"/>
            </group>
          </if>
          <else>
            <date date-parts="year-month" form="text" suffix="?" variable="issued"/>
          </else>
        </choose>
      </if>
      <else>
        <date date-parts="year-month" form="text" variable="issued"/>
      </else>
    </choose>
  </macro>
  <macro name="date-original-full">
    <choose>
      <if is-uncertain-date="original-date">
        <choose>
          <if type="book chapter classic entry entry-dictionary entry-encyclopedia interview musical_score pamphlet paper-conference report thesis">
            <group prefix="[" suffix="]">
              <date form="text" suffix="?" variable="original-date"/>
            </group>
          </if>
          <else>
            <date form="text" suffix="?" variable="original-date"/>
          </else>
        </choose>
      </if>
      <else>
        <date form="text" variable="original-date"/>
      </else>
    </choose>
  </macro>
  <macro name="date-original-year">
    <choose>
      <if is-uncertain-date="original-date">
        <choose>
          <if type="book chapter classic entry entry-dictionary entry-encyclopedia interview musical_score pamphlet paper-conference report thesis">
            <group prefix="[" suffix="]">
              <date date-parts="year" form="numeric" suffix="?" variable="original-date"/>
            </group>
          </if>
          <else>
            <date date-parts="year" form="numeric" suffix="?" variable="original-date"/>
          </else>
        </choose>
      </if>
      <else>
        <date date-parts="year" form="numeric" variable="original-date"/>
      </else>
    </choose>
  </macro>
  <macro name="date-original-year-month">
    <choose>
      <if is-uncertain-date="original-date">
        <choose>
          <if type="book chapter classic entry entry-dictionary entry-encyclopedia interview musical_score pamphlet paper-conference report thesis">
            <group prefix="[" suffix="]">
              <date date-parts="year-month" form="text" suffix="?" variable="original-date"/>
            </group>
          </if>
          <else>
            <date date-parts="year-month" form="text" suffix="?" variable="original-date"/>
          </else>
        </choose>
      </if>
      <else>
        <date date-parts="year-month" form="text" variable="original-date"/>
      </else>
    </choose>
  </macro>
  <!-- 3. Title and descriptions (cf. CMOS18 13.87-101) -->
  <macro name="title-and-descriptions">
    <group delimiter=", ">
      <choose>
        <if variable="title">
          <text macro="title"/>
          <text macro="description"/>
          <text macro="identifier"/>
        </if>
        <else>
          <text macro="description"/>
          <text macro="identifier"/>
        </else>
      </choose>
    </group>
  </macro>
  <macro name="title-and-descriptions-short">
    <choose>
      <if variable="title">
        <group delimiter=", ">
          <text macro="title-short"/>
          <choose>
            <if variable="author"/>
            <else-if match="any" type="entry entry-dictionary entry-encyclopedia">
              <!-- give container title to distinguish an unsigned reference entry -->
              <text font-style="italic" form="short" variable="container-title"/>
            </else-if>
          </choose>
        </group>
      </if>
      <else>
        <text macro="description-short"/>
      </else>
    </choose>
  </macro>
  <macro name="title-and-source">
    <group delimiter=", ">
      <group delimiter=" ">
        <group delimiter=", ">
          <group delimiter=" ">
            <group delimiter=", ">
              <choose>
                <if type="chapter" variable="container-title genre title">
                  <text macro="title-and-descriptions"/>
                  <text macro="source"/>
                </if>
                <else-if type="chapter" variable="container-title genre">
                  <!-- 'introduction in' if no title (NHR 18.2.6; cf. CMOS18 14.12, 14.14) -->
                  <group delimiter=" ">
                    <text macro="title-and-descriptions"/>
                    <text macro="source"/>
                  </group>
                </else-if>
                <else-if type="article-journal" variable="container-title genre volume-title">
                  <!-- introduction to a special issue or supplement -->
                  <group delimiter=" ">
                    <text macro="title-and-descriptions"/>
                    <text macro="source"/>
                  </group>
                </else-if>
                <else>
                  <text macro="title-and-descriptions"/>
                  <text macro="source"/>
                </else>
              </choose>
              <text macro="source-monographic-publication-unbracketed"/>
            </group>
            <text macro="source-monographic-publication-bracketed"/>
          </group>
          <choose>
            <!-- Locator for monographic types only; serial locator handled in `source-serial-locator` -->
            <!-- omit serial types -->
            <if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book"/>
            <else-if match="any" variable="collection-editor compiler editor editorial-director">
              <!-- monographic types -->
              <text macro="source-monographic-locator"/>
              <!-- for styles using Roman volume numbers: -->
              <!-- <text macro="source-monographic-locator-roman-volume"/> -->
              <!-- for OGS: -->
              <!-- <text macro="source-monographic-locator-range"/> -->
            </else-if>
            <!-- omit serial types -->
            <else-if match="any" type="interview paper-conference"/>
            <else>
              <text macro="source-monographic-locator"/>
              <!-- for styles using Roman volume numbers: -->
              <!-- <text macro="source-monographic-locator-roman-volume"/> -->
              <!-- for OGS: -->
              <!-- <text macro="source-monographic-locator-range"/> -->
            </else>
          </choose>
        </group>
        <text macro="source-medium" prefix="[" suffix="]"/>
      </group>
      <text macro="source-archive"/>
      <text macro="source-date-accessed-DOI-URL"/>
    </group>
  </macro>
  <!-- 3.1. Title -->
  <macro name="title">
    <choose>
      <if match="any" type="post webpage">
        <!-- part number/title always at the analytic level -->
        <text macro="title-and-part-filter-review"/>
      </if>
      <else-if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">
        <!-- serial types -->
        <text macro="title-and-part-filter-review"/>
      </else-if>
      <else-if match="any" variable="collection-editor compiler editor editorial-director">
        <!-- monographic types -->
        <text macro="title-monographic"/>
      </else-if>
      <else-if match="any" type="interview paper-conference">
        <!-- serial types -->
        <text macro="title-and-part-filter-review"/>
      </else-if>
      <else>
        <!-- monographic types -->
        <text macro="title-monographic"/>
      </else>
    </choose>
  </macro>
  <macro name="title-short">
    <choose>
      <if match="any" type="review review-book" variable="reviewed-author reviewed-genre reviewed-title">
        <!-- If a review has no `reviewed-title`, assume that `title` contains the title of the reviewed work; the description provides it. -->
        <choose>
          <if variable="reviewed-genre title">
            <!-- Quotes, title case -->
            <text form="short" quotes="true" text-case="title" variable="title"/>
          </if>
          <else-if variable="reviewed-genre reviewed-title title">
            <!-- Quotes, title case -->
            <text form="short" quotes="true" text-case="title" variable="title"/>
          </else-if>
          <else>
            <text macro="description-short"/>
          </else>
        </choose>
      </if>
      <else>
        <text macro="title-primary-short"/>
      </else>
    </choose>
  </macro>
  <!-- Title elements -->
  <macro name="title-and-part-filter-review">
    <choose>
      <if match="any" type="review review-book" variable="reviewed-author reviewed-genre reviewed-title">
        <!-- `title` is only the review title if there is a separate `reviewed-genre` or `reviewed-title`; otherwise, it is the title of the reviewed work, printed in the description -->
        <choose>
          <if match="any" variable="reviewed-genre reviewed-title">
            <text macro="title-and-part-title"/>
          </if>
        </choose>
      </if>
      <else>
        <text macro="title-and-part-title"/>
      </else>
    </choose>
  </macro>
  <macro name="title-and-part-title">
    <group delimiter=", ">
      <text macro="title-primary"/>
      <group delimiter=": ">
        <text macro="label-part-number"/>
        <text macro="title-part"/>
      </group>
    </group>
  </macro>
  <macro name="title-monographic">
    <!-- For monographic items, assume `part-number` and `part-title` refer to the book/volume. -->
    <choose>
      <if variable="container-title">
        <text macro="title-primary"/>
      </if>
      <else>
        <!-- For monographic items without `container-title` and with `volume-title`, append `volume-title` to `title` (APA example 30) -->
        <group delimiter=", ">
          <text macro="title-primary"/>
          <text macro="title-volume-and-part"/>
        </group>
      </else>
    </choose>
  </macro>
  <macro name="title-part">
    <choose>
      <if type="patent">
        <!-- No italics or quotes, sentence case -->
        <text form="short" text-case="capitalize-first" variable="part-title"/>
      </if>
      <else-if match="any" type="bill collection legislation regulation treaty">
        <!-- No italics or quotes, title case -->
        <text text-case="title" variable="part-title"/>
      </else-if>
      <else-if match="any" type="book classic graphic hearing map periodical">
        <!-- Italicized, title case (regardless of `container-title`) -->
        <text font-style="italic" text-case="title" variable="part-title"/>
      </else-if>
      <else-if type="entry-encyclopedia" variable="author container-title">
        <!-- Signed encyclopedia entry in quotes, title case (cf. CMOS18 14.132) -->
        <text quotes="true" text-case="title" variable="part-title"/>
      </else-if>
      <else-if type="entry-dictionary" variable="container-title">
        <!-- Quotes, sentence case -->
        <text quotes="true" variable="part-title"/>
      </else-if>
      <else-if type="entry-encyclopedia" variable="container-title">
        <!-- Quotes, sentence case -->
        <text quotes="true" variable="part-title"/>
      </else-if>
      <else-if type="post">
        <!-- Quotes, sentence case -->
        <text quotes="true" variable="part-title"/>
      </else-if>
      <else-if type="webpage">
        <!-- Quotes, title case -->
        <text quotes="true" text-case="title" variable="part-title"/>
      </else-if>
      <!-- Other types are formatted based on presence of `container-title` -->
      <else-if variable="container-title">
        <choose>
          <if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">
            <!-- serial types -->
            <!-- Quotes, title case -->
            <text quotes="true" text-case="title" variable="part-title"/>
          </if>
          <else-if match="any" variable="collection-editor compiler editor editorial-director">
            <!-- monographic types -->
            <!-- Italics, title case -->
            <text font-style="italic" text-case="title" variable="part-title"/>
          </else-if>
          <else-if match="any" type="interview paper-conference">
            <!-- serial types -->
            <!-- Quotes, title case -->
            <text quotes="true" text-case="title" variable="part-title"/>
          </else-if>
          <else>
            <!-- monographic types -->
            <!-- Italics, title case -->
            <text font-style="italic" text-case="title" variable="part-title"/>
          </else>
        </choose>
      </else-if>
      <else-if match="any" type="article dataset document interview manuscript paper-conference personal_communication speech thesis webpage">
        <!-- Container-like but not necessarily with `container-title` -->
        <!-- Quotes, title case -->
        <text quotes="true" text-case="title" variable="part-title"/>
      </else-if>
      <else>
        <!-- Italicized, title case (default) -->
        <text font-style="italic" text-case="title" variable="part-title"/>
      </else>
    </choose>
  </macro>
  <macro name="title-primary">
    <choose>
      <if type="patent">
        <!-- No italics or quotes, sentence case -->
        <text form="short" text-case="capitalize-first" variable="title"/>
      </if>
      <else-if match="any" type="bill collection legislation regulation treaty">
        <!-- No italics or quotes, title case -->
        <text text-case="title" variable="title"/>
      </else-if>
      <else-if match="any" type="book classic graphic hearing map periodical">
        <!-- Italicized, title case (regardless of `container-title`) -->
        <text font-style="italic" text-case="title" variable="title"/>
      </else-if>
      <else-if type="entry-encyclopedia" variable="author container-title">
        <!-- Signed encyclopedia entry in quotes, title case (cf. CMOS18 14.132) -->
        <text quotes="true" text-case="title" variable="title"/>
      </else-if>
      <else-if type="entry-dictionary" variable="container-title">
        <!-- Quotes, sentence case -->
        <text quotes="true" variable="title"/>
      </else-if>
      <else-if type="entry-encyclopedia" variable="container-title">
        <!-- Quotes, sentence case -->
        <text quotes="true" variable="title"/>
      </else-if>
      <else-if type="post">
        <!-- Quotes, sentence case -->
        <text quotes="true" variable="title"/>
      </else-if>
      <!-- Other types are formatted based on presence of `container-title` -->
      <else-if variable="container-title">
        <!-- Quotes, title case -->
        <text quotes="true" text-case="title" variable="title"/>
      </else-if>
      <else-if match="any" type="article dataset document interview manuscript paper-conference personal_communication speech thesis webpage">
        <!-- Container-like but not necessarily with `container-title` -->
        <!-- Quotes, title case -->
        <text quotes="true" text-case="title" variable="title"/>
      </else-if>
      <else>
        <!-- Italicized, title case (default) -->
        <text font-style="italic" text-case="title" variable="title"/>
      </else>
    </choose>
  </macro>
  <macro name="title-primary-short">
    <choose>
      <if type="patent">
        <!-- No italics or quotes, sentence case -->
        <text form="short" text-case="capitalize-first" variable="title"/>
      </if>
      <else-if match="any" type="bill collection legislation regulation treaty">
        <!-- No italics or quotes, title case -->
        <text form="short" text-case="title" variable="title"/>
      </else-if>
      <else-if match="any" type="book classic graphic hearing map periodical">
        <!-- Italicized, title case (regardless of `container-title`) -->
        <text font-style="italic" form="short" text-case="title" variable="title"/>
      </else-if>
      <else-if type="entry-encyclopedia" variable="author container-title">
        <!-- Signed encyclopedia entry in quotes, title case (cf. CMOS18 14.132) -->
        <text form="short" quotes="true" text-case="title" variable="title"/>
      </else-if>
      <else-if type="entry-dictionary" variable="container-title">
        <!-- Quotes, sentence case -->
        <text form="short" quotes="true" variable="title"/>
      </else-if>
      <else-if type="entry-encyclopedia" variable="container-title">
        <!-- Quotes, sentence case -->
        <text form="short" quotes="true" variable="title"/>
      </else-if>
      <else-if type="post">
        <!-- Quotes, sentence case -->
        <text form="short" quotes="true" variable="title"/>
      </else-if>
      <!-- Other types are formatted based on presence of `container-title` -->
      <else-if variable="container-title">
        <!-- Quotes, title case -->
        <text form="short" quotes="true" text-case="title" variable="title"/>
      </else-if>
      <else-if match="any" type="article dataset document interview manuscript paper-conference personal_communication speech thesis webpage">
        <!-- Container-like but not necessarily with `container-title` -->
        <!-- Quotes, title case -->
        <text form="short" quotes="true" text-case="title" variable="title"/>
      </else-if>
      <else>
        <!-- Italicized, title case (default) -->
        <text font-style="italic" form="short" text-case="title" variable="title"/>
      </else>
    </choose>
  </macro>
  <macro name="title-volume">
    <choose>
      <if type="manuscript">
        <!-- Quotes, title case -->
        <text quotes="true" text-case="title" variable="volume-title"/>
      </if>
      <else>
        <!-- Italics, title case -->
        <text font-style="italic" text-case="title" variable="volume-title"/>
      </else>
    </choose>
  </macro>
  <macro name="title-volume-and-part">
    <group delimiter=", ">
      <group delimiter=": ">
        <choose>
          <!-- negotiate with `source-monographic-locator` -->
          <if match="any" variable="part-number part-title volume-title">
            <text macro="label-volume"/>
          </if>
          <else-if locator="column page" match="any"/>
          <else-if variable="locator">
            <!-- remove variable="locator" condition for OGS, which prints ranges -->
            <text macro="label-volume"/>
          </else-if>
          <else-if variable="page"/>
          <else>
            <text macro="label-volume"/>
          </else>
        </choose>
        <text macro="title-volume"/>
      </group>
      <!-- `part-number` and `part-title` of monographic items refer to the source book/volume -->
      <group delimiter=": ">
        <choose>
          <if match="any" variable="part-number part-title volume-title">
            <text macro="label-part-number"/>
          </if>
          <else-if match="any" variable="locator page"/>
          <else>
            <text macro="label-part-number"/>
          </else>
        </choose>
        <text macro="title-part"/>
      </group>
    </group>
  </macro>
  <!-- 3.2. Description -->
  <macro name="description">
    <choose>
      <if match="any" type="interview" variable="interviewer">
        <text macro="description-interview"/>
      </if>
      <else-if match="any" type="review review-book" variable="reviewed-author reviewed-genre reviewed-title">
        <text macro="description-review"/>
      </else-if>
      <else-if type="personal_communication">
        <text macro="description-letter"/>
      </else-if>
      <else-if type="song" variable="composer">
        <text macro="description-song"/>
      </else-if>
      <!-- thesis type appears with university name (cf. CMOS18 14.113) -->
      <else-if type="thesis"/>
      <else-if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">
        <!-- serial types -->
        <text macro="description-serial"/>
      </else-if>
      <else-if type="paper-conference">
        <text macro="description-paper-conference"/>
      </else-if>
      <else-if match="none" variable="container-title">
        <text macro="description-format"/>
      </else-if>
      <!-- For conference presentations/performances/events, chapters in reports/standards/generic documents, software, place description within the source element -->
      <else-if match="any" type="document report software standard"/>
      <else-if match="any" type="event paper-conference performance speech">
        <choose>
          <if match="any" variable="collection-editor compiler editor editorial-director issue page supplement-number volume">
            <text macro="description-format"/>
          </if>
        </choose>
      </else-if>
      <else>
        <text macro="description-format"/>
      </else>
    </choose>
  </macro>
  <macro name="description-capitalized">
    <!-- identical to `description` -->
    <choose>
      <if match="any" type="interview" variable="interviewer">
        <text macro="description-interview-capitalized"/>
      </if>
      <else-if match="any" type="review review-book" variable="reviewed-author reviewed-genre reviewed-title">
        <text macro="description-review-capitalized"/>
      </else-if>
      <else-if type="personal_communication">
        <text macro="description-letter-capitalized"/>
      </else-if>
      <else-if type="song" variable="composer">
        <text macro="description-song-capitalized"/>
      </else-if>
      <!-- thesis type appears with university name (cf. CMOS18 14.113) -->
      <else-if type="thesis"/>
      <else-if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">
        <!-- serial types -->
        <text macro="description-serial-capitalized"/>
      </else-if>
      <else-if type="paper-conference">
        <text macro="description-paper-conference-capitalized"/>
      </else-if>
      <else-if match="none" variable="container-title">
        <text macro="description-format-capitalized"/>
      </else-if>
      <!-- For conference presentations/performances/events, chapters in reports/standards/generic documents, software, place description within the source element -->
      <else-if match="any" type="document report software standard"/>
      <else-if match="any" type="event paper-conference performance speech">
        <choose>
          <if match="any" variable="collection-editor compiler editor editorial-director issue page supplement-number volume">
            <text macro="description-format-capitalized"/>
          </if>
        </choose>
      </else-if>
      <else>
        <text macro="description-format-capitalized"/>
      </else>
    </choose>
  </macro>
  <macro name="description-short">
    <choose>
      <if match="any" type="interview" variable="interviewer">
        <choose>
          <if match="any" variable="archive archive-place container-title DOI number publisher references URL">
            <text macro="description-interview-short"/>
          </if>
          <else>
            <!-- for an inaccessible `interview`, give a full in-text description at the first citation -->
            <choose>
              <if position="first">
                <text macro="description-interview"/>
              </if>
              <else>
                <text macro="description-interview-short"/>
              </else>
            </choose>
          </else>
        </choose>
      </if>
      <else-if match="any" type="review review-book" variable="reviewed-author reviewed-genre reviewed-title">
        <text macro="description-review-short"/>
      </else-if>
      <else-if type="personal_communication">
        <text macro="description-letter-short"/>
      </else-if>
      <else-if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">
        <!-- serial types -->
        <text macro="description-serial-short"/>
      </else-if>
      <else-if match="any" variable="collection-editor compiler editor editorial-director">
        <!-- monographic types -->
        <text macro="description-format-short"/>
      </else-if>
      <else-if type="paper-conference">
        <!-- serial `paper-conference` -->
        <text macro="description-serial-short"/>
      </else-if>
      <else>
        <text macro="description-format-short"/>
      </else>
    </choose>
  </macro>
  <!-- Description elements -->
  <macro name="description-format">
    <choose>
      <if variable="genre number"/>
      <else-if variable="genre">
        <text variable="genre"/>
      </else-if>
      <else-if variable="chapter-number title"/>
      <else-if variable="chapter-number">
        <text macro="label-chapter-number-long"/>
      </else-if>
      <!-- generic labels if unpublished -->
      <else-if match="any" variable="archive archive-place container-title DOI number publisher references URL"/>
      <else-if type="manuscript">
        <!-- 'unpublished manuscript' if no `genre` (cf. CMOS18 14.114) -->
        <text term="manuscript"/>
      </else-if>
      <else-if type="personal_communication">
        <!-- 'personal communication' if no `genre` (cf. CMOS18 14.111) -->
        <text term="personal-communication" text-case="capitalize-first"/>
      </else-if>
    </choose>
  </macro>
  <macro name="description-format-capitalized">
    <choose>
      <if variable="genre number"/>
      <else-if variable="genre">
        <text text-case="capitalize-first" variable="genre"/>
      </else-if>
      <else-if variable="chapter-number title"/>
      <else-if variable="chapter-number">
        <text macro="label-chapter-number-long-capitalized"/>
      </else-if>
      <!-- generic labels if unpublished -->
      <else-if match="any" variable="archive archive-place container-title DOI number publisher references URL"/>
      <else-if type="manuscript">
        <!-- 'unpublished manuscript' if no `genre` (cf. CMOS18 14.114) -->
        <text term="manuscript" text-case="capitalize-first"/>
      </else-if>
      <else-if type="personal_communication">
        <!-- 'personal communication' if no `genre` (cf. CMOS18 14.111) -->
        <text term="personal-communication" text-case="capitalize-first"/>
      </else-if>
    </choose>
  </macro>
  <macro name="description-format-short">
    <group delimiter=" ">
      <choose>
        <if type="chapter" variable="container-title genre">
          <!-- untitled introductions, based on review model (cf. CMOS18 14.101, MHRA4 7.12) -->
          <text form="short" variable="genre"/>
          <choose>
            <if match="none" position="ibid ibid-with-locator">
              <!-- leave out title in repeated references -->
              <text macro="source-monographic-preposition"/>
              <text font-style="italic" form="short" text-case="title" variable="container-title"/>
            </if>
          </choose>
        </if>
        <else-if type="article-journal" variable="container-title genre volume-title">
          <!-- untitled introduction to a special issue or supplement -->
          <text form="short" variable="genre"/>
          <choose>
            <if match="none" position="ibid ibid-with-locator">
              <text macro="source-monographic-preposition"/>
              <text font-style="italic" form="short" text-case="title" variable="volume-title"/>
            </if>
          </choose>
        </else-if>
        <else-if variable="genre">
          <text form="short" variable="genre"/>
        </else-if>
        <else-if variable="medium">
          <text form="short" variable="medium"/>
        </else-if>
        <else-if variable="chapter-number container-title">
          <text macro="label-chapter-number"/>
          <text term="in"/>
          <text font-style="italic" form="short" text-case="title" variable="container-title"/>
        </else-if>
        <else-if variable="chapter-number">
          <text macro="label-chapter-number"/>
        </else-if>
        <!-- generic labels if unpublished -->
        <else-if match="any" variable="archive archive-place container-title DOI number publisher references URL"/>
        <else-if type="manuscript">
          <!-- 'unpublished manuscript' if no `genre` (cf. CMOS18 14.114) -->
          <text term="manuscript"/>
        </else-if>
        <else-if type="personal_communication">
          <!-- 'pers. comm.' if no `genre` (cf. CMOS18 14.111) -->
          <text form="short" term="personal-communication"/>
        </else-if>
      </choose>
    </group>
  </macro>
  <macro name="description-interview">
    <group delimiter=", ">
      <choose>
        <if variable="genre number">
          <!-- `genre` printed with `number` -->
          <names variable="interviewer">
            <label form="verb" suffix=" "/>
            <name initialize="true"/>
          </names>
        </if>
        <else-if variable="genre">
          <group delimiter=" ">
            <text variable="genre"/>
            <group delimiter=" ">
              <text form="verb" term="container-author"/>
              <names variable="interviewer">
                <name initialize="true"/>
              </names>
            </group>
          </group>
        </else-if>
        <else-if variable="interviewer">
          <names variable="interviewer">
            <label form="verb" suffix=" "/>
            <name initialize="true"/>
          </names>
        </else-if>
        <else>
          <text macro="description-format"/>
        </else>
      </choose>
      <text macro="source-event-place-first"/>
    </group>
  </macro>
  <macro name="description-interview-capitalized">
    <group delimiter=", ">
      <choose>
        <if variable="genre number">
          <!-- `genre` printed with `number` -->
          <names variable="interviewer">
            <label form="verb" suffix=" " text-case="capitalize-first"/>
            <name initialize="true"/>
          </names>
        </if>
        <else-if variable="genre">
          <group delimiter=" ">
            <text text-case="capitalize-first" variable="genre"/>
            <group delimiter=" ">
              <text form="verb" term="container-author"/>
              <names variable="interviewer">
                <name initialize="true"/>
              </names>
            </group>
          </group>
        </else-if>
        <else-if variable="interviewer">
          <names variable="interviewer">
            <label form="verb" suffix=" " text-case="capitalize-first"/>
            <name initialize="true"/>
          </names>
        </else-if>
        <else>
          <text macro="description-format-capitalized"/>
        </else>
      </choose>
      <text macro="source-event-place-first"/>
    </group>
  </macro>
  <macro name="description-interview-short">
    <choose>
      <if disambiguate="true">
        <names variable="interviewer">
          <label form="verb" suffix=" "/>
          <name form="short" initialize="true"/>
          <substitute>
            <text macro="description-format-short"/>
          </substitute>
        </names>
      </if>
      <else-if match="any" variable="genre medium">
        <choose>
          <if match="any" variable="author chair collection-editor compiler composer curator director editor editor-translator editorial-director executive-producer guest host illustrator organizer producer series-creator translator">
            <text macro="description-format-short"/>
          </if>
          <else>
            <!-- capitalize if no author or title -->
            <text macro="description-format"/>
          </else>
        </choose>
      </else-if>
      <else>
        <!-- generic description for an unpublished interview (cf. CMOS18 14.108) -->
        <text term="interview"/>
      </else>
    </choose>
  </macro>
  <macro name="description-letter">
    <choose>
      <if variable="recipient">
        <group delimiter=", ">
          <choose>
            <if variable="genre number">
              <!-- `genre` appears with `number` -->
              <names variable="recipient">
                <label form="verb" suffix=" "/>
                <name initialize="true"/>
              </names>
            </if>
            <else>
              <group delimiter=" ">
                <text macro="description-format"/>
                <names variable="recipient">
                  <label form="verb" suffix=" "/>
                  <name initialize="true"/>
                </names>
              </group>
            </else>
          </choose>
          <text variable="event-place"/>
          <text macro="date-event-full"/>
        </group>
      </if>
      <else>
        <text macro="description-format"/>
      </else>
    </choose>
  </macro>
  <macro name="description-letter-capitalized">
    <choose>
      <if variable="recipient">
        <group delimiter=", ">
          <choose>
            <if variable="genre number">
              <!-- `genre` appears with `number` -->
              <names variable="recipient">
                <label form="verb" suffix=" " text-case="capitalize-first"/>
                <name initialize="true"/>
              </names>
            </if>
            <else>
              <group delimiter=" ">
                <text macro="description-format-capitalized"/>
                <names variable="recipient">
                  <label form="verb" suffix=" "/>
                  <name initialize="true"/>
                </names>
              </group>
            </else>
          </choose>
          <text variable="event-place"/>
          <text macro="date-event-full"/>
        </group>
      </if>
      <else>
        <text macro="description-format-capitalized"/>
      </else>
    </choose>
  </macro>
  <macro name="description-letter-short">
    <!-- shortened notes ideally give author, recipient, place, and date (cf. CMOS18 14.13) -->
    <group delimiter=", ">
      <choose>
        <if variable="genre recipient">
          <group delimiter=" ">
            <text macro="description-format-short"/>
            <names variable="recipient">
              <label form="verb" suffix=" "/>
              <name form="short" initialize="true"/>
            </names>
          </group>
        </if>
        <else>
          <text macro="description-format-short"/>
        </else>
      </choose>
      <text variable="event-place"/>
      <choose>
        <if variable="event-date">
          <text macro="date-event-full"/>
        </if>
        <else>
          <text macro="date-issued-full"/>
        </else>
      </choose>
    </group>
  </macro>
  <macro name="description-paper-conference">
    <choose>
      <if match="any" variable="collection-editor compiler editor editorial-director">
        <!-- monographic types -->
        <text macro="description-format"/>
      </if>
      <else>
        <!-- serial types -->
        <group delimiter=", ">
          <text macro="description-serial"/>
          <text macro="source-event"/>
        </group>
      </else>
    </choose>
  </macro>
  <macro name="description-paper-conference-capitalized">
    <choose>
      <if match="any" variable="collection-editor compiler editor editorial-director">
        <!-- monographic types -->
        <text macro="description-format"/>
      </if>
      <else>
        <!-- serial types -->
        <group delimiter=", ">
          <text macro="description-serial"/>
          <text macro="source-event"/>
        </group>
      </else>
    </choose>
  </macro>
  <macro name="description-review">
    <group delimiter=", ">
      <group delimiter=" ">
        <choose>
          <if variable="genre">
            <!-- assume that `genre` is entered as 'Review of the book' or similar -->
            <text variable="genre"/>
          </if>
          <else>
            <text term="review-of"/>
          </else>
        </choose>
        <group delimiter=", ">
          <names variable="reviewed-author">
            <name initialize="true"/>
          </names>
          <text macro="description-review-title"/>
          <text variable="reviewed-genre"/>
        </group>
        <text macro="source-event-place-first" prefix="(" suffix=")"/>
      </group>
      <text macro="label-section"/>
    </group>
  </macro>
  <macro name="description-review-capitalized">
    <group delimiter=", ">
      <group delimiter=" ">
        <choose>
          <if variable="genre">
            <!-- assume that `genre` is entered as 'Review of the book' or similar -->
            <text text-case="capitalize-first" variable="genre"/>
          </if>
          <else>
            <text term="review-of" text-case="capitalize-first"/>
          </else>
        </choose>
        <group delimiter=", ">
          <names variable="reviewed-author">
            <name initialize="true"/>
          </names>
          <text macro="description-review-title"/>
          <text variable="reviewed-genre"/>
        </group>
        <text macro="source-event-place-first" prefix="(" suffix=")"/>
      </group>
      <text macro="label-section"/>
    </group>
  </macro>
  <macro name="description-review-short">
    <choose>
      <if match="any" position="ibid ibid-with-locator">
        <text term="review"/>
      </if>
      <else>
        <group delimiter=" ">
          <text term="review-of"/>
          <text macro="description-review-title-short"/>
        </group>
      </else>
    </choose>
  </macro>
  <macro name="description-review-title">
    <choose>
      <if match="any" variable="reviewed-genre reviewed-title">
        <!-- Not possible to distinguish TV series episode from other reviewed works without a reviewed source title -->
        <!-- Adapt for `reviewed-container-title` or similar if it becomes available -->
        <text font-style="italic" text-case="title" variable="reviewed-title"/>
      </if>
      <else>
        <!-- Assume title is title of reviewed work -->
        <text font-style="italic" text-case="title" variable="title"/>
      </else>
    </choose>
  </macro>
  <macro name="description-review-title-short">
    <choose>
      <if match="any" variable="reviewed-genre reviewed-title">
        <!-- Not possible to distinguish TV series episode from other reviewed works without a reviewed source title -->
        <!-- Adapt for `reviewed-container-title` or similar if it becomes available -->
        <text font-style="italic" form="short" text-case="title" variable="reviewed-title"/>
      </if>
      <else>
        <!-- Assume title is title of reviewed work -->
        <text font-style="italic" form="short" text-case="title" variable="title"/>
      </else>
    </choose>
  </macro>
  <macro name="description-serial">
    <group delimiter=", ">
      <text macro="description-format"/>
      <!-- `section` provides magazine departments (cf. CMOS18 14.88) and newspaper column names (cf. CMOS18 14.93) -->
      <text macro="label-section"/>
    </group>
  </macro>
  <macro name="description-serial-capitalized">
    <group delimiter=", ">
      <text macro="description-format-capitalized"/>
      <!-- `section` provides magazine departments (cf. CMOS18 14.88) and newspaper column names (cf. CMOS18 14.93) -->
      <text macro="label-section"/>
    </group>
  </macro>
  <macro name="description-serial-short">
    <choose>
      <if variable="title"/>
      <else-if variable="genre">
        <text macro="description-format-short"/>
      </else-if>
      <else>
        <text form="short" text-case="title" variable="section"/>
      </else>
    </choose>
  </macro>
  <macro name="description-song">
    <!-- Performer of classical music works -->
    <!-- TODO: remove when Zotero fixes mapping of performer to `author` -->
    <group delimiter=" ">
      <!-- Based on `description-format` macro -->
      <choose>
        <if variable="genre">
          <text variable="genre"/>
          <text form="verb" term="performer"/>
        </if>
      </choose>
      <names variable="author">
        <name delimiter-precedes-last="always" initialize="true"/>
        <substitute>
          <names variable="performer"/>
        </substitute>
      </names>
    </group>
  </macro>
  <macro name="description-song-capitalized">
    <!-- Performer of classical music works -->
    <!-- TODO: remove when Zotero fixes mapping of performer to `author` -->
    <group delimiter=" ">
      <!-- Based on `description-format` macro -->
      <choose>
        <if variable="genre">
          <text text-case="capitalize-first" variable="genre"/>
          <text form="verb" term="performer"/>
        </if>
      </choose>
      <names variable="author">
        <name delimiter-precedes-last="always" initialize="true"/>
        <substitute>
          <names variable="performer"/>
        </substitute>
      </names>
    </group>
  </macro>
  <!-- 3.3. Identifier (contributors) -->
  <macro name="identifier">
    <group delimiter=", ">
      <choose>
        <if type="patent">
          <text macro="identifier-patent"/>
        </if>
        <else-if type="report">
          <text macro="identifier-report"/>
        </else-if>
        <else-if match="any" type="post webpage">
          <!-- print `container-title` on `post` or `webpage` in the same way as `publisher` (NHR 18.8.5, cf. CMOS18 14.104-106) -->
          <text macro="identifier-number"/>
          <text macro="label-version"/>
          <text macro="identifier-edition"/>
          <text macro="identifier-contributors"/>
          <text macro="identifier-volume"/>
        </else-if>
        <else-if variable="container-title">
          <choose>
            <if match="any" type="broadcast graphic map motion_picture">
              <!-- For audiovisual media, number information comes after `title`, not `container-title`; `song` places album catalogue `number` with `publisher` (cf. CMOS18 14.163-164) -->
              <text macro="identifier-number"/>
            </if>
          </choose>
          <text macro="identifier-contributors"/>
        </else-if>
        <else>
          <choose>
            <if match="none" type="song">
              <text macro="identifier-number"/>
            </if>
          </choose>
          <text macro="label-version"/>
          <text macro="identifier-edition"/>
          <text macro="identifier-contributors"/>
          <text macro="identifier-volume"/>
        </else>
      </choose>
    </group>
  </macro>
  <!-- Identifier elements -->
  <macro name="identifier-contributors">
    <choose>
      <if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">
        <text macro="identifier-contributors-serial"/>
      </if>
      <else-if match="any" variable="collection-editor compiler editor editorial-director">
        <text macro="identifier-contributors-monographic"/>
      </else-if>
      <else-if match="any" type="interview paper-conference">
        <text macro="identifier-contributors-serial"/>
      </else-if>
      <else>
        <text macro="identifier-contributors-monographic"/>
      </else>
    </choose>
  </macro>
  <macro name="identifier-contributors-monographic">
    <group delimiter=", ">
      <choose>
        <if match="any" type="post webpage">
          <names variable="container-author">
            <label form="verb" suffix=" "/>
            <name initialize="true"/>
          </names>
          <names variable="editor-translator">
            <label form="verb-short" suffix=" "/>
            <name initialize="true"/>
          </names>
          <names delimiter=", " variable="editor translator">
            <label form="verb-short" suffix=" "/>
            <name initialize="true"/>
          </names>
          <choose>
            <if variable="collection-editor editor"/>
            <else-if variable="collection-editor editor-translator"/>
            <else-if match="any" variable="number-of-volumes part-number part-title volume volume-title">
              <names variable="collection-editor">
                <label form="verb-short" suffix=" "/>
                <name initialize="true"/>
              </names>
            </else-if>
          </choose>
          <names variable="editorial-director">
            <label form="verb-short" suffix=" "/>
            <name initialize="true"/>
          </names>
          <names variable="guest">
            <label form="verb" suffix=" "/>
            <name initialize="true"/>
          </names>
          <names variable="host">
            <label form="verb" suffix=" "/>
            <name initialize="true"/>
          </names>
          <names variable="illustrator">
            <label form="verb-short" suffix=" "/>
            <name initialize="true"/>
          </names>
          <names variable="narrator">
            <label form="verb" suffix=" "/>
            <name initialize="true"/>
          </names>
          <names variable="compiler">
            <label form="verb-short" suffix=" "/>
            <name initialize="true"/>
          </names>
          <names delimiter=", " variable="chair organizer curator">
            <label form="verb" suffix=" "/>
            <name initialize="true"/>
          </names>
          <names delimiter=", " variable="series-creator executive-producer">
            <label form="verb" suffix=" "/>
            <name initialize="true"/>
          </names>
          <names variable="producer">
            <label form="verb" suffix=" "/>
            <name initialize="true"/>
          </names>
          <names variable="director">
            <label form="verb" suffix=" "/>
            <name initialize="true"/>
          </names>
          <choose>
            <if match="any" type="broadcast performance">
              <names variable="script-writer">
                <label form="verb" suffix=" "/>
                <name initialize="true"/>
              </names>
            </if>
          </choose>
          <names variable="performer">
            <label form="verb" suffix=" "/>
            <name initialize="true"/>
          </names>
          <choose>
            <if match="none" type="thesis">
              <names variable="contributor">
                <label form="verb" suffix=" "/>
                <name initialize="true"/>
              </names>
            </if>
          </choose>
        </if>
        <else>
          <!-- print `container-title` on `post` or `webpage` in the same way as `publisher` (NHR 18.8.5, cf. CMOS18 14.104-106) -->
          <choose>
            <if match="none" variable="container-title">
              <names variable="container-author">
                <label form="verb" suffix=" "/>
                <name initialize="true"/>
              </names>
              <names variable="editor-translator">
                <label form="verb-short" suffix=" "/>
                <name initialize="true"/>
              </names>
              <names delimiter=", " variable="editor translator">
                <label form="verb-short" suffix=" "/>
                <name initialize="true"/>
              </names>
              <choose>
                <if variable="collection-editor editor"/>
                <else-if variable="collection-editor editor-translator"/>
                <else-if match="any" variable="number-of-volumes part-number part-title volume volume-title">
                  <names variable="collection-editor">
                    <label form="verb-short" suffix=" "/>
                    <name initialize="true"/>
                  </names>
                </else-if>
              </choose>
              <names variable="editorial-director">
                <label form="verb-short" suffix=" "/>
                <name initialize="true"/>
              </names>
              <names variable="guest">
                <label form="verb" suffix=" "/>
                <name initialize="true"/>
              </names>
              <names variable="host">
                <label form="verb" suffix=" "/>
                <name initialize="true"/>
              </names>
            </if>
          </choose>
          <names variable="illustrator">
            <label form="verb-short" suffix=" "/>
            <name initialize="true"/>
          </names>
          <names variable="narrator">
            <label form="verb" suffix=" "/>
            <name initialize="true"/>
          </names>
          <choose>
            <if match="none" variable="container-title">
              <names variable="compiler">
                <label form="verb-short" suffix=" "/>
                <name initialize="true"/>
              </names>
              <names delimiter=", " variable="chair organizer curator">
                <label form="verb" suffix=" "/>
                <name initialize="true"/>
              </names>
              <names delimiter=", " variable="series-creator executive-producer">
                <label form="verb" suffix=" "/>
                <name initialize="true"/>
              </names>
              <names variable="producer">
                <label form="verb" suffix=" "/>
                <name initialize="true"/>
              </names>
              <names variable="director">
                <label form="verb" suffix=" "/>
                <name initialize="true"/>
              </names>
              <choose>
                <if match="any" type="broadcast performance">
                  <names variable="script-writer">
                    <label form="verb" suffix=" "/>
                    <name initialize="true"/>
                  </names>
                </if>
              </choose>
              <names variable="performer">
                <label form="verb" suffix=" "/>
                <name initialize="true"/>
              </names>
              <choose>
                <if match="none" type="song thesis">
                  <names variable="contributor">
                    <label form="verb" suffix=" "/>
                    <name initialize="true"/>
                  </names>
                </if>
              </choose>
            </if>
          </choose>
          <choose>
            <if type="song">
              <!-- Song contributors attached to album (cf. CMOS18 14.163) -->
              <names variable="contributor">
                <label form="verb" suffix=" "/>
                <name initialize="true"/>
              </names>
            </if>
          </choose>
        </else>
      </choose>
    </group>
  </macro>
  <macro name="identifier-contributors-serial">
    <group delimiter=", ">
      <choose>
        <if type="periodical">
          <names variable="editor">
            <label form="verb-short" suffix=" "/>
            <name initialize="true"/>
          </names>
        </if>
      </choose>
      <names variable="translator">
        <label form="verb-short" suffix=" "/>
        <name initialize="true"/>
      </names>
      <names variable="narrator">
        <label form="verb" suffix=" "/>
        <name initialize="true"/>
      </names>
      <names variable="compiler">
        <label form="verb-short" suffix=" "/>
        <name initialize="true"/>
      </names>
      <names delimiter=", " variable="chair organizer curator">
        <label form="verb" suffix=" "/>
        <name initialize="true"/>
      </names>
      <names delimiter=", " variable="series-creator executive-producer">
        <label form="verb" suffix=" "/>
        <name initialize="true"/>
      </names>
      <names variable="producer">
        <!-- not abbreviated (cf. CMOS18 14.168) -->
        <label form="verb" suffix=" "/>
        <name initialize="true"/>
      </names>
      <names variable="director">
        <label form="verb" suffix=" "/>
        <name initialize="true"/>
      </names>
      <names variable="performer">
        <label form="verb" suffix=" "/>
        <name initialize="true"/>
      </names>
    </group>
  </macro>
  <macro name="identifier-edition">
    <choose>
      <if variable="original-title">
        <text macro="label-edition"/>
      </if>
      <!-- critical editions or original date require placement in brackets -->
      <else-if match="any" type="classic" variable="original-date"/>
      <else-if match="any" variable="collection-editor editor editorial-director">
        <!-- different positioning of edition depending on whether there is a reviser; CSL does not have a proper role for this (NHR 18.2.1) -->
        <text macro="label-edition"/>
      </else-if>
    </choose>
  </macro>
  <macro name="identifier-number">
    <group delimiter=" ">
      <choose>
        <if type="thesis"/>
        <else-if is-numeric="number" type="broadcast" variable="genre">
          <text variable="genre"/>
          <text variable="number"/>
        </else-if>
        <else-if is-numeric="number" type="broadcast">
          <text value="episode"/>
          <text variable="number"/>
        </else-if>
        <else-if variable="number">
          <text variable="genre"/>
          <text macro="label-number"/>
        </else-if>
      </choose>
    </group>
  </macro>
  <macro name="identifier-patent">
    <group delimiter=", ">
      <group delimiter=" ">
        <!-- `authority`: US ; `genre`: patent ; `number`: 123,445 -->
        <text form="short" variable="authority"/>
        <!-- 'US Patent' capitalized in both bibliography and note forms -->
        <choose>
          <if variable="genre">
            <text text-case="capitalize-first" variable="genre"/>
          </if>
          <else>
            <text term="patent" text-case="capitalize-first"/>
          </else>
        </choose>
        <text variable="number"/>
      </group>
      <group delimiter=" ">
        <text value="filed"/>
        <date form="text" variable="submitted"/>
      </group>
      <group delimiter=" ">
        <choose>
          <if variable="issued submitted">
            <text term="and"/>
          </if>
        </choose>
        <text value="issued"/>
        <!-- Always give full issue date, even in author-date (cf. CMOS18 14.158) -->
        <text macro="date-issued-full"/>
      </group>
    </group>
  </macro>
  <macro name="identifier-report">
    <group delimiter=", ">
      <choose>
        <if variable="container-title">
          <!-- If the report is a chapter in a larger report, then most identifying information is printed in the source. -->
          <text macro="identifier-contributors"/>
        </if>
        <else-if variable="title">
          <text macro="identifier-number"/>
          <text macro="identifier-contributors"/>
        </else-if>
        <else>
          <!-- If there is no `title`, then `genre` and `number` are already printed as the title. -->
          <text macro="identifier-contributors"/>
        </else>
      </choose>
    </group>
  </macro>
  <macro name="identifier-volume">
    <choose>
      <!-- notes show the number of volumes only when not referring to a specific volume -->
      <if match="any" variable="part-number part-title volume volume-title"/>
      <!-- unlike Chicago, display the number of volumes with a locator (NHR 18.2.7) -->
      <else>
        <text macro="label-number-of-volumes"/>
      </else>
    </choose>
  </macro>
  <!-- 4. Source -->
  <macro name="source">
    <choose>
      <if type="patent"/>
      <else-if match="any" type="post webpage">
        <!-- print `container-title` on `post` or `webpage` in the same way as `publisher` (NHR 18.8.5, cf. CMOS18 14.104-106) -->
        <text text-case="title" variable="container-title"/>
      </else-if>
      <else-if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">
        <text macro="source-serial"/>
      </else-if>
      <else-if match="any" variable="collection-editor compiler editor editorial-director">
        <text macro="source-monographic"/>
      </else-if>
      <else-if match="any" type="interview paper-conference">
        <text macro="source-serial"/>
      </else-if>
      <else>
        <text macro="source-monographic"/>
      </else>
    </choose>
  </macro>
  <!-- 4.1. Serial sources -->
  <macro name="source-serial">
    <group delimiter=", ">
      <text macro="source-serial-title-volume"/>
      <choose>
        <!-- use correct punctuation depending on whether a bracket immediately follows the title -->
        <if type="article-newspaper">
          <group delimiter=" ">
            <text macro="source-serial-title"/>
            <text macro="source-serial-identifier"/>
          </group>
        </if>
        <else-if match="any" variable="collection-title issue supplement-number volume">
          <text macro="source-serial-title"/>
          <text macro="source-serial-identifier"/>
        </else-if>
        <else-if type="interview" variable="publisher">
          <!-- publisher possible with `interview` (NHR 18.7.3) -->
          <text macro="source-serial-title"/>
          <group delimiter=" ">
            <text variable="publisher"/>
            <text macro="source-serial-identifier"/>
            <!-- for author-date: -->
            <!-- <text macro="source-serial-identifier-author-date"/> -->
          </group>
        </else-if>
        <else>
          <group delimiter=" ">
            <text macro="source-serial-title"/>
            <text macro="source-serial-identifier"/>
            <!-- for author-date: -->
            <!-- <text macro="source-serial-identifier-author-date"/> -->
          </group>
        </else>
      </choose>
    </group>
  </macro>
  <!-- Serial source title -->
  <macro name="source-serial-name">
    <group delimiter=" ">
      <text font-style="italic" text-case="title" variable="container-title"/>
      <choose>
        <!-- TODO: remove conditional when Zotero stops double-mapping `event-place` and `publisher-place` -->
        <if match="none" variable="event-date event-title">
          <text prefix="(" suffix=")" variable="publisher-place"/>
        </if>
      </choose>
    </group>
  </macro>
  <macro name="source-serial-title">
    <group delimiter=", ">
      <choose>
        <!-- Journal special issues and supplements (cf. CMOS18 14.77-78, MHRA4 7.4) -->
        <if match="none" variable="container-title"/>
        <else-if match="none" type="periodical" variable="supplement-number volume-title"/>
        <!-- TODO: use `container-genre` here once available to allow a custom description of the journal volume -->
        <else-if variable="supplement-number volume-title">
          <text term="supplement"/>
        </else-if>
        <else-if type="periodical" variable="supplement-number title">
          <text term="supplement"/>
        </else-if>
        <else-if variable="volume-title">
          <text term="special-issue"/>
        </else-if>
        <else-if type="periodical" variable="title">
          <text term="special-issue"/>
        </else-if>
      </choose>
      <group delimiter=" ">
        <choose>
          <!-- 'in' for reviews only (NHR 18.3.5) -->
          <if match="none" variable="container-title"/>
          <else-if match="any" type="periodical" variable="supplement-number volume-title"/>
          <else-if match="any" type="review review-book" variable="reviewed-author reviewed-genre reviewed-title">
            <text term="in"/>
          </else-if>
        </choose>
        <text macro="source-serial-name"/>
      </group>
    </group>
  </macro>
  <macro name="source-serial-title-volume">
    <choose>
      <if variable="volume-title">
        <!-- Journal special issues (cf. CMOS18 14.77) and supplements (cf. CMOS18 14.78) -->
        <group delimiter=", ">
          <group delimiter=" ">
            <text term="in"/>
            <group delimiter=", ">
              <text macro="source-monographic-author"/>
              <text macro="title-volume"/>
            </group>
          </group>
        </group>
      </if>
    </choose>
  </macro>
  <!-- Serial source identifier -->
  <macro name="source-serial-identifier">
    <group delimiter=", ">
      <text macro="source-serial-identifier-volume"/>
      <!-- periodical edition always capitalized (cf. CMOS18 14.89) -->
      <text macro="label-edition-capitalized"/>
      <text macro="source-serial-locator"/>
      <!-- for OGS: -->
      <!-- <text macro="source-serial-locator-range"/> -->
    </group>
  </macro>
  <macro name="source-serial-identifier-volume">
    <group delimiter=", ">
      <!-- `collection-title` is for any serial with multiple series (e.g. 'second series') -->
      <text variable="collection-title"/>
      <choose>
        <if type="article-newspaper">
          <!-- newspapers cited by date (NHR 18.3.3) -->
          <text macro="source-serial-volume-status" prefix="(" suffix=")"/>
        </if>
        <else-if match="any" variable="issue supplement-number volume">
          <group delimiter=" ">
            <group delimiter=", ">
              <choose>
                <if variable="issue volume">
                  <group delimiter="/">
                    <text variable="volume"/>
                    <!-- for original Hart's Rules or other options with Roman volume numbers for serials (as shown in NHR 18.1.3) -->
                    <!-- <text macro="label-volume"/> -->
                    <text variable="issue"/>
                  </group>
                </if>
                <else>
                  <text variable="volume"/>
                  <!-- for serial Roman volume numbers: -->
                  <!-- <text macro="label-volume"/> -->
                  <text macro="label-issue"/>
                </else>
              </choose>
              <text macro="label-supplement-number"/>
            </group>
            <text macro="source-date" prefix="(" suffix=")"/>
          </group>
        </else-if>
        <else-if variable="container-title">
          <text macro="source-serial-volume-status" prefix="(" suffix=")"/>
        </else-if>
        <else-if type="interview" variable="publisher">
          <text macro="source-serial-volume-status" prefix="(" suffix=")"/>
        </else-if>
        <else>
          <text macro="source-serial-volume-status"/>
        </else>
      </choose>
    </group>
  </macro>
  <macro name="source-serial-volume-status">
    <group delimiter=", ">
      <choose>
        <if match="none" variable="issue number page supplement-number volume">
          <group delimiter=" ">
            <!-- article accepted for publication and available on publisher website (cf. CMOS18 14.75) -->
            <!-- TODO: use CSL term for `available-date` when available -->
            <text value="accepted"/>
            <date form="text" variable="available-date"/>
          </group>
        </if>
      </choose>
      <group delimiter=" ">
        <text macro="source-date-status"/>
        <text macro="source-date"/>
      </group>
    </group>
  </macro>
  <!-- Serial source locator -->
  <macro name="source-serial-locator">
    <choose>
      <if match="any" variable="locator number">
        <group delimiter=", ">
          <text macro="label-locator"/>
          <!-- `number` is an article ID (cf. CMOS18 14.71) -->
          <choose>
            <!-- if there is an `archive` with no other reference, `number` appears in `source-archive-database-number` -->
            <if match="any" variable="archive_collection archive_location archive-place">
              <text macro="label-number-article"/>
            </if>
            <else-if variable="archive"/>
            <else>
              <text macro="label-number-article"/>
            </else>
          </choose>
        </group>
      </if>
      <else>
        <text variable="page"/>
      </else>
    </choose>
  </macro>
  <!-- 4.2. Monographic sources -->
  <macro name="source-monographic">
    <group delimiter=", ">
      <!-- Monographic sources repeat main reference elements -->
      <choose>
        <if variable="container-title">
          <group delimiter=", ">
            <group delimiter=" ">
              <text macro="source-monographic-preposition"/>
              <group delimiter=", ">
                <text macro="source-monographic-author"/>
                <text macro="source-monographic-title"/>
              </group>
            </group>
            <text macro="source-monographic-description"/>
            <text macro="source-monographic-identifier"/>
          </group>
        </if>
      </choose>
      <!-- remove `source-series` for OGS: -->
      <text macro="source-series"/>
      <text macro="source-event"/>
    </group>
  </macro>
  <!-- Monographic source title -->
  <macro name="source-monographic-preposition">
    <choose>
      <if match="any" type="broadcast motion_picture"/>
      <else-if variable="chapter-number page title">
        <text term="in"/>
      </else-if>
      <else-if variable="chapter-number title">
        <group delimiter=" ">
          <text macro="label-chapter-number"/>
          <text term="in"/>
        </group>
      </else-if>
      <else>
        <text term="in"/>
      </else>
    </choose>
  </macro>
  <macro name="source-monographic-author">
    <!-- based on `author-note` -->
    <names variable="container-author">
      <name initialize="true"/>
      <label form="short" prefix=", "/>
      <!-- for OGS or variants with bracketed roles: -->
      <!-- <label form="short" prefix=" (" suffix=")"/> -->
      <substitute>
        <names variable="author"/>
        <names variable="guest"/>
        <names variable="host"/>
        <choose>
          <if type="song">
            <names variable="performer"/>
          </if>
        </choose>
        <names variable="illustrator"/>
        <choose>
          <if match="none" type="classic performance standard">
            <names variable="editor-translator"/>
            <names variable="editor"/>
            <names variable="translator"/>
            <names variable="collection-editor"/>
          </if>
        </choose>
        <names variable="director"/>
        <choose>
          <!-- serial `broadcast` prioritizes title (cf. CMOS18 14.165, 14.168) -->
          <if type="broadcast" variable="container-title number title"/>
          <else>
            <names variable="producer"/>
            <names variable="executive-producer"/>
            <names variable="series-creator"/>
            <choose>
              <if type="broadcast">
                <names variable="contributor"/>
              </if>
            </choose>
          </else>
        </choose>
        <names variable="editorial-director"/>
        <names variable="compiler"/>
        <choose>
          <if match="any" type="event performance speech">
            <names variable="chair"/>
            <names variable="organizer"/>
          </if>
        </choose>
        <names variable="curator"/>
      </substitute>
    </names>
  </macro>
  <macro name="source-monographic-title">
    <group delimiter=", ">
      <text font-style="italic" text-case="title" variable="container-title"/>
      <text macro="title-volume-and-part"/>
    </group>
  </macro>
  <!-- Monographic source description -->
  <macro name="source-monographic-description">
    <choose>
      <if type="software">
        <!-- For entries in mobile app reference works, place description after `container-title` -->
        <text macro="description-format"/>
      </if>
      <else-if match="any" type="document report standard">
        <!-- For chapters in report, standards, and generic documents, place description after `container-title` -->
        <text macro="description-format"/>
      </else-if>
      <else-if match="any" variable="collection-editor compiler editor editorial-director issue page supplement-number volume"/>
      <else-if match="any" type="event paper-conference performance speech">
        <!-- unpublished conference presentations should describe the session -->
        <text macro="description-format"/>
      </else-if>
    </choose>
  </macro>
  <!-- Monographic source identifier -->
  <macro name="source-monographic-identifier">
    <!-- Based on `identifier` -->
    <choose>
      <if variable="container-title">
        <group delimiter=", ">
          <choose>
            <if match="none" type="broadcast graphic map motion_picture song">
              <!-- For audiovisual media, number information comes after `title`, not `container-title`; `song` places album catalogue `number` with `publisher` (cf. CMOS18 14.163-164) -->
              <text macro="identifier-number"/>
            </if>
          </choose>
          <text macro="label-version"/>
          <text macro="identifier-edition"/>
          <text macro="source-monographic-identifier-contributors"/>
          <text macro="identifier-volume"/>
        </group>
      </if>
    </choose>
  </macro>
  <macro name="source-monographic-identifier-contributors">
    <group delimiter=", ">
      <names variable="editor-translator">
        <label form="verb-short" suffix=" "/>
        <name initialize="true"/>
      </names>
      <names delimiter=", " variable="editor translator">
        <label form="verb-short" suffix=" "/>
        <name initialize="true"/>
      </names>
      <choose>
        <if variable="collection-editor editor"/>
        <else-if variable="collection-editor editor-translator"/>
        <else-if match="any" variable="number-of-volumes part-number part-title volume volume-title">
          <names variable="collection-editor">
            <label form="verb-short" suffix=" "/>
            <name initialize="true"/>
          </names>
        </else-if>
      </choose>
      <names variable="guest">
        <label form="verb" suffix=" "/>
        <name initialize="true"/>
      </names>
      <names variable="host">
        <label form="verb" suffix=" "/>
        <name initialize="true"/>
      </names>
      <names delimiter=", " variable="chair organizer">
        <label form="verb" suffix=" "/>
        <name initialize="true"/>
      </names>
      <names variable="illustrator">
        <label form="verb-short" suffix=" "/>
        <name initialize="true"/>
      </names>
      <names variable="narrator">
        <label form="verb" suffix=" "/>
        <name initialize="true"/>
      </names>
      <names variable="compiler">
        <label form="verb-short" suffix=" "/>
        <name initialize="true"/>
      </names>
      <names variable="curator">
        <label form="verb" suffix=" "/>
        <name initialize="true"/>
      </names>
      <names delimiter=", " variable="series-creator executive-producer">
        <label form="verb" suffix=" "/>
        <name initialize="true"/>
      </names>
      <names variable="producer">
        <label form="verb" suffix=" "/>
        <name initialize="true"/>
      </names>
      <names variable="editorial-director">
        <label form="verb-short" suffix=" "/>
        <name initialize="true"/>
      </names>
      <choose>
        <if match="any" type="broadcast performance">
          <names variable="script-writer">
            <label form="verb" suffix=" "/>
            <name initialize="true"/>
          </names>
        </if>
      </choose>
      <names variable="director">
        <label form="verb" suffix=" "/>
        <name initialize="true"/>
      </names>
      <names variable="performer">
        <label form="verb" suffix=" "/>
        <name initialize="true"/>
      </names>
      <choose>
        <if match="none" type="song thesis">
          <!-- Song contributors attached to album (cf. CMOS18 14.163) -->
          <names variable="contributor">
            <label form="verb" suffix=" "/>
            <name initialize="true"/>
          </names>
        </if>
      </choose>
    </group>
  </macro>
  <!-- Monographic source locator -->
  <macro name="source-monographic-locator">
    <group delimiter=".">
      <choose>
        <!-- archival locators appear after the shelfmark (cf. CMOS18 14.127) -->
        <if locator="column" variable="archive archive_location"/>
        <else-if locator="folio" variable="archive archive_location"/>
        <else-if locator="page" variable="archive archive_location"/>
        <else-if is-numeric="volume" locator="column">
          <!-- separate a volume and column number with a point (NHR 17.2.5) -->
          <choose>
            <if match="none" variable="part-number part-title volume-title">
              <text variable="volume"/>
            </if>
          </choose>
          <text variable="locator"/>
        </else-if>
        <else-if is-numeric="volume" locator="page">
          <!-- separate a volume and page number with a point (NHR 17.2.5) -->
          <choose>
            <if match="none" variable="part-number part-title volume-title">
              <text variable="volume"/>
            </if>
          </choose>
          <text variable="locator"/>
        </else-if>
        <else-if variable="locator">
          <text macro="label-locator"/>
        </else-if>
        <else-if is-numeric="volume" variable="page">
          <!-- collapse the volume and page number if adjacent (NHR 17.2.5) -->
          <choose>
            <!-- check for variables that might come between the volume and page number -->
            <if match="none" variable="part-number part-title volume-title">
              <text variable="volume"/>
            </if>
          </choose>
          <text variable="page"/>
        </else-if>
        <!-- archival locators appear after the shelfmark (cf. CMOS18 14.127) -->
        <else-if variable="archive archive_location page"/>
        <else>
          <text variable="page"/>
        </else>
      </choose>
    </group>
  </macro>
  <!-- 4.3. Series -->
  <macro name="source-series">
    <group delimiter=", ">
      <text text-case="title" variable="collection-title"/>
      <text variable="collection-number"/>
      <!-- for Roman collection numbers (old Hart's Rules): -->
      <!-- <number form="roman" variable="collection-number"/> -->
      <text macro="label-issue"/>
    </group>
  </macro>
  <!-- 4.4. Event -->
  <macro name="source-event">
    <group delimiter=" ">
      <choose>
        <!-- omit types that provide event information in description  -->
        <if match="any" type="interview" variable="interviewer"/>
        <else-if type="personal_communication" variable="recipient"/>
        <else-if match="any" type="review review-book" variable="reviewed-author reviewed-genre reviewed-title"/>
        <else-if match="any" variable="event event-date event-title">
          <!-- TODO: To prevent Zotero from printing `event-place`, due to its double-mapping of `publisher-place` and `event-place`. Remove this when that is changed. -->
          <choose>
            <if type="paper-conference">
              <choose>
                <if match="none" variable="collection-editor compiler editor editorial-director issue page supplement-number volume">
                  <!-- Don't print event info for conference papers published in proceedings -->
                  <text macro="source-event-status"/>
                  <text macro="source-event-description"/>
                </if>
              </choose>
            </if>
            <else>
              <!-- For other item types, print event info even if published (e.g. collection catalogues, performance programmes). -->
              <text macro="source-event-status"/>
              <text macro="source-event-description"/>
            </else>
          </choose>
        </else-if>
      </choose>
    </group>
  </macro>
  <macro name="source-event-place-first">
    <!-- for descriptive elements for interviews, reviews, letters -->
    <choose>
      <if match="any" variable="event event-date event-title">
        <group delimiter=", ">
          <text variable="event-title"/>
          <text variable="event-place"/>
          <text macro="date-event-full"/>
        </group>
      </if>
    </choose>
  </macro>
  <macro name="source-event-status">
    <group delimiter=" ">
      <choose>
        <if type="broadcast" variable="status">
          <!-- 'aired', 'performed', etc. (cf. CMOS18 14.165) -->
          <text variable="status"/>
        </if>
        <else-if type="paper-conference">
          <choose>
            <if variable="genre">
              <text value="delivered"/>
            </if>
            <else>
              <text form="short" term="paper-conference"/>
              <text value="delivered"/>
            </else>
          </choose>
          <choose>
            <if match="any" variable="event event-title">
              <text term="at"/>
            </if>
          </choose>
        </else-if>
        <else-if type="song">
          <text value="rec."/>
          <choose>
            <if variable="event-title">
              <text term="at"/>
            </if>
          </choose>
        </else-if>
        <else-if variable="event-date issued"/>
        <else-if variable="issued"/>
        <else>
          <text variable="status"/>
        </else>
      </choose>
    </group>
  </macro>
  <macro name="source-event-title">
    <choose>
      <!-- TODO: We expect `event-title` to be used, but processors and applications may not be updated yet. This macro ensures that either `event` or `event-title` can be accepted. Remove if processor logic and application adoption can handle this. -->
      <if variable="event-title">
        <text variable="event-title"/>
      </if>
      <else>
        <text variable="event"/>
      </else>
    </choose>
  </macro>
  <macro name="source-event-description">
    <group delimiter=", ">
      <text macro="source-event-title"/>
      <text macro="date-event-full"/>
      <text variable="event-place"/>
    </group>
  </macro>
  <!-- 4.5. Facts of publication -->
  <macro name="source-monographic-publication">
    <group delimiter="; ">
      <choose>
        <!-- `patent` date in identification (cf. CMOS18 14.158) -->
        <if type="patent"/>
        <!-- omit serial types -->
        <else-if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book"/>
        <else-if match="any" variable="collection-editor compiler editor editorial-director">
          <!-- monographic types -->
          <!-- add for OGS: -->
          <!-- <text macro="source-series"/> -->
          <text macro="source-publication-and-date"/>
        </else-if>
        <!-- omit serial types -->
        <else-if match="any" type="interview paper-conference"/>
        <else>
          <!-- monographic types -->
          <!-- add for OGS: -->
          <!-- <text macro="source-series"/> -->
          <text macro="source-publication-and-date"/>
        </else>
      </choose>
      <text macro="source-publication-original-title"/>
    </group>
  </macro>
  <macro name="source-monographic-publication-bracketed">
    <!-- Facts of publication with brackets for print monographic formats -->
    <choose>
      <if match="any" type="book broadcast chapter classic entry interview motion_picture musical_score pamphlet paper-conference post report software song standard webpage">
        <text macro="source-monographic-publication" prefix="(" suffix=")"/>
      </if>
      <else-if type="article" variable="genre publisher">
        <!-- without brackets for a preprint in a repository (cf. CMOS18 14.76), with brackets for a working paper (cf. CMOS18 14.116) -->
        <text macro="source-monographic-publication" prefix="(" suffix=")"/>
      </else-if>
      <!-- dictionary/encyclopedia entries probably are bracketed only with publisher (cf. MHRA4 7.5) -->
      <else-if type="entry-dictionary" variable="publisher">
        <text macro="source-monographic-publication" prefix="(" suffix=")"/>
      </else-if>
      <else-if type="entry-encyclopedia" variable="publisher">
        <text macro="source-monographic-publication" prefix="(" suffix=")"/>
      </else-if>
      <else-if type="personal_communication">
        <choose>
          <if match="any" variable="collection-editor compiler editor editorial-director issue page supplement-number volume">
            <!-- in an edited collection -->
            <text macro="source-monographic-publication" prefix="(" suffix=")"/>
          </if>
        </choose>
      </else-if>
    </choose>
  </macro>
  <macro name="source-monographic-publication-unbracketed">
    <!-- Facts of publication without brackets -->
    <choose>
      <if match="any" type="book broadcast chapter classic entry interview motion_picture musical_score pamphlet paper-conference post report software song standard webpage"/>
      <else-if type="article" variable="genre publisher"/>
      <else-if type="entry-dictionary" variable="publisher"/>
      <else-if type="entry-encyclopedia" variable="publisher"/>
      <else-if type="personal_communication">
        <choose>
          <if match="none" variable="collection-editor compiler editor editorial-director issue page supplement-number volume">
            <!-- not in an edited collection -->
            <text macro="source-monographic-publication"/>
          </if>
        </choose>
      </else-if>
      <else>
        <text macro="source-monographic-publication"/>
      </else>
    </choose>
  </macro>
  <macro name="source-monographic-publication-short-bracketed">
    <!-- mirrors `source-monographic-publication-bracketed` -->
    <group delimiter=", " prefix="(" suffix=")">
      <choose>
        <if disambiguate="true" match="none"/>
        <!-- Facts of publication with brackets for print monographic formats -->
        <else-if match="any" type="book chapter classic entry entry-dictionary entry-encyclopedia interview musical_score pamphlet paper-conference report thesis">
          <choose>
            <if disambiguate="true">
              <text macro="source-publication-publisher"/>
            </if>
          </choose>
          <text macro="source-date"/>
        </else-if>
        <else-if type="article" variable="genre publisher">
          <!-- without brackets for a preprint in a repository (cf. CMOS18 14.76), with brackets for a working paper (cf. CMOS18 14.116) -->
          <choose>
            <if disambiguate="true">
              <text macro="source-publication-publisher"/>
            </if>
          </choose>
          <text macro="source-date"/>
        </else-if>
        <else-if type="motion_picture" variable="publisher">
          <choose>
            <if disambiguate="true">
              <text macro="source-publication-publisher"/>
            </if>
          </choose>
          <text macro="source-date"/>
        </else-if>
        <else-if type="personal_communication">
          <choose>
            <if match="any" variable="collection-editor compiler editor editorial-director issue page supplement-number volume">
              <!-- in an edited collection -->
              <text macro="source-date"/>
            </if>
          </choose>
        </else-if>
      </choose>
    </group>
  </macro>
  <macro name="source-monographic-publication-short-unbracketed">
    <!-- mirrors `source-monographic-publication-unbracketed` -->
    <choose>
      <if disambiguate="true" match="none"/>
      <!-- Facts of publication without brackets -->
      <else-if match="any" type="book chapter classic entry entry-dictionary entry-encyclopedia interview musical_score pamphlet paper-conference report thesis"/>
      <else-if type="article" variable="genre publisher"/>
      <else-if type="motion_picture" variable="publisher"/>
      <else-if type="personal_communication">
        <choose>
          <if match="none" variable="collection-editor compiler editor editorial-director issue page supplement-number volume">
            <!-- not in an edited collection -->
            <text macro="source-date"/>
          </if>
        </choose>
      </else-if>
      <else>
        <text macro="source-date"/>
      </else>
    </choose>
  </macro>
  <macro name="source-publication-and-date">
    <group delimiter=", ">
      <text macro="source-publication-history"/>
      <group delimiter=" ">
        <text macro="source-date-status"/>
        <text macro="source-date"/>
      </group>
    </group>
  </macro>
  <!-- Facts of publication elements -->
  <macro name="source-publication-description">
    <choose>
      <if type="article" variable="genre"/>
      <else-if type="article">
        <!-- `preprint` term attached to repository name, but specific working paper descriptors appear in description (cf. CMOS18 14.76, 14.116) -->
        <text term="preprint"/>
      </else-if>
      <else-if type="thesis">
        <!-- thesis type appears with university name (cf. MHRA4 7.10) -->
        <text variable="genre"/>
      </else-if>
      <else-if match="any" variable="original-publisher original-publisher-place">
        <choose>
          <!-- `edition` provides an alternative label to `reprint` (cf. CMOS18 14.16) -->
          <if match="any" variable="edition original-title"/>
          <else-if match="none" type="book chapter classic entry entry-dictionary entry-encyclopedia interview musical_score pamphlet paper-conference report thesis"/>
          <else-if variable="issued original-date">
            <text value="repr."/>
          </else-if>
        </choose>
      </else-if>
    </choose>
  </macro>
  <macro name="source-publication-history">
    <choose>
      <if variable="original-title">
        <!-- `original-title` is covered in `source-publication-original-title-bib` -->
        <group delimiter=", ">
          <text macro="source-publication-description"/>
          <choose>
            <if match="none" variable="collection-editor editor editorial-director">
              <!-- different positioning of edition depending on whether there is a reviser; CSL does not have a proper role for this (NHR 18.2.1) -->
              <text macro="label-edition"/>
            </if>
          </choose>
          <text macro="source-publication-publisher"/>
        </group>
      </if>
      <else>
        <group delimiter="; ">
          <group delimiter=", ">
            <text macro="source-publication-publisher-original"/>
            <text macro="source-date-original"/>
          </group>
          <group delimiter=", ">
            <choose>
              <if match="any" type="classic" variable="original-date">
                <text macro="label-edition"/>
              </if>
              <!-- different positioning of edition depending on whether there is a reviser; CSL does not have a proper role for this (NHR 18.2.1) -->
              <else-if match="any" variable="collection-editor editor editorial-director"/>
              <else>
                <text macro="label-edition"/>
              </else>
            </choose>
            <group delimiter=", ">
              <text macro="source-publication-description"/>
              <text macro="source-publication-publisher"/>
            </group>
          </group>
        </group>
      </else>
    </choose>
  </macro>
  <macro name="source-publication-original-title">
    <!-- Work originally published under a different title (cf. CMOS18 13.101) -->
    <choose>
      <if variable="original-title">
        <group delimiter=" ">
          <text form="short" term="original-work-published"/>
          <choose>
            <if match="none" variable="original-author">
              <text value="as"/>
            </if>
          </choose>
          <group delimiter=", ">
            <names variable="original-author">
              <name initialize="true"/>
            </names>
            <text font-style="italic" text-case="title" variable="original-title"/>
          </group>
          <group delimiter=", " prefix="[" suffix="]">
            <text macro="source-publication-publisher-original"/>
            <text macro="source-date-original"/>
          </group>
        </group>
      </if>
    </choose>
  </macro>
  <macro name="source-publication-publisher">
    <group delimiter=" ">
      <choose>
        <if match="any" type="book chapter classic collection entry entry-dictionary entry-encyclopedia interview manuscript musical_score pamphlet paper-conference performance report">
          <group delimiter=": ">
            <choose>
              <if variable="publisher-place">
                <text variable="publisher-place"/>
              </if>
              <else-if type="report">
                <text variable="publisher"/>
              </else-if>
              <else-if match="any" type="classic entry entry-dictionary entry-encyclopedia interview manuscript personal_communication" variable="original-publisher-place"/>
              <else>
                <text form="short" term="no-place"/>
              </else>
            </choose>
            <text variable="publisher"/>
          </group>
        </if>
        <else>
          <text variable="publisher"/>
        </else>
      </choose>
      <choose>
        <if type="song">
          <!-- Album catalogue number follows label name (NHR 18.7.2; cf. CMOS18 14.163-164) -->
          <text variable="number"/>
        </if>
      </choose>
    </group>
  </macro>
  <macro name="source-publication-publisher-original">
    <choose>
      <if match="any" type="book chapter classic entry entry-dictionary entry-encyclopedia interview musical_score pamphlet paper-conference report">
        <group delimiter=": ">
          <text variable="original-publisher-place"/>
          <text variable="original-publisher"/>
        </group>
      </if>
      <else>
        <text variable="original-publisher"/>
      </else>
    </choose>
  </macro>
  <!-- 4.6. Date -->
  <macro name="source-date">
    <text macro="source-date-issued-or-status"/>
    <!-- for author-date: -->
    <!-- <text macro="source-date-issued-day-month"/> -->
  </macro>
  <!-- Date elements -->
  <macro name="source-date-issued-full">
    <!-- Give full date for more ephemeral types; reflected in `date-year-sort` -->
    <!-- NB: any changes must also be applied to `source-date-original-full` -->
    <choose>
      <if type="personal_communication" variable="event-date issued">
        <!-- Provide issue date for letters listed under event-date -->
        <text macro="date-issued-year"/>
      </if>
      <else-if match="any" type="entry entry-dictionary entry-encyclopedia">
        <choose>
          <if match="any" variable="DOI URL">
            <!-- Online reference works use full dates (cf. CMOS18 14.131) -->
            <text macro="date-issued-full"/>
          </if>
          <else>
            <text macro="date-issued-year"/>
          </else>
        </choose>
      </else-if>
      <else-if match="any" type="article broadcast collection dataset document event graphic manuscript map patent performance personal_communication post software speech standard webpage">
        <text macro="date-issued-full"/>
      </else-if>
      <else-if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">
        <!-- serial types -->
        <text macro="source-date-issued-full-serial"/>
      </else-if>
      <else-if match="any" variable="collection-editor compiler editor editorial-director">
        <!-- monographic types -->
        <text macro="date-issued-year"/>
      </else-if>
      <else-if match="any" type="interview paper-conference">
        <!-- serial types -->
        <text macro="source-date-issued-full-serial"/>
      </else-if>
      <else-if variable="issued">
        <text macro="date-issued-year"/>
      </else-if>
      <else-if variable="available-date">
        <!-- possible recourse for multivolume series (e.g. CMOS18 14.26) -->
        <date date-parts="year" form="numeric" variable="available-date"/>
      </else-if>
      <else-if variable="event-date">
        <text macro="date-event-year"/>
      </else-if>
    </choose>
  </macro>
  <macro name="source-date-issued-full-serial">
    <choose>
      <if type="article-newspaper">
        <text macro="date-issued-full"/>
      </if>
      <else-if match="any" variable="supplement-number volume">
        <text macro="date-issued-year"/>
      </else-if>
      <else-if variable="issue">
        <text macro="date-issued-year-month"/>
      </else-if>
      <else>
        <text macro="date-issued-full"/>
      </else>
    </choose>
  </macro>
  <macro name="source-date-issued-or-status">
    <choose>
      <if match="any" variable="event-date issued">
        <text macro="source-date-issued-full"/>
      </if>
      <else-if variable="status">
        <text text-case="lowercase" variable="status"/>
      </else-if>
      <!-- no n.d. for `classic` (cf. MHRA4 7.3c) or `manuscript` (NHR 18.6.2) -->
      <else-if match="any" type="classic manuscript"/>
      <!-- only give n.d. for accessible personal communication (cf. CMOS18 14.111)-->
      <else-if match="any" variable="archive archive-place container-title DOI number publisher references URL">
        <text form="short" term="no date"/>
      </else-if>
      <else-if match="any" type="interview personal_communication"/>
      <else>
        <text form="short" term="no date"/>
      </else>
    </choose>
  </macro>
  <macro name="source-date-original">
    <text macro="source-date-original-full"/>
    <!-- for author-date: -->
    <!-- <text macro="source-date-original-day-month"/> -->
  </macro>
  <macro name="source-date-original-full">
    <!-- Give full date for more ephemeral types; reflected in `date-year-sort` -->
    <!-- Macro derived from `source-date-issued-full` -->
    <choose>
      <if type="personal_communication" variable="event-date original-date">
        <!-- Provide original date for letters listed under event-date -->
        <text macro="date-original-year"/>
      </if>
      <else-if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">
        <text macro="source-date-original-full-serial"/>
      </else-if>
      <else-if match="any" type="entry entry-dictionary entry-encyclopedia">
        <choose>
          <if match="any" variable="DOI URL">
            <!-- Online reference works use full dates (cf. CMOS18 14.131) -->
            <text macro="date-original-full"/>
          </if>
          <else>
            <text macro="date-original-year"/>
          </else>
        </choose>
      </else-if>
      <else-if match="any" type="article broadcast collection dataset document event graphic manuscript map patent performance personal_communication post software speech standard webpage">
        <text macro="date-original-full"/>
      </else-if>
      <else-if match="any" variable="collection-editor compiler editor editorial-director">
        <!-- monographic types -->
        <text macro="date-original-year"/>
      </else-if>
      <else-if match="any" type="interview paper-conference">
        <!-- serial types -->
        <text macro="source-date-original-full-serial"/>
      </else-if>
      <else>
        <text macro="date-original-year"/>
      </else>
    </choose>
  </macro>
  <macro name="source-date-original-full-serial">
    <choose>
      <if type="article-newspaper">
        <text macro="date-original-full"/>
      </if>
      <else-if match="any" variable="supplement-number volume">
        <text macro="date-original-year"/>
      </else-if>
      <else-if variable="issue">
        <text macro="date-original-year-month"/>
      </else-if>
      <else>
        <text macro="date-original-full"/>
      </else>
    </choose>
  </macro>
  <macro name="source-date-status">
    <choose>
      <if type="broadcast" variable="event-title issued status"/>
      <!-- on a `broadcast`, if there is an `event-title`, `status` appears with `event-date` as part of `source-event` (cf. CMOS18 14.165) -->
      <else-if variable="issued status">
        <!-- `status` specifies date type, e.g. 'effective', 'last modified', 'approved' (cf. CMOS18 14.104 for `webpage`; CMOS18 14.159 for `standard`) -->
        <text variable="status"/>
      </else-if>
      <!-- 'published online' for a work available ahead of print (cf. MHRA4 7.4) -->
      <else-if match="any" variable="available-date collection-title issue number page status supplement-number volume volume-title"/>
      <else-if type="article-journal" variable="DOI issued">
        <text term="advance-online-publication"/>
      </else-if>
    </choose>
  </macro>
  <!-- 4.7. Locator (including page references) -->
  <macro name="source-locator-subsequent">
    <choose>
      <if match="any" type="article-journal article-magazine article-newspaper periodical post-weblog review review-book">
        <text macro="source-locator-subsequent-serial"/>
      </if>
      <else-if match="any" variable="collection-editor compiler editor editorial-director">
        <text macro="source-locator-subsequent-monographic"/>
        <!-- for OGS and other styles using Roman volume numbers: -->
        <!-- <text macro="source-locator-subsequent-monographic-roman-volume"/> -->
      </else-if>
      <else-if match="any" type="interview paper-conference">
        <text macro="source-locator-subsequent-serial"/>
      </else-if>
      <else>
        <text macro="source-locator-subsequent-monographic"/>
        <!-- for OGS and other styles using Roman volume numbers: -->
        <!-- <text macro="source-locator-subsequent-monographic-roman-volume"/> -->
      </else>
    </choose>
  </macro>
  <macro name="source-locator-subsequent-monographic">
    <group delimiter=", ">
      <choose>
        <if variable="container-title">
          <!-- Do not provide `volume` or `part-number` for defined section -->
          <text macro="label-locator"/>
        </if>
        <else-if variable="part-number">
          <!-- label column and page numbers when using multiple locators (cf. CMOS18 14.50) -->
          <text macro="label-volume"/>
          <text macro="label-part-number"/>
          <text macro="label-locator-all"/>
        </else-if>
        <else-if is-numeric="volume" locator="column">
          <!-- separate a volume and column number with a point (NHR 17.2.5) -->
          <group delimiter=".">
            <text variable="volume"/>
            <text variable="locator"/>
          </group>
        </else-if>
        <else-if is-numeric="volume" locator="page">
          <!-- separate a volume and page number with a point (NHR 17.2.5) -->
          <group delimiter=".">
            <text variable="volume"/>
            <text variable="locator"/>
          </group>
        </else-if>
        <else>
          <text macro="label-volume"/>
          <text macro="label-part-number"/>
          <text macro="label-locator"/>
        </else>
      </choose>
    </group>
  </macro>
  <macro name="source-locator-subsequent-serial">
    <group delimiter=", ">
      <choose>
        <if variable="part-number">
          <!-- label page numbers when using multiple locators (cf. CMOS18 14.50) -->
          <text macro="label-part-number"/>
          <text macro="label-locator-all"/>
        </if>
        <else>
          <text macro="label-locator"/>
        </else>
      </choose>
    </group>
  </macro>
  <!-- 4.8. Medium -->
  <macro name="source-medium">
    <!-- the medium appears at both the title and container levels, and both with and without brackets (NHR 18.7.2-3, 18.8.5) -->
    <group delimiter=", ">
      <text variable="medium"/>
      <text variable="scale"/>
      <text variable="dimensions"/>
    </group>
  </macro>
  <!-- 4.9. Archival location -->
  <macro name="source-archive">
    <group delimiter=", ">
      <text variable="archive-place"/>
      <text variable="archive"/>
      <!-- usually `archive`, `archive-place` but sometimes also `archive-place`, `archive` (NHR 18.6.5); the latter is more common elsewhere (OGS 15.11.1 and MHRA4 7.7) -->
      <text variable="archive_collection"/>
      <text variable="archive_location"/>
      <text macro="source-archive-locator"/>
      <!-- for OGS: -->
      <!-- <text macro="source-archive-locator-range"/> -->
      <choose>
        <!-- database identifier, if not included elsewhere (cf. CMOS18 14.113) -->
        <if match="any" variable="archive_collection archive_location archive-place"/>
        <else-if type="thesis">
          <text variable="number"/>
        </else-if>
        <else-if match="any" type="dataset entry song" variable="genre"/>
        <else-if variable="archive">
          <text variable="number"/>
        </else-if>
      </choose>
    </group>
  </macro>
  <macro name="source-archive-locator">
    <choose>
      <!-- archival locators appear after the shelfmark (cf. CMOS18 14.127) -->
      <if locator="column" variable="archive archive_location">
        <text macro="label-locator-all"/>
      </if>
      <else-if locator="folio" variable="archive archive_location">
        <text macro="label-locator-all"/>
      </else-if>
      <else-if locator="page" variable="archive archive_location">
        <text macro="label-locator-all"/>
      </else-if>
      <else-if variable="archive archive_location page">
        <choose>
          <if is-numeric="page">
            <!-- TODO: remove this conditional when `page` parsing is fixed for different locator types -->
            <text macro="label-page"/>
          </if>
          <else>
            <text variable="page"/>
          </else>
        </choose>
      </else-if>
    </choose>
  </macro>
  <macro name="source-archive-short">
    <!-- shortened reference for an item consisting only of a shelfmark (cf. MHRA4 7.7) -->
    <group delimiter=", ">
      <choose>
        <if match="none" variable="archive_collection">
          <text form="short" variable="archive"/>
        </if>
      </choose>
      <text form="short" variable="archive_collection"/>
      <text form="short" variable="archive_location"/>
    </group>
  </macro>
  <!-- 4.10. DOI or URL -->
  <macro name="source-date-accessed-DOI-URL">
    <group delimiter=", ">
      <text macro="source-DOI-URL"/>
      <choose>
        <if variable="DOI"/>
        <else-if variable="URL">
          <group delimiter=" ">
            <text term="accessed"/>
            <date form="text" variable="accessed"/>
          </group>
        </else-if>
      </choose>
    </group>
  </macro>
  <macro name="source-DOI-URL">
    <choose>
      <if variable="DOI">
        <text prefix="https://doi.org/" variable="DOI"/>
      </if>
      <else-if variable="URL">
        <text variable="URL"/>
      </else-if>
    </choose>
  </macro>
  <!-- Citation -->
  <macro name="citation-notes-shortened-author-title-item">
    <group delimiter=" ">
      <group delimiter=", ">
        <text macro="author-short"/>
        <text macro="title-and-descriptions-short"/>
        <text macro="citation-notes-shortened-author-title-disambiguate"/>
        <choose>
          <!-- inaccessible `interview` or `personal_communication` uses in-text format (cf. NHR 17.3.2, CMOS18 14.111): give the date at the first citation in shortened notes -->
          <if match="any" variable="archive archive-place container-title DOI number publisher references URL"/>
          <else-if position="first" type="interview">
            <text macro="date-short"/>
            <text macro="source-medium"/>
          </else-if>
          <else-if position="first" type="personal_communication">
            <text macro="source-medium"/>
          </else-if>
        </choose>
        <text macro="source-monographic-publication-short-unbracketed"/>
      </group>
      <text macro="source-monographic-publication-short-bracketed"/>
    </group>
  </macro>
  <macro name="citation-notes-shortened-author-title-disambiguate">
    <!-- added dates, editors/translators, publisher, date -->
    <group delimiter=", ">
      <choose>
        <if disambiguate="true">
          <names variable="editor-translator">
            <label form="verb-short" suffix=" "/>
            <name form="short" initialize="true"/>
            <substitute>
              <names variable="editor"/>
              <names variable="translator"/>
            </substitute>
          </names>
          <choose>
            <if disambiguate="true">
              <text macro="label-version"/>
              <text macro="label-edition"/>
            </if>
          </choose>
        </if>
      </choose>
    </group>
  </macro>
  <citation disambiguate-add-givenname="true" disambiguate-add-names="true">
    <layout delimiter="; " suffix=".">
      <group delimiter=", ">
        <choose>
          <if position="subsequent">
            <text macro="citation-notes-shortened-author-title-item"/>
            <text macro="source-locator-subsequent"/>
          </if>
          <else>
            <text macro="author-note"/>
            <text macro="title-and-source"/>
          </else>
        </choose>
      </group>
    </layout>
  </citation>
  <!-- Bibliography -->
  <macro name="bibliography-notes">
    <group delimiter=". ">
      <group delimiter=", ">
        <text macro="author-bib"/>
        <text macro="title-and-source"/>
      </group>
      <text variable="references"/>
    </group>
  </macro>
  <bibliography hanging-indent="true">
    <sort>
      <key macro="author-bib"/>
      <key macro="title-and-descriptions"/>
      <key macro="source"/>
      <key variable="volume"/>
      <key variable="part-number"/>
      <key variable="event-date"/>
      <key variable="original-date"/>
      <key macro="source-date-issued-or-status"/>
      <key macro="source-archive"/>
    </sort>
    <layout suffix=".">
      <choose>
        <if type="classic">
          <choose>
            <if match="any" variable="archive editor translator publisher">
              <text macro="bibliography-notes"/>
            </if>
          </choose>
        </if>
        <else-if match="any" type="entry entry-dictionary entry-encyclopedia">
          <choose>
            <if variable="author">
              <!-- Only signed reference entries appear in the bibliography (cf. CMOS18 14.132) -->
              <text macro="bibliography-notes"/>
            </if>
          </choose>
        </else-if>
        <!-- social media content usually omitted from the bibliography (cf. CMOS18 14.106) -->
        <else-if type="post"/>
        <else-if match="any" variable="archive archive-place container-title DOI number publisher references URL">
          <text macro="bibliography-notes"/>
        </else-if>
        <!-- Personal communications only appear in the bibliography if the reader can retrieve them (NHR 17.3.2; cf. CMOS18 14.13, 14.111) -->
        <else-if match="any" type="interview personal_communication"/>
        <!-- In note styles, the bibliography also omits inaccessible manuscripts (NHR 18.3.1; cf. CMOS18 14.114), conference papers (cf. CMOS18 14.115), and private documents (cf. CMOS18 14.118) -->
        <else-if match="any" type="document manuscript paper-conference speech"/>
        <else>
          <text macro="bibliography-notes"/>
        </else>
      </choose>
    </layout>
  </bibliography>
</style>
