summaryrefslogtreecommitdiff
path: root/tex/context/base/publ-imp-apa.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/publ-imp-apa.mkiv')
-rw-r--r--tex/context/base/publ-imp-apa.mkiv547
1 files changed, 547 insertions, 0 deletions
diff --git a/tex/context/base/publ-imp-apa.mkiv b/tex/context/base/publ-imp-apa.mkiv
new file mode 100644
index 000000000..3df33ce63
--- /dev/null
+++ b/tex/context/base/publ-imp-apa.mkiv
@@ -0,0 +1,547 @@
+%D \module
+%D [ file=publ-imp-apa,
+%D version=2013.12.12, % based on bibl-apa.tex and later xml variant
+%D title=APA bibliography style,
+%D subtitle=Publications,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is therefore copyrighted
+%D by \PRAGMA. See mreadme.pdf for details.
+
+% common
+
+\loadbtxdefinitionfile[def]
+
+\startsetups btx:apa:common:wherefrom
+ \btxdoifelse {address} {
+ \getvariable{btx:temp}{left}
+ \btxdoifelse {country} {
+ \btxdoifelse {\getvariable{btx:temp}{label}} {
+ \btxflush{address}\btxcomma\btxflush{country}: \btxflush{\getvariable{btx:temp}{label}}
+ } {
+ \btxflush{address}\btxcomma\btxflush{country}
+ }
+ } {
+ \btxdoifelse {\getvariable{btx:temp}{label}} {
+ \btxflush{address}\btxcomma\btxflush{\getvariable{btx:temp}{label}}
+ } {
+ \btxflush{address}
+ }
+ }
+ \getvariable{btx:temp}{right}
+ } {
+ \btxdoifelse {country} {
+ \getvariable{btx:temp}{left}
+ \btxdoifelse {\getvariable{btx:temp}{label}} {
+ \btxflush{country}: \btxflush{\getvariable{btx:temp}{label}}
+ } {
+ \btxflush{country}
+ }
+ \getvariable{btx:temp}{right}
+ } {
+ \btxdoifelse {\getvariable{btx:temp}{label}} {
+ \getvariable{btx:temp}{left}
+ \btxflush{\getvariable{btx:temp}{label}}
+ \getvariable{btx:temp}{right}
+ } {
+ \getvariable{btx:temp}{otherwise}
+ }
+ }
+ }
+\stopsetups
+
+% \setvariables[btx:temp][label=,left=,right=,otherwise=]
+
+\startsetups btx:apa:common:publisher
+ \begingroup
+ \setvariables[btx:temp][label=publisher]\relax
+ \btxsetup{btx:apa:common:wherefrom}
+ \endgroup
+\stopsetups
+
+\startsetups btx:apa:common:organization
+ \begingroup
+ \setvariables[btx:temp][label=organization]\relax
+ \btxsetup{btx:apa:common:wherefrom}
+ \endgroup
+\stopsetups
+
+\startsetups btx:apa:common:school
+ \begingroup
+ \setvariables[btx:temp][label=school]\relax
+ \btxsetup{btx:apa:common:wherefrom}
+ \endgroup
+\stopsetups
+
+\startsetups btx:apa:common:institution
+ \begingroup
+ \setvariables[btx:temp][label=institution]\relax
+ \btxsetup{btx:apa:common:wherefrom}
+ \endgroup
+\stopsetups
+
+\startsetups btx:apa:common:school:subsentence
+ \begingroup
+ \setvariables[btx:temp][label=school,left=\btxcomma,right=\btxperiod,otherwise=\btxperiod]\relax
+ \btxsetup{btx:apa:common:wherefrom}
+ \endgroup
+\stopsetups
+
+\startsetups btx:apa:common:institution:subsentence
+ \begingroup
+ \setvariables[btx:temp][label=institution,left=\btxcomma,right=\btxperiod,otherwise=\btxperiod]\relax
+ \btxsetup{btx:apa:common:wherefrom}
+ \endgroup
+\stopsetups
+
+\startsetups btx:apa:common:publisher:sentence
+ \begingroup
+ \setvariables[btx:temp][label=publisher,left=\btxspace,right=\btxperiod]\relax
+ \btxsetup{btx:apa:common:wherefrom}
+ \endgroup
+\stopsetups
+
+\startsetups btx:apa:common:organization:sentence
+ \begingroup
+ \setvariables[btx:temp][label=organization,left=\btxspace,right=\btxperiod]\relax
+ \btxsetup{btx:apa:common:wherefrom}
+ \endgroup
+\stopsetups
+
+\startsetups btx:apa:common:title-and-series
+ \btxdoif {title} {
+ \btxflush{title}
+ \btxdoif {series} {
+ \btxlparent\btxflush{series}\btxrparent
+ }
+ \btxperiod
+ }
+\stopsetups
+
+\startsetups btx:apa:common:title-it-and-series
+ \btxdoif {title} {
+ \bgroup\it\btxflush{title}\/\egroup
+ \btxdoif {series} {
+ \btxlparent\btxflush{series}\btxrparent
+ }
+ \btxperiod
+ }
+\stopsetups
+
+\disablemode[btx:apa:edited-book]
+
+\startsetups btx:apa:common:author-and-year
+ \btxdoif {author} {
+ \btxflushauthor{author}
+ }
+ \btxdoif {year} {
+ \btxlparent\btxflush{year}\btxrparent
+ }
+ \btxperiod
+\stopsetups
+
+\startsetups btx:apa:common:author-or-key-and-year
+ \btxdoifelse {author} {
+ \btxflushauthor{author}
+ } {
+ \btxdoif {key} {
+ \btxlbracket\btxsetup{btx:format:key}\btxrbracket
+ }
+ }
+ \btxdoif {year} {
+ \btxlparent\btxflush{year}\btxrparent
+ }
+ \btxperiod
+\stopsetups
+
+\startsetups btx:apa:common:author-editors-crossref-year
+ \btxdoif {author} {
+ \btxflushauthor{author}
+ } {
+ \btxdoifelse {editor} {
+ \enablemode[btx:apa:edited-book]
+ \btxflushauthor{editor}
+ \btxcomma\btxsingularplural{editor}{editors}
+ } {
+ % weird period
+ \btxdoif {crossref} {
+ \btxlbracket\btxsetup{btx:format:crossref}\btxrbracket\btxperiod
+ }
+ }
+ }
+ \btxdoif {year} {
+ \btxlparent\btxflush{year}\btxrparent
+ }
+ \btxperiod
+\stopsetups
+
+\startsetups btx:apa:common:editor-or-key-and-year
+ \btxdoifelse {editor} {
+ \enablemode[btx:apa:edited-book]
+ \btxflushauthor{editor}
+ \btxcomma\btxsingularplural{editor}{editors}
+ } {
+ \btxdoif {key} {
+ \btxlbracket\btxsetup{btx:format:key}\btxrbracket
+ }
+ }
+ \btxspace
+ \btxdoif {year} {
+ \btxlparent\btxflush{year}\btxrparent
+ }
+ \btxperiod
+\stopsetups
+
+\startsetups btx:apa:common:note
+ \btxdoif {note} {
+ \btxspace\btxflush{note}\btxperiod
+ }
+\stopsetups
+
+\startsetups btx:apa:common:comment
+ \btxdoif {comment} {
+ \btxspace\btxflush{comment}\btxperiod
+ }
+\stopsetups
+
+\startsetups btx:apa:common:pages:p
+ \btxdoif {pages} {
+ \btxspace\btxflush{pages}\btxspace p\btxperiod
+ }
+\stopsetups
+
+\startsetups btx:apa:common:pages:pp
+ \btxdoif {pages} {
+ \btxspace\btxflush{pages}\btxspace pp\btxperiod
+ }
+\stopsetups
+
+\startsetups btx:apa:common:pages:pages
+ \btxdoif {pages} {
+ \btxcomma pages~\btxflush{pages}
+ }
+\stopsetups
+
+\startsetups btx:apa:common:edition:sentense
+ \btxdoif {edition} {
+ \btxspace\btxflush{edition}\btxspace edition\btxperiod
+ }
+\stopsetups
+
+% check when the next is used (no period)
+
+% \startsetups btx:apa:common:edition
+% \btxdoif {edition} {
+% \btxspace\btxflush{edition}\btxspace edition
+% }
+% \stopsetups
+
+% we can share more, todo
+
+% specific
+
+\startsetups btx:apa:article
+ \btxsetup{btx:apa:common:author-or-key-and-year}
+ \btxdoif {title} {
+ \btxflush{title}\btxperiod
+ }
+ \btxdoifelse {journal} {
+ \bgroup\it\btxflush{journal}\/\egroup
+ } {
+ \btxdoif {crossref} {
+ In\btxspace\btxflush{crossref}
+ }
+ }
+ \btxdoifelse {volume} {
+ \btxcomma\bgroup\it\btxflush{volume}\/\egroup
+ \btxdoif {issue} {
+ \btxlparent\btxflush{issue}\btxrparent
+ }
+ \btxdoif {pages} {
+ \btxcomma\btxflush{pages}
+ }
+ \btxperiod
+ } {
+ \btxsetup{btx:apa:common:pages:pp}
+ }
+ \btxsetup{btx:apa:common:note}
+ \btxsetup{btx:apa:common:comment}
+\stopsetups
+
+\startsetups btx:apa:book
+ \btxsetup{btx:apa:common:author-editors-crossref-year}
+ \btxdoif {title} {
+ \bgroup\it\btxflush{title}\/\egroup
+ \doifmodeelse {btx:apa:edited-book} {
+ \btxdoifelse {volume} {
+ \btxspace Number\nonbreakablespace\btxflush{volume}
+ \btxdoifelse {series} {
+ \btxspace in\nonbreakablespace\btxflush{series}\btxperiod
+ } {
+ \btxdoifelse {crossref} {
+ \btxspace in\btxlbracket\btxsetup{btx:format:crossref}\btxrbracket
+ } {
+ \btxperiod
+ }
+ }
+ } {
+ \btxdoif {series} {
+ \btxspace\btxflush{series}
+ }
+ \btxperiod
+ }
+ } {
+ \btxdoifelse {crossref} {
+ \btxdoif {chapter} {
+ \btxcomma\btxflush{chapter}
+ }
+ \btxsetup{btx:apa:common:pages:pages}
+ \btxperiod
+ \btxdoif {volume} {
+ Volume\nonbreakablespace\btxflush{volume}\btxspace of\nonbreakablespace
+ }
+ } {
+ \btxdoif {volume} {
+ \btxcomma volume\nonbreakablespace\btxflush{volume}
+ \btxdoif {series} {
+ \btxspace of\nonbreakablespace\bgroup\it\btxflush{series}\/\egroup
+ }
+ \btxdoif {chapter} {
+ \btxcomma\btxflush{chapter}
+ }
+ \btxsetup{btx:apa:common:pages:pages}
+ \btxperiod
+ }
+ }
+ }
+ }
+ \btxsetup{btx:apa:common:edition:sentence}
+ \btxsetup{btx:apa:common:publisher:sentence}
+ \btxsetup{btx:apa:common:pages:p}% twice?
+ \btxsetup{btx:apa:common:note}
+\stopsetups
+
+\startsetups btx:apa:inbook
+ \btxsetup{btx:apa:common:author-editors-crossref-year}
+ \btxdoifelse {title} {
+ \bgroup\it\btxflush{title}\/\egroup
+ } {
+ \doifmodeelse {btx:apa:edited-book} {
+ \btxdoifelse {volume} {
+ \btxspace number\nonbreakablespace\btxflush{volume}
+ \btxdoifelse {series} {
+ \btxspace in\nonbreakablespace\btxflush{series}\btxperiod
+ } {
+ \btxdoifelse {crossref} {
+ \btxspace in\btxlbracket\btxsetup{btx:format:crossref}\btxrbracket
+ } {
+ \btxperiod
+ }
+ }
+ } {
+ \btxdoif {series} {
+ \btxspace\btxflush{series}\btxperiod
+ }
+ }
+ } {
+ \btxdoifelse {crossref} {
+ \btxdoif {chapter} {
+ \btxcomma\btxflush{chapter}
+ }
+ \btxsetup{btx:apa:common:pages:pages}
+ \btxdoif {volume} {
+ Volume\nonbreakablespace\btxflush{volume}\btxspace of\nonbreakablespace
+ }
+ \btxdoif {crossref} {
+ \btxlbracket\btxsetup{btx:format:crossref}\btxrbracket
+ }
+ } {
+ \btxdoif {volume} {
+ \btxcomma volume\nonbreakablespace\btxflush{volume}
+ \btxdoif {series} {
+ \btxspace of\nonbreakablespace\bgroup\it\btxflush{series}\/\egroup
+ }
+ \btxdoif {chapter} {
+ \btxcomma\btxflush{chapter}
+ }
+ \btxsetup{btx:apa:common:pages:pages}
+ \btxperiod
+ }
+ }
+ }
+ }
+ \btxspace
+ \btxsetup{btx:apa:common:edition:sentence}
+ \btxsetup{btx:apa:common:publisher}
+ \btxsetup{btx:apa:common:note}
+\stopsetups
+
+\startsetups btx:apa:booklet
+ \btxsetup{btx:apa:common:author-or-key-and-year}
+ \btxsetup{btx:apa:common:title-it-and-series}
+ \btxsetup{btx:apa:common:edition:sentence}
+ \btxsetup{btx:apa:common:publication:sentence}
+ \btxsetup{btx:apa:common:pages:p}
+ \btxsetup{btx:apa:common:note}
+\stopsetups
+
+\startsetups btx:apa:manual
+ \btxsetup{btx:apa:common:author-or-key-and-year}
+ \btxsetup{btx:apa:common:title-it-and-series}
+ \btxsetup{btx:apa:common:edition:sentence}
+ \btxsetup{btx:apa:common:organization:sentence}
+ \btxsetup{btx:apa:common:pages:p}
+ \btxsetup{btx:apa:common:note}
+\stopsetups
+
+\startsetups btx:apa:incollection
+ \btxsetup{btx:apa:common:author-and-year}
+ \btxdoif {arttitle} {
+ \btxflush{arttitle}\btxperiod
+ }
+ In\btxspace
+ \btxdoifelse {title} {
+ \btxflushauthor{editor}\btxcomma
+ \bgroup\it\btxflush{title}\/\egroup
+ \btxdoif {series} {
+ \btxdoif {volume} {
+ \btxcomma number\btxspace\btxflush{volume}\btxspace in
+ }
+ \btxspace\btxflush{series}
+ }
+ \btxdoif {chapter} {
+ \btxcomma\btxflush{chapter}\btxspace
+ }
+ \btxsetup{btx:apa:common:pages:pages}
+ \btxdoif {edition} {
+ \btxspace\btxflush{edition}\btxspace edition
+ }
+ \btxsetup{btx:apa:common:publisher:sentence}
+ } {
+ \btxdoif {crossref} {
+ \btxlbracket\btxsetup{btx:format:crossref}\btxrbracket
+ }
+ \btxdoif {chapter} {
+ \btxcomma\btxflush{chapter}
+ }
+ \btxspace
+ \btxsetup{btx:apa:common:pages:pages}
+ }
+ \btxsetup{btx:apa:common:note}
+\stopsetups
+
+\startsetups btx:apa:inproceedings
+ \btxsetup{btx:apa:common:author-and-year}
+ \btxdoif {arttitle} {
+ \btxflush{arttitle}\btxperiod
+ }
+ In\btxspace
+ \btxdoifelse {title} {
+ \btxdoif {editors} {
+ \btxflush{btx:apa:format:editors}
+ \btxcomma\btxsingularplural{editor}{editors}\btxcomma
+ }
+ \bgroup\it\btxflush{title}\/\egroup
+ \btxdoif {series} {
+ \btxdoif {volume} {
+ \btxcomma number~\btxflush{volume} in
+ }
+ \btxspace
+ \btxflush{series}
+ }
+ \btxdoif {chapter} {
+ \btxcomma\btxflush{chapter}\btxspace
+ }
+ \btxsetup{btx:apa:common:pages:pages}
+ \btxperiod
+ \btxsetup{btx:apa:common:organization:sentence}
+ } {
+ \btxdoif {crossref} {
+ \btxlbracket\btxsetup{btx:format:crossref}\btxrbracket
+ }
+ \btxdoif {chapter} {
+ \btxcomma\btxflush{chapter}\btxspace
+ }
+ \btxsetup{btx:apa:common:pages:pages}
+ \btxperiod
+ }
+ \btxsetup{btx:apa:common:note}
+\stopsetups
+
+\startsetups btx:apa:proceedings
+ \btxsetup{btx:apa:common:editor-or-key-and-year}
+ \btxdoif {title} {
+ \bgroup\it\btxflush{title}\/\egroup
+ \btxdoif {volume} {
+ \btxcomma number\btxspace\btxflush{volume}\btxspace in\btxspace
+ }
+ \btxdoif {chapter} {
+ \btxcomma\btxflush{chapter}\btxspace
+ }
+ \btxsetup{btx:apa:common:pages:pages}
+ \btxperiod
+ \btxsetup{btx:apa:common:organization:sentence}
+ }
+ \btxsetup{btx:apa:common:note}
+\stopsetups
+
+\startsetups btx:apa:common:thesis
+ \btxsetup{btx:apa:common:author-and-year}
+ \btxsetup{btx:apa:common:title-it-and-series}
+ \btxdoifelse {type} {
+ \btxflush{type}
+ } {
+ \getvariable{btx:temp}{label}
+ }
+ \btxsetup{btx:apa:common:school:subsentence}
+ \btxsetup{btx:apa:common:pages:p}
+ \btxsetup{btx:apa:common:note}
+\stopsetups
+
+\startsetups btx:apa:mastersthesis
+ \setvariables[btx:temp][label=Master's thesis]
+ \btxsetup{btx:apa:common:thesis}
+\stopsetups
+
+\startsetups btx:apa:phdthesis
+ \setvariables[btx:temp][label=PhD thesis]
+ \btxsetup{btx:apa:common:thesis}
+\stopsetups
+
+\startsetups btx:apa:techreport
+ \btxsetup{btx:apa:common:author-and-year}
+ \btxsetup{btx:apa:common:title-and-series}
+ \btxdoifelse {type} {
+ \btxflush{type}
+ \btxdoif {volume} {
+ \btxspace\btxflush{volume}
+ }
+ } {
+ \btxspace Technical Report
+ }
+ \btxsetup{btx:apa:common:institution:subsentence}
+ \btxsetup{btx:apa:common:pages:p}
+ \btxsetup{btx:apa:common:note}
+\stopsetups
+
+\startsetups btx:apa:misc
+ \btxsetup{btx:apa:common:author-and-year}
+ \btxsetup{btx:apa:common:title-and-series}
+ \btxsetup{btx:apa:common:publisher:sentence}
+ \btxsetup{btx:apa:common:pages:p}
+ \btxsetup{btx:apa:common:note}
+\stopsetups
+
+\startsetups btx:apa:unpublished
+ \btxsetup{btx:apa:common:author-and-year}
+ \btxsetup{btx:apa:common:title-and-series}
+ \btxsetup{btx:apa:common:pages:p}
+ \btxdoif {type} {
+ \btxlparent\btxflush{type}\btxrparent
+ }
+ \btxsetup{btx:apa:common:note}
+\stopsetups
+
+\endinput