summaryrefslogtreecommitdiff
path: root/tex/context/base/publ-imp-apa.mkvi
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2014-10-27 11:15:05 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2014-10-27 11:15:05 +0100
commitf09a83056cb0fba2e79228858f5e86f2d297e3ca (patch)
treea986de0953f95b9266738b3b685a9177686ce676 /tex/context/base/publ-imp-apa.mkvi
parent3a43c9a819d5d675e2a90f90b1ba1e36076a1af0 (diff)
downloadcontext-f09a83056cb0fba2e79228858f5e86f2d297e3ca.tar.gz
2014-10-27 09:29:00
Diffstat (limited to 'tex/context/base/publ-imp-apa.mkvi')
-rw-r--r--tex/context/base/publ-imp-apa.mkvi971
1 files changed, 559 insertions, 412 deletions
diff --git a/tex/context/base/publ-imp-apa.mkvi b/tex/context/base/publ-imp-apa.mkvi
index e83306bcd..d3f6dda73 100644
--- a/tex/context/base/publ-imp-apa.mkvi
+++ b/tex/context/base/publ-imp-apa.mkvi
@@ -36,8 +36,6 @@
% First of all, the APA style defines authoryear bibliography lists.
-% Question: is the field "key=" (->sortkey, not the \cite [key]) used if present?
-
% does not work here: \setupbtxrendering [standard] [numbering=no,sorttype=authoryear]
% does not work here: \setupbtxcitevariant [alternative=authoryear,sorttype=authoryear]
@@ -71,7 +69,7 @@
apa:phdthesis={PhD thesis},
apa:technicalreport={Tech. Rep.}, % Technical report
apa:supplement={Suppl.}, % Supplement
- apa:patent=patent,
+ apa:patent=Patent,
apa:Translator={Trans.}, % Translator(s)
apa:Editor={Ed.}, % Editor
apa:Editors={Eds.}, % Editors
@@ -91,7 +89,7 @@
apa:pages=pages,
apa:and=and,
apa:period={. },
- apa:Author=Author, %TODO, should be typeset in italic...
+ apa:Author=Author,
apa:Advanced={Advanced online publication},
apa:Retrieved={Retrieved from},
apa:others={et al.}]
@@ -102,7 +100,7 @@
apa:phdthesis={Thèse de doctorat},
apa:technicalreport={Rapport technique},
apa:supplement=Supplément,
- apa:patent=brevet,
+ apa:patent=Brevet,
apa:Translator=Traducteur,
apa:Editor=Éditeur,
apa:Editors=Éditeurs,
@@ -166,7 +164,7 @@
apa:phdthesis={Tesi di dottorato},
apa:technicalreport={Relazione tecnica},
apa:supplement={Supplemento},
- apa:patent=brevetto,
+ apa:patent=Brevetto,
apa:Translator={Trad.}, % Translator(s)
apa:Editor={A cura di},
apa:Editors={A cura di},
@@ -194,27 +192,27 @@
%D The variables control the shared code for which we use a tex definition with
%D one argument, specifying the field name.
-\setvariables
- [btx:apa:publisher]
- [left=\btxspace,
- right=\btxperiod]
-
-\setvariables
- [btx:apa:organization]
- [left=\btxspace,
- right=\btxperiod]
-
-\setvariables
- [btx:apa:school]
- [left=\btxcomma,
- right=\btxperiod,
- otherwise=\btxperiod]
-
-\setvariables
- [btx:apa:institution]
- [left=\btxcomma,
- right=\btxperiod,
- otherwise=\btxperiod]
+%\setvariables
+% [btx:apa:publisher]
+% [left=\btxspace,
+% right=\btxperiod]
+%
+%\setvariables
+% [btx:apa:organization]
+% [left=\btxspace,
+% right=\btxperiod]
+%
+%\setvariables
+% [btx:apa:school]
+% [left=\btxcomma,
+% right=\btxperiod,
+% otherwise=\btxperiod]
+%
+%\setvariables
+% [btx:apa:institution]
+% [left=\btxcomma,
+% right=\btxperiod,
+% otherwise=\btxperiod]
% First some helpers:
@@ -232,7 +230,6 @@
\btxcomma
% language issue here?
\btxflush{month}
- \btxspace
\btxdoif {day} {
\btxspace
\btxflush{day}
@@ -241,13 +238,17 @@
}
} {
\btxlabeltext{apa:nd}
+ \btxdoif {suffix} {
+ \btxspace
+ \btxflush{suffix}
+ }
}
\btxrightparenthesisperiod
\stoptexdefinition
-\starttexdefinition btx:apa:title-subtitle #before #type
+\starttexdefinition btx:apa:title-subtitle-including- #type
\btxdoif {title} {
- #before
+ \setmode{btx:apa:title-placed}
\btxflush{Word -> title}
\btxdoif {subtitle} {
\btxcolon
@@ -267,12 +268,11 @@
}
\stoptexdefinition
-\starttexdefinition btx:apa:author-or-title #type
+\starttexdefinition btx:apa:author-or-title-including- #type
\btxdoifelse {author} {
\btxflushauthor[invertedshort]{author}
} {
- \setmode{btx:apa:title-placed}
- \texdefinition{btx:apa:title-subtitle}{}{#type}
+ \texdefinition{btx:apa:title-subtitle-including-}{#type}
}
\stoptexdefinition
@@ -286,7 +286,7 @@
\btxrightparenthesisperiod
\stoptexdefinition
-\starttexdefinition btx:apa:author-or-editor-or-publisher #title
+\starttexdefinition btx:apa:author-or-editor-or-publisher-or- #title #publisher
\btxdoifelse {author} {
\btxflushauthor[invertedshort]{author}
} {
@@ -294,12 +294,14 @@
\btxflushauthor[invertedshort]{editor}
\texdefinition{btx:apa:editor-or-editors}
} {
- \btxdoifelse {publisher} {
- \btxflush{publisher}
+ \btxdoifelse {#publisher} {
+% \setmode{btx:apa:publisher-as-author}
+ \btxflush{#publisher}
} {
\doif {#title} {title} {
- \setmode{btx:apa:title-placed}
- \texdefinition{btx:apa:title-subtitle}{}{type}
+ \texdefinition{btx:apa:title-subtitle-including-}
+ \doifelse {#publisher} {institution}%->techreport
+ {type} {}
}
}
}
@@ -315,23 +317,25 @@
\btxflush{organization}
} {
\doif {#title} {title} {
- \setmode{btx:apa:title-placed}
- \texdefinition{btx:apa:title-subtitle}{}{type}
+ \texdefinition{btx:apa:title-subtitle-including-}{type}
}
}
}
\stoptexdefinition
-\starttexdefinition btx:apa:title-if-not-placed #it
+\starttexdefinition btx:apa:title-if-not-placed-including- #type #it
\doifnotmode {btx:apa:title-placed} {
- \doifelse {#it} {it} {
- \begingroup
- \it
- \texdefinition{btx:apa:title-subtitle}{\btxspace}{type}
- \italiccorrection
- \endgroup
- } {
- \texdefinition{btx:apa:title-subtitle}{\btxspace}{type}
+ \btxdoif {title} {
+ \btxspace
+ \doifelse {#it} {it} {
+ \begingroup
+ \it
+ \texdefinition{btx:apa:title-subtitle-including-}{#type}
+ \italiccorrection
+ \endgroup
+ } {
+ \texdefinition{btx:apa:title-subtitle-including-}{#type}
+ }
}
}
\stoptexdefinition
@@ -364,8 +368,8 @@
}
\stoptexdefinition
-\starttexdefinition btx:apa:doif-edition-or-volume-or-number-or-pages #if
- \btxdoifelse {edition} {
+\starttexdefinition btx:apa:doif-edition-or-volume-or-number-or-pages #edition #if
+ \btxdoifelse {#edition} {
#if
}{
\btxdoifelse {volume} {
@@ -382,16 +386,24 @@
}
\stoptexdefinition
-\starttexdefinition btx:apa:edition-volume-number-pages
- \texdefinition{btx:apa:doif-edition-or-volume-or-number-or-pages}{\btxleftparenthesis}
- \btxdoif {edition} {
- \btxflush{edition}
- \btxspace
- \btxlabeltext{apa:edition}
+\starttexdefinition btx:apa:edition-volume-number-pages #edition
+ \texdefinition{btx:apa:doif-edition-or-volume-or-number-or-pages}{#edition}{\btxleftparenthesis}
+ \btxdoifelse {#edition} {
+ \btxflush{#edition}
+ \doif {#edition} {edition} {
+ \btxspace
+ \btxlabeltext{apa:edition}
+ }
+ } {
+ \doif {#edition} {type} {
+ \btxspace
+ \btxlabeltext{apa:technicalreport}
+ }
}
\btxdoif {volume} {
- \btxdoif {edition} {
- \btxcomma
+ \btxdoif {#edition} {
+ \doif {#edition} {edition}
+ {\btxcomma} {\btxspace}
}
\btxoneorrange {volume} {
\btxlabeltext{apa:Volume}
@@ -405,11 +417,13 @@
\btxdoifelse {volume} {
\btxcomma
} {
- \btxdoif {edition} {
- \btxcomma
+ \btxdoifelse {#edition} {
+ \doif {#edition} {edition}
+ {\btxcomma} {\btxspace}
+ } {
+ \btxspace
}
}
- \btxspace
\btxlabeltext{apa:Number}
\btxspace
\btxflush{number}
@@ -418,8 +432,9 @@
\btxdoifelse {volume} {
\btxcomma
} {
- \btxdoifelse {edition} {
- \btxcomma
+ \btxdoifelse {#edition} {
+ \doif {#edition} {edition}
+ {\btxcomma} {\btxspace}
} {
\btxdoif {number} {
\btxcomma
@@ -434,7 +449,7 @@
\btxspace
\btxflush{pages}
}
- \texdefinition{btx:apa:doif-edition-or-volume-or-number-or-pages}{\btxrightparenthesisperiod}
+ \texdefinition{btx:apa:doif-edition-or-volume-or-number-or-pages}{#edition}{\btxrightparenthesisperiod}
\stoptexdefinition
\starttexdefinition btx:apa:journal-volume-number-pages #pp
@@ -470,7 +485,7 @@
\btxcomma
}
}
- % APA rule for newspaper, ...
+ % APA rule for newspaper
\doif {#pp} {pp} {
\btxoneorrange {pages} {
\btxlabeltext{apa:p}
@@ -483,17 +498,17 @@
\btxperiod
}
\doifnot {#pp} {pp} {
- % not a newspaper...
+ % not a newspaper
\btxdoifnot {volume} {
\btxdoifnot {number} {
\btxdoifnot {pages} {
\btxdoifelse {doi} {
- \btxspace
+ \btxperiod
\btxlabeltext{apa:Advanced}
\btxperiod
} {
\btxdoif {url} {
- \btxspace
+ \btxperiod
\btxlabeltext{apa:Advanced}
\btxperiod
}
@@ -527,23 +542,23 @@
\btxspace
\ifconditional\btxinteractive
\goto {
- \hyphenatedurl{doi:\btxflush{doi}}
+ doi:\btxflush{doi}
} [
url(http://dx.doi.org/\btxflush{doi})
]
\else
- \hyphenatedurl{doi:\btxflush{doi}}
+ doi:\btxflush{doi}
\fi
}
\stoptexdefinition
\starttexdefinition btx:apa:note
- % grouping could indeed be useful...
+ % grouping could indeed be useful for note.
\btxdoif {note} {
\btxleftparenthesis
{\btxflush{note}}
\btxrightparenthesis\removeunwantedspaces
- % nospace if last item...
+ % no space if last item!
}
\stoptexdefinition
@@ -553,19 +568,19 @@
\texdefinition{btx:apa:doi}
\stoptexdefinition
-\starttexdefinition btx:apa:author-editor-other #field
- \btxdoif {#field} {
- \doifelse {#field} {publisher} {
- \doifelse {\btxflush{#field}} {\btxflush{author}} {
- \btxlabeltext{apa:Author}
- } {
- \btxflush{#field}
- }
- } {
- \btxflush{#field}
- }
- }
-\stoptexdefinition
+%\starttexdefinition btx:apa:author-editor-other #field
+% \btxdoif {#field} {
+% \doifelse {#field} {publisher} {
+% \doifmodeelse {btx:apa:publisher-as-author} {
+% \btxlabeltext{apa:Author}
+% } {
+% \btxflush{publisher}
+% }
+% } {
+% \btxflush{#field}
+% }
+% }
+%\stoptexdefinition
\starttexdefinition btx:apa:doifelse-publisher-or-author-or-editor #author #if #else
\btxdoifelse {publisher} {
@@ -591,7 +606,8 @@
}
\stoptexdefinition
-\starttexdefinition btx:apa:wherefrom-publisher #author
+% #author is author, editor, organization, howpublished or assignee
+\starttexdefinition btx:apa:wherefrom-publisher-author-is- #author
\btxdoifelse {country} {
\btxspace
\btxdoif {address} {
@@ -599,37 +615,50 @@
\btxcomma
}
\btxflush{country}
- \texdefinition{btx:apa:doifelse-publisher-or-author-or-editor}{#author}
- {\btxcolon} {\btxperiod}
+ \doifelse {#author} {howpublished}
+ {\btxdoifelse {howpublished}}
+ {\texdefinition{btx:apa:doifelse-publisher-or-author-or-editor}{#author}}
+ {\btxcolon} {\btxperiod}
} {
\btxdoifelse {address} {
\btxspace
\btxflush{address}
- \texdefinition{btx:apa:doifelse-publisher-or-author-or-editor}{#author}
- {\btxcolon} {\btxperiod}
+ \doifelse {#author} {howpublished}
+ {\btxdoifelse {howpublished}}
+ {\texdefinition{btx:apa:doifelse-publisher-or-author-or-editor}{#author}}
+ {\btxcolon} {\btxperiod}
} {
- \texdefinition{btx:apa:doifelse-publisher-or-author-or-editor}{#author}
+ \doifelse {#author} {howpublished}
+ {\btxdoifelse {howpublished}}
+ {\texdefinition{btx:apa:doifelse-publisher-or-author-or-editor}{#author}}
{\btxspace} {}
}
}
- \btxdoifelse {publisher} {
- \btxdoifelse {#author} {
- \btxflush{publisher}
- \btxperiod
- } {
- \btxdoif {editor} {
+ \doifelse {#author} {howpublished} {
+ \btxdoif {howpublished} {
+ \btxflush{howpublished}
+ \btxperiod
+ }
+ } {
+ \btxdoifelse {publisher} {
+ \btxdoifelse {#author} {
\btxflush{publisher}
\btxperiod
+ } {
+ \btxdoif {editor} {
+ \btxflush{publisher}
+ \btxperiod
+ }
}
- }
- } {
- \btxdoifelse {#author} {
- \btxlabeltext{apa:Author}
- \btxperiod
} {
- \btxdoif {editor} {
+ \btxdoifelse {#author} {
\btxlabeltext{apa:Author}
\btxperiod
+ } {
+ \btxdoif {editor} {
+ \btxlabeltext{apa:Author}
+ \btxperiod
+ }
}
}
}
@@ -642,9 +671,9 @@
% Optional fields: volume, number, pages, type, doi, url, note.
\startsetups btx:apa:article
- \texdefinition{btx:apa:author-or-title}{type}
+ \texdefinition{btx:apa:author-or-title-including-}{type}
\texdefinition{btx:apa:suffixedyear}{}
- \texdefinition{btx:apa:title-if-not-placed}{}
+ \texdefinition{btx:apa:title-if-not-placed-including-}{type}{}
\texdefinition{btx:apa:journal-volume-number-pages}{}
\texdefinition{btx:apa:url-note-doi}
\stopsetups
@@ -654,9 +683,9 @@
% Optional fields: volume, number, pages, type, month, day, doi, url, note.
\startsetups btx:apa:magazine
- \texdefinition{btx:apa:author-or-title}{type}
+ \texdefinition{btx:apa:author-or-title-including-}{type}
\texdefinition{btx:apa:suffixedyear}{date}
- \texdefinition{btx:apa:title-if-not-placed}{}
+ \texdefinition{btx:apa:title-if-not-placed-including-}{type}{}
\texdefinition{btx:apa:journal-volume-number-pages}{}
\texdefinition{btx:apa:url-note-doi}
\stopsetups
@@ -666,9 +695,9 @@
% Optional fields: volume, number, pages, type, month, day, doi, url, note.
\startsetups btx:apa:newspaper
- \texdefinition{btx:apa:author-or-title}{type}
+ \texdefinition{btx:apa:author-or-title-including-}{type}
\texdefinition{btx:apa:suffixedyear}{date}
- \texdefinition{btx:apa:title-if-not-placed}{}
+ \texdefinition{btx:apa:title-if-not-placed-including-}{type}{}
\texdefinition{btx:apa:journal-volume-number-pages}{pp}
\texdefinition{btx:apa:url-note-doi}
\stopsetups
@@ -681,11 +710,11 @@
% todo: series?
\startsetups btx:apa:book
- \texdefinition{btx:apa:author-or-editor-or-publisher}{title}
+ \texdefinition{btx:apa:author-or-editor-or-publisher-or-}{title}{publisher}
\texdefinition{btx:apa:suffixedyear}{}
- \texdefinition{btx:apa:title-if-not-placed}{it}
- \texdefinition{btx:apa:edition-volume-number-pages}
- \texdefinition{btx:apa:wherefrom-publisher}{author}
+ \texdefinition{btx:apa:title-if-not-placed-including-}{type}{it}
+ \texdefinition{btx:apa:edition-volume-number-pages}{edition}
+ \texdefinition{btx:apa:wherefrom-publisher-author-is-}{author}
\texdefinition{btx:apa:url-note-doi}
\stopsetups
@@ -697,15 +726,15 @@
% todo: series?
\startsetups btx:apa:inbook
- \texdefinition{btx:apa:author-or-editor-or-publisher}{}
+ \texdefinition{btx:apa:author-or-editor-or-publisher-or-}{}{publisher}
\texdefinition{btx:apa:suffixedyear}{}
\btxdoif {chapter} {
\btxflush{Word -> chapter}
\btxspace
}
\texdefinition{btx:apa:editor}{title}
- \texdefinition{btx:apa:edition-volume-number-pages}
- \texdefinition{btx:apa:wherefrom-publisher}{author}
+ \texdefinition{btx:apa:edition-volume-number-pages}{edition}
+ \texdefinition{btx:apa:wherefrom-publisher-author-is-}{author}
\texdefinition{btx:apa:url-note-doi}
\stopsetups
@@ -717,12 +746,12 @@
% todo: series?
\startsetups btx:apa:incollection
- \texdefinition{btx:apa:author-or-editor-or-publisher}{title}
+ \texdefinition{btx:apa:author-or-editor-or-publisher-or-}{title}{publisher}
\texdefinition{btx:apa:suffixedyear}{}
- \texdefinition{btx:apa:title-if-not-placed}{}
+ \texdefinition{btx:apa:title-if-not-placed-including-}{type}{}
\texdefinition{btx:apa:editor}{booktitle}
- \texdefinition{btx:apa:edition-volume-number-pages}
- \texdefinition{btx:apa:wherefrom-publisher}{author}
+ \texdefinition{btx:apa:edition-volume-number-pages}{edition}
+ \texdefinition{btx:apa:wherefrom-publisher-author-is-}{author}
\texdefinition{btx:apa:url-note-doi}
\stopsetups
@@ -734,17 +763,17 @@
\startsetups btx:apa:proceedings
\texdefinition{btx:apa:editor-or-organization}{title}
\texdefinition{btx:apa:suffixedyear}{date}
- \texdefinition{btx:apa:title-if-not-placed}{}
- \texdefinition{btx:apa:edition-volume-number-pages}
+ \texdefinition{btx:apa:title-if-not-placed-including-}{type}{}
+ \texdefinition{btx:apa:edition-volume-number-pages}{edition}
\btxdoifelse {editor} {
\btxdoif {organization} {
\btxspace
\btxflush{organization}
\btxcomma
}
- \texdefinition{btx:apa:wherefrom-publisher} {editor}
+ \texdefinition{btx:apa:wherefrom-publisher-author-is-}{editor}
} {
- \texdefinition{btx:apa:wherefrom-publisher} {organization}
+ \texdefinition{btx:apa:wherefrom-publisher-author-is-}{organization}
}
\texdefinition{btx:apa:url-note-doi}
\stopsetups
@@ -755,17 +784,17 @@
% todo: series?
\startsetups btx:apa:inproceedings
- \texdefinition{btx:apa:author-or-editor-or-publisher}{title}
+ \texdefinition{btx:apa:author-or-editor-or-publisher-or-}{title}{publisher}
\texdefinition{btx:apa:suffixedyear}{date}
- \texdefinition{btx:apa:title-if-not-placed}{}
+ \texdefinition{btx:apa:title-if-not-placed-including-}{type}{}
\texdefinition{btx:apa:editor}{booktitle}
- \texdefinition{btx:apa:edition-volume-number-pages}
+ \texdefinition{btx:apa:edition-volume-number-pages}{edition}
\btxdoif {organization} {
\btxspace
\btxflush{organization}
\btxcomma
}
- \texdefinition{btx:apa:wherefrom-publisher}{author}
+ \texdefinition{btx:apa:wherefrom-publisher-author-is-}{author}
\texdefinition{btx:apa:url-note-doi}
\stopsetups
@@ -779,9 +808,9 @@
\startsetups btx:apa:thesis
% unlikely not to have author!
- \texdefinition{btx:apa:author-or-title}{}
+ \texdefinition{btx:apa:author-or-title-including-}{}
\texdefinition{btx:apa:suffixedyear}{date}
- \texdefinition{btx:apa:title-if-not-placed}{it}
+ \texdefinition{btx:apa:title-if-not-placed-including-}{type}{it}
\btxleftparenthesis
\btxdoifelse {type} {
\btxflush{type}
@@ -816,7 +845,186 @@
\fastsetup{btx:apa:thesis}
\stopsetups
-% Alan's current revision stops here..
+% A work that is printed and bound, but without a named publisher or sponsoring institution.
+% Required field: title.
+% Optional fields: author, howpublished, address, month, year, note.
+
+\startsetups btx:apa:booklet
+ \texdefinition{btx:apa:author-or-title-including-}{}
+ \texdefinition{btx:apa:suffixedyear}{date}
+ \texdefinition{btx:apa:title-if-not-placed-including-}{type}{it}
+ \texdefinition{btx:apa:wherefrom-publisher-author-is-}{howpublished}
+ \texdefinition{btx:apa:url-note-doi}
+\stopsetups
+
+% Technical documentation.
+% Required field: title.
+% Optional fields: author, organization, address, edition, month, year, note.
+
+\startsetups btx:apa:manual
+ \texdefinition{btx:apa:author-or-editor-or-publisher-or-}{title}{organization}
+ \texdefinition{btx:apa:suffixedyear}{date}
+ \texdefinition{btx:apa:title-if-not-placed-including-}{type}{it}
+ \texdefinition{btx:apa:edition-volume-number-pages}{edition}
+ \texdefinition{btx:apa:wherefrom-publisher-author-is-}{organization}
+ \texdefinition{btx:apa:url-note-doi}
+\stopsetups
+
+% A report published by a school or other institution, usually numbered within a series.
+% Required fields: author, title, institution, year.
+% Optional fields: type, number, address, month, note.
+
+\startsetups btx:apa:techreport
+ \texdefinition{btx:apa:author-or-editor-or-publisher-or-}{title}{institution}
+ \texdefinition{btx:apa:suffixedyear}{date}
+ \texdefinition{btx:apa:title-if-not-placed-including-}{}{it}
+ \texdefinition{btx:apa:edition-volume-number-pages}{type}
+ \texdefinition{btx:apa:wherefrom-publisher-author-is-}{institution}
+ \texdefinition{btx:apa:url-note-doi}
+\stopsetups
+
+% A document having an author and title, but not formally published.
+% Required fields: author, title, note.
+% Optional fields: month, year.
+
+\startsetups btx:apa:unpublished
+ \texdefinition{btx:apa:author-or-title-including-}{}
+ \texdefinition{btx:apa:suffixedyear}{date}
+ \texdefinition{btx:apa:title-if-not-placed-including-}{}{it}
+ \texdefinition{btx:apa:url-note-doi}
+\stopsetups
+
+% A patent. Note that this category was not defined with BIBTEX. Below from JabRef:
+% Required fields: nationality, number, year, yearfiled
+% Optional fields: author, title, assignee, address, type, number, day, dayfiled, month, monthfiled, note, url
+% Also optional: publisher
+
+% todo: yearfiled, monthfiled, dayfiled
+
+\startsetups btx:apa:patent
+ \texdefinition{btx:apa:author-or-editor-or-publisher-or-}{title}{assignee}
+ \texdefinition{btx:apa:suffixedyear}{date}
+ \texdefinition{btx:apa:title-if-not-placed-including-}{type}{it}
+ \begingroup
+ \it
+ \btxdoif {nationality} {
+ \btxspace
+ \btxflush{nationality}
+ }
+ \btxspace
+ \btxlabeltext{apa:patent}
+ \btxdoif {number} {
+ \btxspace
+ \btxlabeltext{apa:Number}
+ \btxspace
+ \btxflush{number}
+ }
+ \btxperiod
+ \italiccorrection
+ \endgroup
+ \btxdoifelse {author} {
+ \btxdoifelse {country} {
+ \btxspace
+ \btxdoif {address} {
+ \btxflush{address}
+ \btxcomma
+ }
+ \btxflush{country}
+ \btxdoifelse {assignee}
+ {\btxcolon} {\btxperiod}
+ } {
+ \btxdoifelse {address} {
+ \btxspace
+ \btxflush{address}
+ \btxdoifelse {assignee}
+ {\btxcolon} {\btxperiod}
+ } {
+ \btxdoifelse {assignee}
+ {\btxspace} {}
+ }
+ }
+ \btxdoif {assignee} {
+ \btxflush{assignee}
+ \btxperiod
+ }
+ } {
+ \texdefinition{btx:apa:wherefrom-publisher-author-is-}{assignee}
+ }
+ \texdefinition{btx:apa:url}
+ \texdefinition{btx:apa:note}
+\stopsetups
+
+% Electronic. Note that this category was not defined with BIBTEX. Below from JabRef:
+% Required fields: title
+% Optional fields: address, author, howpublished, month, note, organization, url, year, doi
+% Also optional: type
+
+% Like Misc below but includes organization.
+
+\startsetups btx:apa:electronic
+ \texdefinition{btx:apa:author-or-title-including-}{type}
+ \texdefinition{btx:apa:suffixedyear}{date}
+ \texdefinition{btx:apa:title-if-not-placed-including-}{type}{it}
+ \btxdoif {organization} {
+ \btxspace
+ \btxflush{organization}
+ \btxperiod
+ }
+ \btxdoif {howpublished} {
+ \btxspace
+ \btxflush{howpublished}
+ \btxperiod
+ }
+ \texdefinition{btx:apa:url-note-doi}
+\stopsetups
+
+% Other. Note that this category was not defined with BIBTEX. Below from JabRef:
+% Required fields: author or title, year
+% Optional fields: note, doi, url
+
+\startsetups btx:apa:other
+ \texdefinition{btx:apa:author-or-title-including-}{}
+ \texdefinition{btx:apa:suffixedyear}{}
+ \texdefinition{btx:apa:title-if-not-placed-including-}{}{it}
+ \texdefinition{btx:apa:url-note-doi}
+\stopsetups
+
+% Use this type when nothing else fits.
+% Required fields: none.
+% Optional fields: author, title, howpublished, month, year, note.
+
+\startsetups btx:apa:misc
+ \texdefinition{btx:apa:author-or-title-including-}{}
+ \texdefinition{btx:apa:suffixedyear}{date}
+ \texdefinition{btx:apa:title-if-not-placed-including-}{}{it}
+ \btxdoif {howpublished} {
+ \btxspace
+ \btxflush{howpublished}
+ \btxperiod
+ }
+ \texdefinition{btx:apa:url-note-doi}
+\stopsetups
+
+% If all else fails to match:
+
+\startsetups btx:apa:literal
+ \btxdoif {text} {
+ \btxflush{text}
+ }
+\stopsetups
+
+%D Experiment:
+
+\startsetups btx:apa:lefttext
+ \currentbtxlefttext
+\stopsetups
+
+\startsetups btx:apa:righttext
+ \currentbtxrighttext
+\stopsetups
+
+\stopbtxrenderingdefinitions
+
%\starttexdefinition btx:apa:wherefrom #field
% \btxdoifelse {address} {
@@ -852,163 +1060,163 @@
% }
% }
%\stoptexdefinition
-
-\starttexdefinition btx:apa:title-and-series
- \btxdoif {title} {
- \btxspace
- \btxflush{Word -> title}
- \btxdoif {series} {
- \btxleftparenthesis
- \btxflush{series}
- \btxrightparenthesis
- }
- \btxperiod
- }
-\stoptexdefinition
-
-\starttexdefinition btx:apa:title-and-series-it
- \btxdoif {title} {
- \btxspace
- \texdefinition{btx:apa:italic}{Word -> title}
- \btxdoif {series} {
- \btxleftparenthesis
- \btxflush{series}
- \btxrightparenthesis
- }
- \btxperiod
- }
-\stoptexdefinition
-
-\disablemode[btx:apa:edited-book] % hm, ugly
-
-\starttexdefinition btx:apa:author-and-year
- \btxdoif {author} {
- \btxflushauthor{author}
- }
- \texdefinition{btx:apa:suffixedyear}{}
- \btxperiod
-\stoptexdefinition
-
-\starttexdefinition btx:apa:author-or-key-and-year
- \btxdoifelse {author} {
- \btxflushauthor{author}
- } {
- \btxdoif {key} {
- \btxleftbracket
- \btxsetup{btx:format:key}
- \btxrightbracket
- }
- }
- \texdefinition{btx:apa:suffixedyear}{}
- \btxperiod
-\stoptexdefinition
-
-\starttexdefinition btx:apa:author-editors-crossref-year
- % TODO: if there is no author or editor, then use publisher...
- \btxdoifelse {author} {
- \btxflushauthor{author}
- } {
- \btxdoifelse {editor} {
- \setmode{btx:apa:edited-book}
- \btxflushauthor{editor}
- \btxcomma
- \btxsingularplural {editor} {
- \btxlabeltext{apa:Editor}
- } {
- \btxlabeltext{apa:Editors}
- }
- } {
- % weird period
- \btxdoif {crossref} {
- \btxleftbracket
- \btxsetup{btx:format:crossref}
- \btxrightbracket
- \btxperiod
- }
- }
- }
- \texdefinition{btx:apa:suffixedyear}{}
- \btxperiod
-\stoptexdefinition
-
-\starttexdefinition btx:apa:editor-or-key-and-year
- \btxdoifelse {editor} {
- \setmode{btx:apa:edited-book}
- \btxflushauthor{editor}
- \btxcomma
- \btxsingularplural {editor} {
- \btxlabeltext{apa:Editor}
- } {
- \btxlabeltext{apa:Editors}
- }
- } {
- \btxdoif {key} {
- \btxleftbracket
- \btxsetup{btx:format:key}
- \btxrightbracket
- }
- }
- \texdefinition{btx:apa:suffixedyear}{}
- \btxperiod
-\stoptexdefinition
-
-\starttexdefinition btx:apa:pages
- \btxdoif {pages} {
- \btxspace
- \btxflush{pages}
- \btxperiod
- }
-\stoptexdefinition
-
-\starttexdefinition btx:apa:pages:p
- \btxdoif {pages} {
- \btxspace
- \btxoneorrange {pages} {
- \btxlabeltext{apa:p}
- } {
- \btxlabeltext{apa:pp}
- }
- \btxperiod
- \btxnbsp
- \btxflush{pages}
- \btxperiod
- }
-\stoptexdefinition
-
-\starttexdefinition btx:apa:pages:pp
- \btxdoif {pages} {
- \btxspace
- \btxflush{pages}
- \btxnbsp
- \btxlabeltext{apa:pp}
- \btxperiod
- }
-\stoptexdefinition
-
+%
+%\starttexdefinition btx:apa:title-and-series
+% \btxdoif {title} {
+% \btxspace
+% \btxflush{Word -> title}
+% \btxdoif {series} {
+% \btxleftparenthesis
+% \btxflush{series}
+% \btxrightparenthesis
+% }
+% \btxperiod
+% }
+%\stoptexdefinition
+%
+%\starttexdefinition btx:apa:title-and-series-it
+% \btxdoif {title} {
+% \btxspace
+% \texdefinition{btx:apa:italic}{Word -> title}
+% \btxdoif {series} {
+% \btxleftparenthesis
+% \btxflush{series}
+% \btxrightparenthesis
+% }
+% \btxperiod
+% }
+%\stoptexdefinition
+%
+%\disablemode[btx:apa:edited-book] % hm, ugly
+%
+%\starttexdefinition btx:apa:author-and-year
+% \btxdoif {author} {
+% \btxflushauthor{author}
+% }
+% \texdefinition{btx:apa:suffixedyear}{}
+% \btxperiod
+%\stoptexdefinition
+%
+%\starttexdefinition btx:apa:author-or-key-and-year
+% \btxdoifelse {author} {
+% \btxflushauthor{author}
+% } {
+% \btxdoif {key} {
+% \btxleftbracket
+% \btxsetup{btx:format:key}
+% \btxrightbracket
+% }
+% }
+% \texdefinition{btx:apa:suffixedyear}{}
+% \btxperiod
+%\stoptexdefinition
+%
+%\starttexdefinition btx:apa:author-editors-crossref-year
+% % TODO: if there is no author or editor, then use publisher...
+% \btxdoifelse {author} {
+% \btxflushauthor{author}
+% } {
+% \btxdoifelse {editor} {
+% \setmode{btx:apa:edited-book}
+% \btxflushauthor{editor}
+% \btxcomma
+% \btxsingularplural {editor} {
+% \btxlabeltext{apa:Editor}
+% } {
+% \btxlabeltext{apa:Editors}
+% }
+% } {
+% % weird period
+% \btxdoif {crossref} {
+% \btxleftbracket
+% \btxsetup{btx:format:crossref}
+% \btxrightbracket
+% \btxperiod
+% }
+% }
+% }
+% \texdefinition{btx:apa:suffixedyear}{}
+% \btxperiod
+%\stoptexdefinition
+%
+%\starttexdefinition btx:apa:editor-or-key-and-year
+% \btxdoifelse {editor} {
+% \setmode{btx:apa:edited-book}
+% \btxflushauthor{editor}
+% \btxcomma
+% \btxsingularplural {editor} {
+% \btxlabeltext{apa:Editor}
+% } {
+% \btxlabeltext{apa:Editors}
+% }
+% } {
+% \btxdoif {key} {
+% \btxleftbracket
+% \btxsetup{btx:format:key}
+% \btxrightbracket
+% }
+% }
+% \texdefinition{btx:apa:suffixedyear}{}
+% \btxperiod
+%\stoptexdefinition
+%
+%\starttexdefinition btx:apa:pages
+% \btxdoif {pages} {
+% \btxspace
+% \btxflush{pages}
+% \btxperiod
+% }
+%\stoptexdefinition
+%
+%\starttexdefinition btx:apa:pages:p
+% \btxdoif {pages} {
+% \btxspace
+% \btxoneorrange {pages} {
+% \btxlabeltext{apa:p}
+% } {
+% \btxlabeltext{apa:pp}
+% }
+% \btxperiod
+% \btxnbsp
+% \btxflush{pages}
+% \btxperiod
+% }
+%\stoptexdefinition
+%
+%\starttexdefinition btx:apa:pages:pp
+% \btxdoif {pages} {
+% \btxspace
+% \btxflush{pages}
+% \btxnbsp
+% \btxlabeltext{apa:pp}
+% \btxperiod
+% }
+%\stoptexdefinition
+%
% this does not seem to comply with APA style - need to verify!
-
-\starttexdefinition btx:apa:pages:pages
- \btxdoif {pages} {
- \btxcomma
- \btxlabeltext{apa:pages}
- \btxnbsp
- \btxflush{pages}
- \btxperiod
- }
-\stoptexdefinition
-
-\starttexdefinition btx:apa:edition:sentence
- \btxdoif {edition} {
- \btxspace
- \btxflush{edition}
- \btxspace
- \btxlabeltext{apa:edition}
- \btxperiod
- }
-\stoptexdefinition
-
+%
+%\starttexdefinition btx:apa:pages:pages
+% \btxdoif {pages} {
+% \btxcomma
+% \btxlabeltext{apa:pages}
+% \btxnbsp
+% \btxflush{pages}
+% \btxperiod
+% }
+%\stoptexdefinition
+%
+%\starttexdefinition btx:apa:edition:sentence
+% \btxdoif {edition} {
+% \btxspace
+% \btxflush{edition}
+% \btxspace
+% \btxlabeltext{apa:edition}
+% \btxperiod
+% }
+%\stoptexdefinition
+%
% check when the next is used (no period)
-
+%
% \starttexdefinition btx:apa:edition
% \btxdoif {edition} {
% \btxspace
@@ -1017,9 +1225,9 @@
% \btxlabeltext{apa:edition}
% }
% \stoptexdefinition
-
+%
% specific
-
+%
%\startsetups btx:apa:book
% \texdefinition{btx:apa:author-editors-crossref-year}
% \btxdoif {title} {
@@ -1098,7 +1306,7 @@
% \texdefinition{btx:apa:pages:pp}% twice?
% \texdefinition{btx:apa:url-note-doi}
%\stopsetups
-
+%
%\startsetups btx:apa:inbook
% \texdefinition{btx:apa:author-editors-crossref-year}
% \btxdoifelse {title} {
@@ -1182,33 +1390,25 @@
% \texdefinition{btx:apa:wherefrom}{publisher}
% \texdefinition{btx:apa:note}
%\stopsetups
-
-% A work that is printed and bound, but without a named publisher or sponsoring institution.
-% Required field: title.
-% Optional fields: author, howpublished, address, month, year, note.
-
-\startsetups btx:apa:booklet
- \texdefinition{btx:apa:author-or-key-and-year}
- \texdefinition{btx:apa:title-it-and-series}
- \texdefinition{btx:apa:edition:sentence}
- \texdefinition{btx:apa:publication:sentence}
- \texdefinition{btx:apa:pages:p}
- \texdefinition{btx:apa:note}
-\stopsetups
-
-% Technical documentation.
-% Required field: title.
-% Optional fields: author, organization, address, edition, month, year, note.
-
-\startsetups btx:apa:manual
- \texdefinition{btx:apa:author-or-key-and-year}
- \texdefinition{btx:apa:title-it-and-series}
- \texdefinition{btx:apa:edition:sentence}
- \texdefinition{btx:apa:wherefrom}{organization}
- \texdefinition{btx:apa:pages:p}
- \texdefinition{btx:apa:note}
-\stopsetups
-
+%
+%\startsetups btx:apa:booklet
+% \texdefinition{btx:apa:author-or-key-and-year}
+% \texdefinition{btx:apa:title-it-and-series}
+% \texdefinition{btx:apa:edition:sentence}
+% \texdefinition{btx:apa:publication:sentence}
+% \texdefinition{btx:apa:pages:p}
+% \texdefinition{btx:apa:note}
+%\stopsetups
+%
+%\startsetups btx:apa:manual
+% \texdefinition{btx:apa:author-or-key-and-year}
+% \texdefinition{btx:apa:title-it-and-series}
+% \texdefinition{btx:apa:edition:sentence}
+% \texdefinition{btx:apa:wherefrom}{organization}
+% \texdefinition{btx:apa:pages:p}
+% \texdefinition{btx:apa:note}
+%\stopsetups
+%
%\startsetups btx:apa:incollection
% \texdefinition{btx:apa:author-and-year}
% \btxdoifelse {arttitle} {
@@ -1273,7 +1473,7 @@
% }
% \texdefinition{btx:apa:note}
%\stopsetups
-
+%
%\startsetups btx:apa:inproceedings
% \texdefinition{btx:apa:author-and-year}
% \btxdoif {arttitle} {
@@ -1333,7 +1533,7 @@
% }
% \texdefinition{btx:apa:note}
%\stopsetups
-
+%
%\startsetups btx:apa:proceedings
% \texdefinition{btx:apa:editor-or-key-and-year}
% \btxdoif {title} {
@@ -1359,7 +1559,7 @@
% }
% \texdefinition{btx:apa:note}
%\stopsetups
-
+%
%\starttexdefinition btx:apa:thesis
% \texdefinition{btx:apa:author-and-year}
% \texdefinition{btx:apa:title-it-and-series}
@@ -1380,95 +1580,42 @@
%\startsetups btx:apa:phdthesis
% \texdefinition{btx:apa:thesis}
%\stopsetups
-
-% A report published by a school or other institution, usually numbered within a series.
-% Required fields: author, title, institution, year.
-% Optional fields: type, number, address, month, note.
-
-\startsetups btx:apa:techreport
- \texdefinition{btx:apa:author-and-year}
- \texdefinition{btx:apa:title-and-series}
- \btxdoifelse {type} {
- \btxflush{type}
- \btxdoif {volume} {
- \btxspace
- \btxflush{volume}
- }
- } {
- \btxspace
- \btxlabeltext{apa:technicalreport}
- }
- \btxcomma
- \texdefinition{btx:apa:wherefrom}{institution}
- \texdefinition{btx:apa:pages:p}
- \texdefinition{btx:apa:url-note-doi}
-\stopsetups
-
-\startsetups btx:apa:patent
- \texdefinition{btx:apa:author-and-year}
- \btxdoif {title} {
- \btxspace
- %texdefinition{btx:apa:italic}{converters.Word -> title}
- \texdefinition{btx:apa:italic}{Word -> title}
- }
- \btxdoif {nationality} {
- \btxspace
- \btxflush{nationality}
- }
- \btxspace
- \btxlabeltext{apa:patent}
- \btxdoif {number} {
- \btxspace
- \btxflush{number}
- }
- \texdefinition{btx:apa:wherefrom}{publisher}
- \texdefinition{btx:apa:note}
-\stopsetups
-
-% Use this type when nothing else fits.
-% Required fields: none.
-% Optional fields: author, title, howpublished, month, year, note.
-
-\startsetups btx:apa:misc
- \texdefinition{btx:apa:author-and-year}
- \texdefinition{btx:apa:title-and-series}
- \texdefinition{btx:apa:wherefrom}{publisher}
- \texdefinition{btx:apa:pages:p}
- \texdefinition{btx:apa:note}
-\stopsetups
-
-% A document having an author and title, but not formally published.
-% Required fields: author, title, note.
-% Optional fields: month, year.
-
-\startsetups btx:apa:unpublished
- \texdefinition{btx:apa:author-and-year}
- \texdefinition{btx:apa:title-and-series}
- \texdefinition{btx:apa:pages:p}
- \btxdoif {type} {
- \btxleftparenthesis
- \btxflush{type}
- \btxrightparenthesis
- }
- \texdefinition{btx:apa:note}
-\stopsetups
-
-% If all else fails to match:
-
-\startsetups btx:apa:literal
- \btxdoif {text} {
- \btxflush{text}
- }
-\stopsetups
-
-%D Experiment:
-
-\startsetups btx:apa:lefttext
- \currentbtxlefttext
-\stopsetups
-
-\startsetups btx:apa:righttext
- \currentbtxrighttext
-\stopsetups
-
-\stopbtxrenderingdefinitions
+%
+%\startsetups btx:apa:techreport
+% \texdefinition{btx:apa:author-and-year}
+% \texdefinition{btx:apa:title-and-series}
+% \btxdoifelse {type} {
+% \btxflush{type}
+% \btxdoif {volume} {
+% \btxspace
+% \btxflush{volume}
+% }
+% } {
+% \btxspace
+% \btxlabeltext{apa:technicalreport}
+% }
+% \btxcomma
+% \texdefinition{btx:apa:wherefrom}{institution}
+% \texdefinition{btx:apa:pages:p}
+% \texdefinition{btx:apa:url-note-doi}
+%\stopsetups
+%
+%\startsetups btx:apa:misc
+% \texdefinition{btx:apa:author-and-year}
+% \texdefinition{btx:apa:title-and-series}
+% \texdefinition{btx:apa:wherefrom}{publisher}
+% \texdefinition{btx:apa:pages:p}
+% \texdefinition{btx:apa:note}
+%\stopsetups
+%
+%\startsetups btx:apa:unpublished
+% \texdefinition{btx:apa:author-and-year}
+% \texdefinition{btx:apa:title-and-series}
+% \texdefinition{btx:apa:pages:p}
+% \btxdoif {type} {
+% \btxleftparenthesis
+% \btxflush{type}
+% \btxrightparenthesis
+% }
+% \texdefinition{btx:apa:note}
+%\stopsetups