Skip to content

Instantly share code, notes, and snippets.

@bdarcus
Last active May 24, 2023 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdarcus/394c8666c41f234883be79efb6e37605 to your computer and use it in GitHub Desktop.
Save bdarcus/394c8666c41f234883be79efb6e37605 to your computer and use it in GitHub Desktop.
apa.csl xml converted to YAML with yq
----
+p_xml: version="1.0" encoding="utf-8"
style:
xmlns: http://purl.org/net/xbiblio/csl
class: in-text
version: "1.0"
demote-non-dropping-particle: never
page-range-format: expanded
info:
title: American Psychological Association 7th edition
title-short: APA
id: http://www.zotero.org/styles/apa
link:
- href: http://www.zotero.org/styles/apa
rel: self
- href: http://www.zotero.org/styles/apa-6th-edition
rel: template
- href: https://apastyle.apa.org/style-grammar-guidelines/references/examples
rel: documentation
author:
name: Brenton M. Wiernik
email: zotero@wiernik.org
category:
- citation-format: author-date
- field: psychology
- field: generic-base
updated: "2022-01-31T14:30:00+00:00"
rights:
+content: This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License
license: http://creativecommons.org/licenses/by-sa/3.0/
locale:
- xml:lang: en
terms:
term:
- name: editortranslator
form: short
single: ed. & trans.
multiple: eds. & trans.
- +content: trans.
name: translator
form: short
- name: interviewer
form: short
single: interviewer
multiple: interviewers
- name: collection-editor
form: short
single: ed.
multiple: eds.
- +content: ca.
name: circa
form: short
- +content: B.C.E.
name: bc
- +content: C.E.
name: ad
- +content: personal communication
name: letter
- +content: letter
name: letter
form: short
- name: issue
form: long
single: issue
multiple: issues
- xml:lang: af
terms:
term:
- +content: persoonlike kommunikasie
name: letter
- +content: brief
name: letter
form: short
- xml:lang: ar
terms:
term:
- +content: اتصال شخصي
name: letter
- +content: خطاب
name: letter
form: short
- xml:lang: bg
terms:
term:
- +content: лична комуникация
name: letter
- +content: писмо
name: letter
form: short
- xml:lang: ca
terms:
term:
- +content: comunicació personal
name: letter
- +content: carta
name: letter
form: short
- xml:lang: cs
terms:
term:
- +content: osobní komunikace
name: letter
- +content: dopis
name: letter
form: short
- xml:lang: cy
terms:
term:
- +content: cyfathrebu personol
name: letter
- +content: llythyr
name: letter
form: short
- xml:lang: da
terms:
term:
- +content: et al.
name: et-al
- +content: personlig kommunikation
name: letter
- +content: brev
name: letter
form: short
- xml:lang: de
terms:
term:
- +content: et al.
name: et-al
- +content: persönliche Kommunikation
name: letter
- +content: Brief
name: letter
form: short
- xml:lang: el
terms:
term:
- +content: προσωπική επικοινωνία
name: letter
- +content: επιστολή
name: letter
form: short
- xml:lang: es
terms:
term:
- +content: de
name: from
- +content: comunicación personal
name: letter
- +content: carta
name: letter
form: short
- xml:lang: et
terms:
term:
- +content: isiklik suhtlus
name: letter
- +content: kiri
name: letter
form: short
- xml:lang: eu
terms:
term:
- +content: komunikazio pertsonala
name: letter
- +content: gutuna
name: letter
form: short
- xml:lang: fa
terms:
term:
- +content: ارتباط شخصی
name: letter
- +content: نامه
name: letter
form: short
- xml:lang: fi
terms:
term:
- +content: henkilökohtainen viestintä
name: letter
- +content: kirje
name: letter
form: short
- xml:lang: fr
terms:
term:
- +content: communication personnelle
name: letter
- +content: lettre
name: letter
form: short
- name: editor
form: short
single: éd.
multiple: éds.
- xml:lang: he
terms:
term:
- +content: תקשורת אישית
name: letter
- +content: מכתב
name: letter
form: short
- xml:lang: hr
terms:
term:
- +content: osobna komunikacija
name: letter
- +content: pismo
name: letter
form: short
- xml:lang: hu
terms:
term:
- +content: személyes kommunikáció
name: letter
- +content: levél
name: letter
form: short
- xml:lang: id
terms:
term:
- +content: komunikasi pribadi
name: letter
- +content: surat
name: letter
form: short
- xml:lang: is
terms:
term:
- +content: persónuleg samskipti
name: letter
- +content: bréf
name: letter
form: short
- xml:lang: it
terms:
term:
- +content: comunicazione personale
name: letter
- +content: lettera
name: letter
form: short
- xml:lang: ja
terms:
term:
- +content: 個人的なやり取り
name: letter
- +content: 手紙
name: letter
form: short
- xml:lang: ko
terms:
term:
- +content: 개인 서신
name: letter
- +content: 편지
name: letter
form: short
- xml:lang: la
terms:
term:
- name: letter
- +content: epistula
name: letter
form: short
- xml:lang: lt
terms:
term:
- +content: communicationis personalis
name: letter
- name: letter
form: short
- xml:lang: lv
terms:
term:
- +content: personīga komunikācija
name: letter
- +content: vēstule
name: letter
form: short
- xml:lang: mn
terms:
term:
- +content: хувийн харилцаа холбоо
name: letter
- +content: захиа
name: letter
form: short
- xml:lang: nb
terms:
term:
- +content: et al.
name: et-al
- +content: personlig kommunikasjon
name: letter
- +content: brev
name: letter
form: short
- xml:lang: nl
terms:
term:
- +content: et al.
name: et-al
- +content: persoonlijke communicatie
name: letter
- +content: brief
name: letter
form: short
- xml:lang: nn
terms:
term:
- +content: et al.
name: et-al
- +content: personlig kommunikasjon
name: letter
- +content: brev
name: letter
form: short
- xml:lang: pl
terms:
term:
- +content: osobista komunikacja
name: letter
- +content: list
name: letter
form: short
- xml:lang: pt
terms:
term:
- +content: comunicação pessoal
name: letter
- +content: carta
name: letter
form: short
- xml:lang: ro
terms:
term:
- +content: comunicare personală
name: letter
- +content: scrisoare
name: letter
form: short
- xml:lang: ru
terms:
term:
- +content: личная переписка
name: letter
- +content: письмо
name: letter
form: short
- xml:lang: sk
terms:
term:
- +content: osobná komunikácia
name: letter
- +content: list
name: letter
form: short
- xml:lang: sl
terms:
term:
- +content: osebna komunikacija
name: letter
- +content: pismo
name: letter
form: short
- xml:lang: sr
terms:
term:
- +content: лична комуникација
name: letter
- +content: писмо
name: letter
form: short
- xml:lang: sv
terms:
term:
- +content: personlig kommunikation
name: letter
- +content: brev
name: letter
form: short
- xml:lang: th
terms:
term:
- +content: การสื่อสารส่วนบุคคล
name: letter
- +content: จดหมาย
name: letter
form: short
- xml:lang: tr
terms:
term:
- +content: kişisel iletişim
name: letter
- +content: mektup
name: letter
form: short
- xml:lang: uk
terms:
term:
- +content: особисте спілкування
name: letter
- +content: лист
name: letter
form: short
- xml:lang: vi
terms:
term:
- +content: giao tiếp cá nhân
name: letter
- +content: thư
name: letter
form: short
- xml:lang: zh-CN
terms:
term:
- +content: 的私人交流
name: letter
- +content: 信函
name: letter
form: short
- xml:lang: zh-TW
terms:
term:
- +content: 私人通訊
name: letter
- +content: 信函
name: letter
form: short
# APA references contain four parts: author, date, title, source
macro:
- name: author-bib
names:
variable: composer
delimiter: ', '
name:
name-as-sort-order: all
and: symbol
sort-separator: ', '
initialize-with: '. '
delimiter: ', '
delimiter-precedes-last: always
substitute:
names:
- variable: author
- variable: illustrator
- variable: director
name:
name-as-sort-order: all
and: symbol
sort-separator: ', '
initialize-with: '. '
delimiter: ', '
delimiter-precedes-last: always
label:
form: long
prefix: ' ('
suffix: )
text-case: title
- variable: editor
delimiter: ', '
name:
name-as-sort-order: all
and: symbol
sort-separator: ', '
initialize-with: '. '
delimiter: ', '
delimiter-precedes-last: always
label:
form: short
prefix: ' ('
suffix: )
text-case: title
- variable: editorial-director
name:
name-as-sort-order: all
and: symbol
sort-separator: ', '
initialize-with: '. '
delimiter: ', '
delimiter-precedes-last: always
label:
form: short
prefix: ' ('
suffix: )
text-case: title
- variable: collection-editor
name:
name-as-sort-order: all
and: symbol
sort-separator: ', '
initialize-with: '. '
delimiter: ', '
delimiter-precedes-last: always
label:
form: short
prefix: ' ('
suffix: )
text-case: title
choose:
- if:
variable: container-title
choose:
if:
type: book entry entry-dictionary entry-encyclopedia
match: any
choose:
if:
variable: title
group:
delimiter: ' '
text:
- macro: title
- macro: parenthetical
else:
text:
macro: title-and-descriptions
- if:
variable: title
group:
delimiter: ' '
text:
- macro: title
- macro: parenthetical
else:
text:
macro: title-and-descriptions
# Test for editortranslator and put that first as that becomes available
- name: author-intext
choose:
if:
type: bill legal_case legislation treaty
match: any
text:
macro: title-intext
else-if:
type: interview personal_communication
match: any
choose:
# These variables indicate that the letter is retrievable by the reader.
# If not, then use the APA in-text-only personal communication format
if:
variable: archive container-title DOI publisher URL
match: none
group:
delimiter: ', '
names:
variable: author
name:
and: symbol
delimiter: ', '
initialize-with: '. '
substitute:
text:
macro: title-intext
# Replace with term="personal-communication" if that becomes available
text:
term: letter
else:
names:
variable: author
delimiter: ', '
name:
form: short
and: symbol
delimiter: ', '
initialize-with: '. '
substitute:
text:
macro: title-intext
else:
names:
variable: composer
delimiter: ', '
name:
form: short
and: symbol
delimiter: ', '
initialize-with: '. '
substitute:
names:
- variable: author
- variable: illustrator
- variable: director
- variable: editor
- variable: editorial-director
choose:
if:
variable: container-title
choose:
if:
type: book entry entry-dictionary entry-encyclopedia
match: any
text:
macro: title-intext
text:
macro: title-intext
- name: date-bib
group:
delimiter: ' '
prefix: (
suffix: )
choose:
if:
is-uncertain-date: issued
text:
term: circa
form: short
group:
choose:
if:
variable: issued
date:
variable: issued
date-part:
name: year
text:
variable: year-suffix
choose:
if:
# Many video and audio examples in manual give full dates. Err on the side of too much information.
type: article-magazine article-newspaper broadcast interview motion_picture pamphlet personal_communication post post-weblog song speech webpage
match: any
date:
variable: issued
date-part:
- prefix: ', '
name: month
- prefix: ' '
name: day
else-if:
# Capture 'speech' stored as 'paper-conference'
type: paper-conference
choose:
if:
variable: collection-editor editor editorial-director issue page volume
match: none
date:
variable: issued
date-part:
- prefix: ', '
name: month
- prefix: ' '
name: day
# Only year: article article-journal book chapter entry entry-dictionary entry-encyclopedia dataset figure graphic
# manuscript map musical_score paper-conference[published] patent report review review-book thesis
else-if:
variable: status
group:
text:
- variable: status
text-case: lowercase
- variable: year-suffix
prefix: '-'
else:
text:
- term: no date
form: short
- variable: year-suffix
prefix: '-'
- # APA sorts 1. no-date items, 2. items with dates, 3. in-press (status) items
name: date-sort-group
choose:
if:
variable: issued
text:
value: "1"
else-if:
variable: status
text:
value: "2"
else:
text:
value: "0"
- name: date-sort-date
date:
variable: issued
form: numeric
- name: date-intext
choose:
if:
variable: issued
group:
delimiter: /
group:
- delimiter: ' '
choose:
if:
is-uncertain-date: original-date
text:
term: circa
form: short
date:
variable: original-date
date-part:
name: year
- delimiter: ' '
choose:
if:
is-uncertain-date: issued
text:
term: circa
form: short
group:
choose:
if:
type: interview personal_communication
match: any
choose:
if:
# These variables indicate that the communication is retrievable by the reader.
# If not, then use the in-text-only personal communication format
variable: archive container-title DOI publisher URL
match: none
date:
variable: issued
form: text
else:
date:
variable: issued
date-part:
name: year
else:
date:
variable: issued
date-part:
name: year
text:
variable: year-suffix
else-if:
variable: status
text:
- variable: status
text-case: lowercase
- variable: year-suffix
prefix: '-'
else:
text:
- term: no date
form: short
- variable: year-suffix
prefix: '-'
- name: title-and-descriptions
choose:
if:
variable: title
group:
delimiter: ' '
text:
- macro: title
- macro: parenthetical
- macro: bracketed
else:
group:
delimiter: ' '
text:
- macro: bracketed
- macro: parenthetical
- name: title
choose:
if:
# Webpages are always italicized
type: post webpage
match: any
text:
variable: title
font-style: italic
else-if:
# Other types are italicized based on presence of container-title.
# Assume that review and review-book are published in periodicals/blogs,
# not just on a web page (ex. 69)
variable: container-title
match: any
text:
variable: title
else:
choose:
if:
type: article-journal article-magazine article-newspaper post-weblog review review-book
match: any
text:
variable: title
font-style: italic
else-if:
type: paper-conference
choose:
if:
variable: collection-editor editor editorial-director
match: any
group:
delimiter: ': '
font-style: italic
text:
variable: title
# Replace with volume-title as that becomes available
choose:
if:
is-numeric: volume
match: none
group:
delimiter: ' '
label:
variable: volume
form: short
text-case: capitalize-first
text:
variable: volume
else:
text:
variable: title
font-style: italic
else:
group:
delimiter: ': '
font-style: italic
text:
variable: title
# Replace with volume-title as that becomes available
choose:
if:
is-numeric: volume
match: none
group:
delimiter: ' '
label:
variable: volume
form: short
text-case: capitalize-first
text:
variable: volume
- name: title-intext
choose:
if:
variable: title
match: none
text:
macro: bracketed-intext
prefix: '['
suffix: ']'
else-if:
- # If a bill has no number or container-title, assume it is a hearing; italic
type: bill
choose:
if:
variable: number container-title
match: none
text:
variable: title
form: short
font-style: italic
text-case: title
else-if:
variable: title
text:
variable: title
form: short
text-case: title
else:
group:
delimiter: ' '
text:
variable: genre
group:
delimiter: ' '
choose:
if:
# Replace with label variable="number" as that becomes available
variable: chapter-number container-title
match: none
text:
term: issue
form: short
text:
variable: number
- # Cases are italicized
type: legal_case
match: any
text:
variable: title
font-style: italic
- # Legislation and treaties not italicized or quoted
type: legislation treaty
match: any
text:
variable: title
form: short
text-case: title
- # Webpages are always italicized
type: post webpage
match: any
text:
variable: title
form: short
font-style: italic
text-case: title
- # Other types are italicized or quoted based on presence of container-title. As in title macro.
variable: container-title
match: any
text:
variable: title
form: short
quotes: "true"
text-case: title
else:
text:
variable: title
form: short
font-style: italic
text-case: title
- # (Secondary contributors; Database location; Genre no. 123; Report Series 123, Version, Edition, Volume, Page)
name: parenthetical
group:
prefix: (
suffix: )
choose:
if:
# authority: U.S. ; genre: patent ; number: 123,445
type: patent
group:
delimiter: ' '
text:
variable: authority
form: short
choose:
if:
variable: genre
text:
variable: genre
text-case: capitalize-first
else:
# This should be localized
text:
value: patent
text-case: capitalize-first
group:
# Replace with label variable="number" if that becomes available
delimiter: ' '
text:
- term: issue
form: short
text-case: capitalize-first
- variable: number
else-if:
- # For post webpage, container-title is treated as publisher
type: post webpage
match: any
group:
delimiter: '; '
text:
- macro: secondary-contributors
- macro: database-location
- macro: number
- macro: locators-booklike
- variable: container-title
group:
delimiter: '; '
text:
macro: secondary-contributors
choose:
if:
# For audiovisual media, number information comes after title, not container-title
type: broadcast graphic map motion_picture song
match: any
text:
macro: number
else:
group:
delimiter: '; '
text:
- macro: secondary-contributors
- macro: database-location
- macro: number
- macro: locators-booklike
- name: parenthetical-container
choose:
if:
variable: container-title
match: any
group:
prefix: (
suffix: )
group:
delimiter: '; '
text:
- macro: database-location
- macro: locators-booklike
choose:
if:
# For audiovisual media, number information comes after title, not container-title
type: broadcast graphic map motion_picture song
match: none
text:
macro: number
- # [Descriptive information] If there is a number, genre is already printed in macro="number"
name: bracketed
group:
prefix: '['
suffix: ']'
choose:
if:
# Reviewed item
variable: reviewed-author reviewed-title
type: review review-book
match: any
group:
delimiter: '; '
group:
delimiter: ', '
group:
# Assume that genre is entered as 'Review of the book' or similar
delimiter: ' '
choose:
if:
variable: number
match: none
choose:
if:
variable: genre
text:
variable: genre
text-case: capitalize-first
else-if:
variable: medium
text:
variable: medium
text-case: capitalize-first
else:
# Replace with term="review" as that becomes available
text:
value: Review of
else:
choose:
if:
variable: medium
text:
variable: medium
text-case: capitalize-first
else:
# Replace with term="review" as that becomes available
text:
value: Review of
text:
macro: reviewed-title
names:
variable: reviewed-author
label:
form: verb-short
suffix: ' '
name:
and: symbol
initialize-with: '. '
delimiter: ', '
choose:
if:
variable: genre
match: any
choose:
if:
variable: number
match: none
text:
variable: medium
text-case: capitalize-first
else-if:
- # Thesis type and institution
type: thesis
group:
delimiter: '; '
choose:
if:
variable: number
match: none
group:
delimiter: ', '
text:
variable: genre
text-case: capitalize-first
choose:
if:
# Include the university in brackets if thesis is published
variable: archive DOI URL
match: any
text:
variable: publisher
text:
variable: medium
text-case: capitalize-first
- # Interview information
variable: interviewer
type: interview
match: any
choose:
if:
variable: title
text:
macro: format
else-if:
- variable: genre
group:
delimiter: '; '
group:
delimiter: ' '
text:
variable: genre
text-case: capitalize-first
group:
delimiter: ' '
text:
term: author
form: verb
names:
variable: interviewer
name:
and: symbol
initialize-with: '. '
delimiter: ', '
- variable: interviewer
group:
delimiter: '; '
names:
variable: interviewer
label:
form: verb
suffix: ' '
text-case: capitalize-first
name:
and: symbol
initialize-with: '. '
delimiter: ', '
text:
variable: medium
text-case: capitalize-first
else:
text:
macro: format
- # Letter information
type: personal_communication
choose:
if:
variable: recipient
group:
delimiter: '; '
group:
delimiter: ' '
choose:
if:
variable: number
match: none
choose:
if:
variable: genre
text:
variable: genre
text-case: capitalize-first
else-if:
variable: medium
text:
variable: medium
text-case: capitalize-first
else:
text:
term: letter
form: short
text-case: capitalize-first
else:
choose:
if:
variable: medium
text:
variable: medium
text-case: capitalize-first
else:
text:
term: letter
form: short
text-case: capitalize-first
names:
variable: recipient
delimiter: ', '
label:
form: verb
suffix: ' '
name:
and: symbol
delimiter: ', '
choose:
if:
variable: genre
match: any
choose:
if:
variable: number
match: none
text:
variable: medium
text-case: capitalize-first
else:
text:
macro: format
- # Performer of classical music works
variable: composer
type: song
match: all
group:
delimiter: '; '
choose:
- if:
variable: number
match: none
group:
delimiter: ' '
choose:
if:
variable: genre
text:
variable: genre
text-case: capitalize-first
# Replace prefix with performer label as that becomes available
names:
variable: author
prefix: 'recorded by '
name:
and: symbol
initialize-with: '. '
delimiter: ', '
else-if:
variable: medium
text:
variable: medium
text-case: capitalize-first
# Replace prefix with performer label as that becomes available
names:
variable: author
prefix: 'recorded by '
name:
and: symbol
initialize-with: '. '
delimiter: ', '
else:
# Replace prefix with performer label as that becomes available
names:
variable: author
prefix: 'Recorded by '
name:
and: symbol
initialize-with: '. '
delimiter: ', '
else:
group:
delimiter: ' '
choose:
if:
variable: medium
text:
variable: medium
text-case: capitalize-first
# Replace prefix with performer label as that becomes available
names:
variable: author
prefix: 'recorded by '
name:
and: symbol
initialize-with: '. '
delimiter: ', '
else:
# Replace prefix with performer label as that becomes available
names:
variable: author
prefix: 'Recorded by '
name:
and: symbol
initialize-with: '. '
delimiter: ', '
- if:
variable: genre
match: any
choose:
if:
variable: number
match: none
text:
variable: medium
text-case: capitalize-first
- # Other description
variable: container-title
match: none
text:
macro: format
else:
# For conference presentations, chapters in reports, software, place bracketed after the container title
choose:
if:
type: paper-conference speech
match: any
choose:
if:
variable: collection-editor editor editorial-director issue page volume
match: any
text:
macro: format
else-if:
- type: book
choose:
if:
variable: version
match: none
text:
macro: format
- type: report
match: none
text:
macro: format
- name: bracketed-intext
group:
prefix: '['
suffix: ']'
choose:
if:
# This should be localized
variable: reviewed-author reviewed-title
type: review review-book
match: any
text:
macro: reviewed-title-intext
prefix: 'Review of '
else-if:
- variable: interviewer
type: interview
match: any
names:
variable: interviewer
label:
form: verb
suffix: ' '
text-case: capitalize-first
name:
and: symbol
initialize-with: '. '
delimiter: ', '
substitute:
text:
macro: format-intext
- # Letter information
type: personal_communication
choose:
if:
variable: recipient
group:
delimiter: ' '
choose:
if:
variable: number
match: none
text:
variable: genre
text-case: capitalize-first
else:
text:
term: letter
form: short
text-case: capitalize-first
names:
variable: recipient
delimiter: ', '
label:
form: verb
suffix: ' '
name:
and: symbol
delimiter: ', '
else:
text:
macro: format-intext
else:
text:
macro: format-intext
- name: bracketed-container
group:
prefix: '['
suffix: ']'
choose:
if:
# Conference presentations should describe the session [container] in bracketed unless published in a proceedings
type: paper-conference speech
match: any
choose:
if:
variable: collection-editor editor editorial-director issue page volume
match: none
text:
macro: format
else-if:
- # For entries in mobile app reference works, place bracketed after the container-title
type: book
variable: version
match: all
text:
macro: format
- # For chapters in reports, place bracketed after the container title
type: report
text:
macro: format
- name: secondary-contributors
choose:
if:
type: article-journal article-magazine article-newspaper post-weblog review review-book
match: any
text:
macro: secondary-contributors-periodical
else-if:
type: paper-conference
choose:
if:
variable: collection-editor editor editorial-director
match: any
text:
macro: secondary-contributors-booklike
else:
text:
macro: secondary-contributors-periodical
else:
text:
macro: secondary-contributors-booklike
- name: secondary-contributors-periodical
group:
delimiter: '; '
choose:
if:
variable: title
names:
variable: interviewer
delimiter: '; '
name:
and: symbol
initialize-with: '. '
delimiter: ', '
label:
form: short
prefix: ', '
text-case: title
names:
variable: translator
delimiter: '; '
name:
and: symbol
initialize-with: '. '
delimiter: ', '
label:
form: short
prefix: ', '
text-case: title
- name: secondary-contributors-booklike
group:
delimiter: '; '
choose:
- if:
variable: title
names:
variable: interviewer
name:
and: symbol
initialize-with: '. '
delimiter: ', '
label:
form: short
prefix: ', '
text-case: title
- if:
# Webpages treat container-title like publisher
type: post webpage
match: none
choose:
if:
variable: container-title
match: none
group:
delimiter: '; '
names:
- variable: container-author
label:
form: verb-short
suffix: ' '
text-case: title
name:
and: symbol
initialize-with: '. '
delimiter: ', '
- variable: editor translator
delimiter: '; '
name:
and: symbol
initialize-with: '. '
delimiter: ', '
label:
form: short
prefix: ', '
text-case: title
else:
group:
delimiter: '; '
names:
- variable: container-author
label:
form: verb-short
suffix: ' '
text-case: title
name:
and: symbol
initialize-with: '. '
delimiter: ', '
- variable: editor translator
delimiter: '; '
name:
and: symbol
initialize-with: '. '
delimiter: ', '
label:
form: short
prefix: ', '
text-case: title
# When editortranslator becomes available, add a test: variable="editortranslator" match="none"; then print translator
- name: database-location
choose:
if:
# With `archive-place`: physical archives. Without: online archives. Add archive_collection as that becomes available
variable: archive-place
match: none
text:
variable: archive_location
- name: number
choose:
if:
variable: number
group:
delimiter: ', '
group:
delimiter: ' '
text:
variable: genre
text-case: title
choose:
if:
# Replace with label variable="number" if that becomes available
is-numeric: number
text:
- term: issue
form: short
text-case: capitalize-first
- variable: number
else:
text:
variable: number
choose:
if:
type: thesis
choose:
# Include the university in brackets if thesis is published
if:
variable: archive DOI URL
match: any
text:
variable: publisher
- name: locators-booklike
choose:
if:
type: article-journal article-magazine article-newspaper broadcast interview patent post post-weblog review review-book speech webpage
match: any
else-if:
type: paper-conference
choose:
if:
variable: collection-editor editor editorial-director
match: any
group:
delimiter: ', '
text:
- macro: version
- macro: edition
- macro: volume-booklike
else:
group:
delimiter: ', '
text:
- macro: version
- macro: edition
- macro: volume-booklike
- name: version
choose:
if:
is-numeric: version
group:
# replace with label variable="version" if that becomes available
delimiter: ' '
text:
- term: version
text-case: capitalize-first
- variable: version
else:
text:
variable: version
- name: edition
choose:
if:
is-numeric: edition
group:
delimiter: ' '
number:
variable: edition
form: ordinal
label:
variable: edition
form: short
else:
text:
variable: edition
- name: volume-booklike
group:
# Report series [ex. 52]
delimiter: ', '
choose:
- if:
type: report
group:
delimiter: ' '
text:
- variable: collection-title
text-case: title
- variable: collection-number
- if:
variable: volume
match: any
choose:
# Non-numeric volumes are already printed as part of the book title
if:
is-numeric: volume
match: none
else:
group:
delimiter: ' '
label:
variable: volume
form: short
text-case: capitalize-first
number:
variable: volume
form: numeric
else:
group:
# Replace with label variable="number-of-volumes" if that becomes available
text:
- term: volume
form: short
text-case: capitalize-first
suffix: ' '
- term: page-range-delimiter
prefix: "1"
number:
variable: number-of-volumes
form: numeric
group:
- delimiter: ' '
label:
variable: issue
text-case: capitalize-first
text:
variable: issue
- delimiter: ' '
label:
variable: page
form: short
suffix: ' '
text:
variable: page
- name: reviewed-title
choose:
if:
# Not possible to distinguish TV series episode from other reviewed
# works [Ex. 69]
variable: reviewed-title
text:
variable: reviewed-title
font-style: italic
else:
# Assume title is title of reviewed work
text:
variable: title
font-style: italic
- name: reviewed-title-intext
choose:
if:
# Not possible to distinguish TV series episode from other reviewed works [Ex. 69]
variable: reviewed-title
text:
variable: reviewed-title
form: short
font-style: italic
text-case: title
else:
# Assume title is title of reviewed work
text:
variable: title
form: short
font-style: italic
text-case: title
- name: format
choose:
if:
variable: genre medium
match: any
group:
delimiter: '; '
choose:
if:
variable: number
match: none
text:
variable: genre
text-case: capitalize-first
text:
variable: medium
text-case: capitalize-first
# These should be localized when possible
else-if:
- type: dataset
text:
value: Data set
- # Replace with type="software" and term="software" as that becomes available
type: book
variable: version
match: all
text:
value: Computer software
- type: interview personal_communication
match: any
choose:
if:
variable: archive container-title DOI publisher URL
match: none
text:
term: letter
text-case: capitalize-first
else-if:
type: interview
text:
term: interview
text-case: capitalize-first
- type: map
text:
value: Map
- name: format-intext
choose:
if:
variable: genre
match: any
text:
variable: genre
text-case: capitalize-first
else-if:
- variable: medium
text:
variable: medium
text-case: capitalize-first
- type: dataset
text:
value: Data set
- # Replace with type="software" and term="software" as that becomes available
type: book
variable: version
match: all
text:
value: Computer software
- type: interview personal_communication
match: any
choose:
if:
variable: archive container-title DOI publisher URL
match: none
text:
term: letter
text-case: capitalize-first
else-if:
type: interview
text:
term: interview
text-case: capitalize-first
- type: map
text:
value: Map
# These should be localized when possible
- name: container
choose:
if:
# Periodical items
type: article-journal article-magazine article-newspaper post-weblog review review-book
match: any
text:
macro: container-periodical
else-if:
- # Determine if paper-conference is a periodical or booklike
type: paper-conference
choose:
if:
variable: editor editorial-director collection-editor container-author
match: any
text:
macro: container-booklike
else:
text:
macro: container-periodical
- # post and webpage treat container-title like publisher
type: post webpage
match: none
text:
macro: container-booklike
- name: container-periodical
group:
delimiter: '. '
group:
delimiter: ', '
text:
variable: container-title
font-style: italic
text-case: title
choose:
- if:
variable: volume
group:
text:
- variable: volume
font-style: italic
- variable: issue
prefix: (
suffix: )
else:
text:
variable: issue
font-style: italic
- if:
# Ex. 6: Journal article with article number or eLocator This should be localized
variable: number
group:
delimiter: ' '
text:
- term: article-locator
text-case: capitalize-first
- variable: number
else:
text:
variable: page
choose:
if:
variable: issued
choose:
if:
variable: issue page volume
match: none
text:
variable: status
text-case: capitalize-first
- name: container-booklike
choose:
if:
variable: container-title
match: any
group:
delimiter: ' '
text:
- term: in
text-case: capitalize-first
- macro: parenthetical-container
- macro: bracketed-container
group:
delimiter: ', '
names:
# Change to editortranslator and move editor to substitute as that becomes available
variable: editor translator
delimiter: ', & '
name:
and: symbol
initialize-with: '. '
delimiter: ', '
label:
form: short
text-case: title
prefix: ' ('
suffix: )
substitute:
names:
- variable: editorial-director
- variable: collection-editor
- variable: container-author
group:
delimiter: ': '
font-style: italic
text:
variable: container-title
# Replace with volume-title as that becomes available
choose:
if:
is-numeric: volume
match: none
group:
delimiter: ' '
label:
variable: volume
form: short
text-case: capitalize-first
text:
variable: volume
- name: publisher
group:
delimiter: '; '
choose:
if:
type: thesis
choose:
if:
variable: archive DOI URL
match: none
text:
variable: publisher
else-if:
- # For websites, treat container title like publisher
type: post webpage
match: any
group:
delimiter: '; '
text:
- variable: container-title
text-case: title
- variable: publisher
- # For paper-conference, don't print publisher if in a journal-like proceedings
type: paper-conference
choose:
if:
variable: collection-editor editor editorial-director
match: any
text:
variable: publisher
- type: article-journal article-magazine article-newspaper post-weblog
match: none
text:
variable: publisher
group:
delimiter: ', '
choose:
if:
# With `archive-place`: physical archives. Without: online archives. For physical archives, print the location before the archive name.
# For electronic archives, these are printed in macro="description". Split "archive_location" into "archive_collection" and "archive_location" as that becomes available Must test for archive_collection:
# With collection: archive_collection (archive_location), archive, archive-place
# No collection: archive (archive_location), archive-place
#
variable: archive-place
text:
variable: archive_location
text:
- variable: archive
- variable: archive-place
- name: access
choose:
if:
variable: DOI
match: any
text:
variable: DOI
prefix: https://doi.org/
else-if:
variable: URL
group:
delimiter: ' '
choose:
if:
variable: issued status
match: none
group:
delimiter: ' '
text:
- term: retrieved
text-case: capitalize-first
- term: from
date:
variable: accessed
form: text
suffix: ','
text:
variable: URL
- name: event
choose:
if:
# To prevent Zotero from printing event-place due to its double-mapping of all 'place' to
# both publisher-place and event-place. Remove this 'choose' when that is changed.
variable: event event-title
match: any
choose:
if:
# Don't print event info if published in a proceedings
variable: collection-editor editor editorial-director issue page volume
match: none
group:
delimiter: ', '
text:
- macro: event-title
- variable: event-place
- name: 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 accpeted.
# Remove if procesor logic and application adoption can handle this.
if:
variable: event-title
text:
variable: event-title
else:
text:
variable: event
- name: publication-history
choose:
if:
type: patent
match: none
group:
prefix: (
suffix: )
choose:
if:
# This provides the option for more elaborate description
# of publication history, such as full "reprinted" references
# (examples 11, 43, 44) or retracted references
variable: references
text:
variable: references
else:
group:
delimiter: ' '
text:
value: Original work published
choose:
if:
is-uncertain-date: original-date
text:
term: circa
form: short
date:
variable: original-date
date-part:
name: year
else:
text:
variable: references
prefix: (
suffix: )
- name: legal-cites
choose:
if:
type: legal_case
group:
delimiter: '. '
group:
delimiter: ', '
text:
- variable: title
- variable: references
group:
delimiter: ' '
text:
- macro: container-legal
- macro: date-legal
text:
macro: access
else-if:
- # Currently designed to handle bills, resolutions, hearings, rederal reports.
type: bill
group:
delimiter: '. '
group:
delimiter: ', '
choose:
if:
# If no number or container-title, then assume it is a hearing
variable: number container-title
match: none
text:
variable: title
font-style: italic
else:
text:
variable: title
group:
delimiter: ' '
text:
- macro: container-legal
- macro: date-legal
choose:
if:
# If no number or container-title, then assume it is a hearing
variable: number container-title
match: none
names:
variable: author
prefix: '(testimony of '
suffix: )
name:
and: symbol
delimiter: ', '
else:
text:
variable: status
prefix: (
suffix: )
text:
variable: references
text:
macro: access
- # Currently designed to handle statutes, codified regulations, executive orders.
# For uncodified regulations, assume future code section is in status.
type: legislation
group:
delimiter: '. '
group:
delimiter: ', '
text:
- variable: title
- variable: references
group:
delimiter: ' '
text:
- macro: container-legal
- macro: date-legal
- variable: status
prefix: (
suffix: )
text:
macro: access
- # APA generally defers to Bluebook for legal citations, but diverges without
# explanation for treaty items. The Bluebook format that was used in APA 6th
# ed. is used here.
type: treaty
group:
delimiter: ', '
text:
- variable: title
text-case: title
- macro: date-legal
- macro: container-legal
- macro: access
names:
variable: author
name:
initialize-with: .
form: short
delimiter: '-'
- name: date-legal
choose:
if:
type: legal_case
group:
prefix: (
suffix: )
delimiter: ' '
text:
variable: authority
choose:
if:
# Print only year for cases published in reporters
variable: container-title
match: any
date:
variable: issued
form: numeric
date-parts: year
else:
date:
variable: issued
form: text
else-if:
- type: bill legislation
match: any
group:
prefix: (
suffix: )
delimiter: ' '
group:
delimiter: ' '
date:
variable: original-date
date-part:
name: year
text:
term: and
form: symbol
date:
variable: issued
date-part:
name: year
- type: treaty
date:
variable: issued
form: text
- # Expect legal item container-titles to be stored in short form
name: container-legal
choose:
if:
type: legal_case
group:
delimiter: ' '
choose:
if:
variable: container-title
group:
delimiter: ' '
text:
- variable: volume
- variable: container-title
group:
# Change to label variable="section" as that becomes available
delimiter: ' '
text:
- term: section
form: symbol
- variable: section
choose:
if:
variable: page page-first
match: any
text:
variable: page-first
else:
text:
value: ___
else:
group:
delimiter: ' '
choose:
if:
# Replace with label variable="number" if that becomes available
is-numeric: number
text:
term: issue
form: short
text-case: capitalize-first
text:
variable: number
else-if:
- type: bill
group:
delimiter: ', '
group:
- delimiter: ' '
text:
variable: genre
group:
delimiter: ' '
choose:
if:
# Replace with label variable="number" as that becomes available
variable: chapter-number container-title
match: none
text:
term: issue
form: short
text:
variable: number
- delimiter: ' '
text:
- variable: volume
- variable: container-title
- variable: page-first
text:
- variable: authority
- variable: chapter-number
- type: legislation
choose:
if:
# There's a public law number
variable: number
group:
delimiter: ', '
text:
variable: number
prefix: 'Pub. L. No. '
group:
delimiter: ' '
text:
- variable: volume
- variable: container-title
- variable: page-first
else:
group:
delimiter: ' '
text:
- variable: volume
- variable: container-title
choose:
if:
variable: section
group:
# Change to label variable="section" as that becomes available
delimiter: ' '
text:
- term: section
form: symbol
- variable: section
else:
text:
variable: page-first
- type: treaty
group:
delimiter: ' '
number:
variable: volume
text:
variable: container-title
choose:
if:
variable: page page-first
match: any
text:
variable: page-first
else:
group:
# Replace with label variable="number" if that becomes available
delimiter: ' '
text:
- term: issue
form: short
text-case: capitalize-first
- variable: number
- name: citation-locator
group:
delimiter: ' '
choose:
if:
locator: chapter
label:
variable: locator
text-case: capitalize-first
else:
label:
variable: locator
form: short
text:
variable: locator
# Legal citations have their own rules
citation:
et-al-min: "3"
et-al-use-first: "1"
disambiguate-add-year-suffix: "true"
disambiguate-add-names: "true"
disambiguate-add-givenname: "true"
collapse: year
givenname-disambiguation-rule: primary-name-with-initials
sort:
key:
- macro: author-bib
names-min: "3"
names-use-first: "1"
- macro: date-sort-group
- macro: date-sort-date
sort: ascending
- variable: status
layout:
prefix: (
suffix: )
delimiter: '; '
group:
delimiter: ', '
text:
- macro: author-intext
- macro: date-intext
- macro: citation-locator
bibliography:
hanging-indent: "true"
et-al-min: "21"
et-al-use-first: "19"
et-al-use-last: "true"
entry-spacing: "0"
line-spacing: "2"
sort:
key:
- macro: author-bib
- macro: date-sort-group
- macro: date-sort-date
sort: ascending
- variable: status
- macro: title
layout:
choose:
if:
# Legal items have different orders and delimiters
type: bill legal_case legislation treaty
match: any
choose:
if:
variable: DOI URL
match: any
text:
macro: legal-cites
else:
text:
macro: legal-cites
suffix: .
else:
group:
delimiter: ' '
group:
delimiter: '. '
suffix: .
text:
- macro: author-bib
- macro: date-bib
- macro: title-and-descriptions
- macro: container
- macro: event
- macro: publisher
text:
- macro: access
- macro: publication-history
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment