diff options
Diffstat (limited to 'tex/context/base/mkiv/publ-imp-apa.mkvi')
-rw-r--r-- | tex/context/base/mkiv/publ-imp-apa.mkvi | 337 |
1 files changed, 179 insertions, 158 deletions
diff --git a/tex/context/base/mkiv/publ-imp-apa.mkvi b/tex/context/base/mkiv/publ-imp-apa.mkvi index 5600b5722..182802331 100644 --- a/tex/context/base/mkiv/publ-imp-apa.mkvi +++ b/tex/context/base/mkiv/publ-imp-apa.mkvi @@ -33,9 +33,13 @@ [apa] [\c!default=default, \c!specification=apa, - \c!otherstext={\btxspace\btxlabeltext{apa:others}}, + \c!otherstext={\btxspace\btxlabeltext{others}}, %c!journalconversion=\v!normal, - \c!monthconversion=\v!month] + \c!monthconversion=\v!month, + \c!stopper:initials={. }, % with a (breakable) space + \c!separator:names:2={\btxcomma}, % aka namesep - in this namespace + \c!separator:names:3={\btxcomma\btxnobreakspace\textampersand\space}, % comma separated list + \c!separator:names:4={\btxnobreakspace\textampersand\space}] % last of two, no comma! % First, define list and rendering parameters @@ -50,6 +54,7 @@ \setupbtxlist [apa] [\c!alternative=\v!paragraph, + \c!align={normal,verytolerant,stretch}, %\c!width=\v!fit, %\c!distance=.5\emwidth, \c!margin=3.5\emwidth] @@ -61,10 +66,7 @@ \c!etallimit=7, \c!etaldisplay=6, \c!etaloption=last, - \c!authorconversion=invertedshort, - \c!separator:names:2={\btxcomma}, % aka namesep - in this namespace - \c!separator:names:3={\btxcomma\btxnobreakspace\textampersand\space}, % comma separated list - \c!separator:names:4={\btxnobreakspace\textampersand\space}] % last of two, no comma! + \c!authorconversion=invertedshort] % First, we define a namespace for a few special fields @@ -81,11 +83,24 @@ [apa:\s!list:author] \definebtx + [apa:\s!list:ineditor] + [apa:\s!list:editor] + [\c!authorconversion=normalshort] + +\definebtx [apa:\s!list:translator] [apa:\s!list:author] [\c!authorconversion=normalshort] \definebtx + [apa:\s!list:director] + [apa:\s!list:author] + +\definebtx + [apa:\s!list:producer] + [apa:\s!list:author] + +\definebtx [apa:\s!list:suffix] [apa:\s!list] @@ -101,8 +116,8 @@ [apa:\s!list:\s!page] [apa:\s!list] [\c!separator:2={\btxcomma}, - \c!separator:3={\btxcomma\btxlabeltext{apa:and}\space}, - \c!separator:4={\btxspace\btxlabeltext{apa:and}\space}, + \c!separator:3={\btxcomma\btxlabeltext{and}\space}, + \c!separator:4={\btxspace\btxlabeltext{and}\space}, \c!left={\btxleftparenthesis}, \c!right={\btxrightparenthesis}, \c!command={\wordright}] @@ -186,8 +201,17 @@ [apa:\s!list:title] \definebtx + [apa:\s!list:booktitle:inbook] + [apa:\s!list:title] + +\definebtx [apa:\s!list:title:inbook] [apa:\s!list:title] + [\c!style=] % booktitle is set in italics + +\definebtx + [apa:\s!list:booktitle:incollection] + [apa:\s!list:title] \definebtx [apa:\s!list:title:incollection] @@ -199,11 +223,19 @@ [apa:\s!list:title] \definebtx + [apa:\s!list:booktitle:inproceedings] + [apa:\s!list:title] + +\definebtx [apa:\s!list:title:inproceedings] [apa:\s!list:title] [\c!style=] % booktitle is set in italics \definebtx + [apa:\s!list:booktitle:conference] + [apa:\s!list:title] + +\definebtx [apa:\s!list:title:conference] [apa:\s!list:title] [\c!style=] % booktitle is set in italics @@ -274,15 +306,14 @@ [apa:\s!cite] [apa] [\c!alternative=authoryear, - \c!otherstext={\btxcomma\btxlabeltext{apa:others}}, + \c!otherstext={\btxcomma\btxlabeltext{others}}, \c!etallimit=5, \c!etaldisplay=1, % TODO: when 2-4, show all first time, etaldisplay subsequently... \c!authorconversion=\v!name, \c!sorttype=normal, \c!compress=\v!yes, % note that cite sorts only work with compress=yes. - \c!separator:names:2={\btxcomma}, - \c!separator:names:3={\btxcomma\btxlabeltext{apa:and}\space}, % not \textampersand - \c!separator:names:4={\btxspace\btxlabeltext{apa:and}\space}] % not \textampersand + \c!separator:names:3={\btxcomma\btxlabeltext{and}\space}, % not \textampersand + \c!separator:names:4={\btxspace\btxlabeltext{and}\space}] % not \textampersand \definebtx [apa:\s!cite:name] @@ -318,7 +349,9 @@ [apa:\s!cite:author] [\c!left={(}, \c!right={)}, - \c!inbetween={\btxcomma}] + \c!inbetween={\btxcomma}, + \c!separator:names:3={\btxcomma\textampersand\space}, + \c!separator:names:4={\btxspace\textampersand\space}] \definebtx [apa:\s!cite:default] @@ -326,8 +359,8 @@ \definebtx [apa:\s!cite:authoryears] - [apa:\s!cite:authoryear] - [\c!left=, + [apa:\s!cite:author] + [\c!left=, % these two settings are perhaps redundant? \c!right=, \c!inbetween={\btxspace}] @@ -335,7 +368,9 @@ [apa:\s!cite:authornum] [apa:\s!cite:author] [\c!left={(}, - \c!right={)}] + \c!right={)}, + \c!separator:names:3={\btxcomma\textampersand\space}, + \c!separator:names:4={\btxspace\textampersand\space}] \definebtx [apa:\s!cite:author:num] % todo @@ -355,18 +390,30 @@ \c!right={)}] \definebtx + [apa:\s!cite:lefttext] + [apa:\s!cite] + [\c!left=, + \c!right={\btxspace}] + +\definebtx + [apa:\s!cite:righttext] + [apa:\s!cite] + [\c!left={\btxcomma}, + \c!right=] + +\definebtx [apa:\s!cite:year] [apa:\s!cite] [\c!separator:2={\btxcomma}, % :0 and :1 - between items of a list - \c!separator:3={\btxcomma\btxlabeltext{apa:and}\space}, % not \textampersand - \c!separator:4={\btxspace\btxlabeltext{apa:and}\space}] % not \textampersand + \c!separator:3={\btxcomma\btxlabeltext{and}\space}, % not \textampersand + \c!separator:4={\btxspace\btxlabeltext{and}\space}] % not \textampersand \definebtx [apa:\s!cite:title] [apa:\s!cite] [\c!separator:2={\btxcomma}, % :0 and :1 - between items of a list - \c!separator:3={\btxcomma\btxlabeltext{apa:and}\space}, % not \textampersand - \c!separator:4={\btxspace\btxlabeltext{apa:and}\space}, % not \textampersand + \c!separator:3={\btxcomma\btxlabeltext{and}\space}, % not \textampersand + \c!separator:4={\btxspace\btxlabeltext{and}\space}, % not \textampersand \c!command={\language[\currentbtxlanguage]}, % BAH \c!sorttype=none, \c!style=\v!italic] @@ -394,8 +441,8 @@ [\c!left=, \c!right=, \c!separator:2={\btxcomma}, % :0 and :1 - between items of a list - \c!separator:3={\btxcomma\btxlabeltext{apa:and}\space}, % not \textampersand - \c!separator:4={\btxspace\btxlabeltext{apa:and}\space}] % not \textampersand + \c!separator:3={\btxcomma\btxlabeltext{and}\space}, % not \textampersand + \c!separator:4={\btxspace\btxlabeltext{and}\space}] % not \textampersand \definebtx [apa:\s!cite:pages] @@ -418,8 +465,8 @@ \definebtx [apa:\s!cite:url] [apa:\s!cite] - [\c!left={[}, - \c!right={]}] + [\c!left={(}, + \c!right={)}] \definebtx [apa:\s!cite:doi] @@ -440,8 +487,8 @@ [\c!left={Ref.\nbsp}, \c!right=, \c!separator:2={\btxcomma}, - \c!separator:3={\btxspace\btxlabeltext{apa:and}\space}, - \c!separator:4={\btxspace\btxlabeltext{apa:and}\space}] + \c!separator:3={\btxspace\btxlabeltext{and}\space}, + \c!separator:4={\btxspace\btxlabeltext{and}\space}] \definebtx [apa:\s!cite:entry] @@ -463,24 +510,17 @@ \setupbtxlabeltext [en] - [apa:and=and, - apa:number={no.}, + [apa:number={No.}, apa:edition={ed.}, apa:Editor={Ed.}, apa:Editors={Eds.}, apa:Volume={Vol.}, apa:Volumes={Vols.}, - apa:others={et al.}, - apa:with=with, - apa:page={p.}, - apa:pages={pp.}, apa:nd={n.d.}, % no date - apa:mastersthesis={Master's thesis}, - apa:phdthesis={Doctoral dissertation}, - apa:technicalreport={Tech. Rep.}, % Technical report apa:supplement={Suppl.}, % Supplement (not used?) - apa:patent=Patent, apa:MotionPicture={Motion picture}, + apa:Writer=Writer, + apa:Writers=Writers, apa:Producer=Producer, apa:Producers=Producers, apa:Director=Director, @@ -489,29 +529,21 @@ apa:Author=Author, apa:Translator={Trans.}, % Translator(s) apa:Advanced={Advanced online publication}, - apa:Retrieved={Available from}, % {Retrieved from}, - apa:In=In] + apa:Retrieved={Retrieved from}] % {Available from}] \setupbtxlabeltext [nl] - [apa:and=en, - apa:number={nr.}, + [apa:number={Nr.}, apa:edition={ed.}, % editie apa:Editor=Editor, % Ed./Eds. apa:Editors=Editors, apa:Volume={Vol.}, apa:Volumes={Vols.}, - apa:others={et al.}, - apa:with=met, - apa:page={p.}, - apa:pages={pp.}, apa:nd={g.d.} % geen datum - apa:mastersthesis=Masterproef, - apa:phdthesis=Proefschrift, - apa:technicalreport={Technisch rapport}, % Technical report apa:supplement=Supplement, - apa:patent=Octrooi, apa:MotionPicture=Film, % ? + apa:Writer=Scenarioschrijver, % ? + apa:Writers=Schrijvers, % ? apa:Producer=Producent, % ? apa:Producers=Producents, % ? apa:Director=Directeur, @@ -520,29 +552,21 @@ apa:Author=Auteur, apa:Translator=Vertaler, apa:Advanced={Geavanceerde online publicatie}, - apa:Retrieved={Beschikbaar vanaf}, % {Ontvangen van}, - apa:In=In] + apa:Retrieved={Ontvangen van}] % {Beschikbaar vanaf}] \setupbtxlabeltext [fr] - [apa:and=et, - apa:number={n\high{o}}, + [apa:number={N\high{o}}, apa:edition={édition}, apa:Editor=Éditeur, apa:Editors=Éditeurs, apa:Volume=Volume, apa:Volumes=Volumes, - apa:others={et al.}, - apa:with=avec, - apa:page={p.}, - apa:pages={pp.}, apa:nd={s.d.} % sans date - apa:mastersthesis={Thèse de master (DEA, DESS, master)}, - apa:phdthesis={Thèse de doctorat}, - apa:technicalreport={Rapport technique}, apa:supplement=Supplément, - apa:patent=Brevet, apa:MotionPicture={Film cinématographique}, + apa:Writer=Scénariste, + apa:Writers=Scénaristes, apa:Producer=Producteur, apa:Producers=Producteurs, apa:Director=Réalisateur, @@ -551,29 +575,21 @@ apa:Author=Auteur, apa:Translator=Traducteur, apa:Advanced={Publication en ligne anticipée}, - apa:Retrieved={Disponible à}, % {Téléchargé de}, - apa:In=Dans] + apa:Retrieved={Téléchargé de}] % {Disponible à}] \setupbtxlabeltext [de] - [apa:and=und, - apa:number={nr.}, + [apa:number={Nr.}, apa:edition=Auf\/lage, apa:Editor=Herausgeber, % Hrsg./Hg. apa:Editors=Herausgeber, apa:Volume=Band, % Bd. apa:Volumes={Bände}, - apa:others={et al.}, - apa:with=mit, - apa:page={S.}, - apa:pages={S.}, apa:nd={o.D.}, % ohne Datum (mostly: o.J. / ohne Jahr) - apa:mastersthesis={Masterarbeit}, - apa:phdthesis={Dissertation}, - apa:technicalreport={Technischer Bericht}, apa:supplement={Beilage}, % Supplement - apa:patent=Patent, apa:MotionPicture=Kinofilm, % ? + apa:Writer=Drehbuchautor, % ? + apa:Writers=Schriftsteller, % ? apa:Producer=Producer, % ? apa:Producers=Produzenten, % ? apa:Director=Director, % ? @@ -582,31 +598,23 @@ apa:Author=Autor, apa:Translator={Übersetzer}, % Übers. apa:Advanced={Erweiterte Online-Publikation}, - apa:Retrieved={heruntergeladen von}, - apa:In=In] + apa:Retrieved={heruntergeladen von}] % thanks: Andrea Valle \setupbtxlabeltext [it] - [apa:and=e, - apa:number={nº}, + [apa:number={Nº}, apa:edition={ed.}, % edizione apa:Editor={A cura di}, apa:Editors={A cura di}, apa:Volume={Vol.}, % Volume apa:Volumes={Vol.}, % Volumi - apa:others={et al.}, - apa:with=con, - apa:page={p.}, - apa:pages={pp.}, apa:nd={s.d.}, % senza data - apa:mastersthesis={Tesi di laurea}, - apa:phdthesis={Tesi di dottorato}, - apa:technicalreport={Relazione tecnica}, apa:supplement={Supplemento}, - apa:patent=Brevetto, apa:MotionPicture=Film, % ? + apa:Writer=Sceneggiatore, % ? + apa:Writers=Scrittori, % ? apa:Producer=Produttore, apa:Producers=Produttori, apa:Director=Direttore, @@ -615,29 +623,21 @@ apa:Author=Autore, apa:Translator={Trad.}, % Translator(s) apa:Advanced={Pre-pubblicazione on line}, - apa:Retrieved={Accessible online}, - apa:In=In] + apa:Retrieved={Accessible online}] \setupbtxlabeltext [es] - [apa:and=y, - apa:number={nº}, + [apa:number={Nº}, apa:edition={ed.}, % edición apa:Editor=Editor, % Ed./Eds. apa:Editors=Editores, apa:Volume={Vol.}, % Volumen apa:Volumes={Vols.}, % Volúmenes - apa:others={et al.}, - apa:with=con, - apa:page={p.}, - apa:pages={pp.}, apa:nd={s.f.}, % sin fecha - apa:mastersthesis={Tesis de maestría}, - apa:phdthesis={Tesis doctoral}, - apa:technicalreport={Informe técnico}, apa:supplement=Suplemento, - apa:patent=Patente, apa:MotionPicture=Cinematográfica, + apa:Writer=Guionista, % ? + apa:Writers=Escritores, % ? apa:Producer=Productor, apa:Producers=Productores, apa:Director=Director, @@ -646,49 +646,33 @@ apa:Author=Autor, apa:Translator=Traductor, apa:Advanced={Publicación en línea avanzada}, - apa:Retrieved={Disponible desde}, % {Obtenido de}, - apa:In=En] + apa:Retrieved={Obtenido de}] % {Disponible desde}] % cite setups % The following differs from the default returning n.d. if year is empty -\startsetups btx:apa:nd - \btxlabeltext{apa:nd} -\stopsetups - \startsetups btx:apa:cite:author:year - \texdefinition{\s!btx:\s!cite:concat} - %\btxparameter\c!left \ifx\currentbtxfirst\empty - \fastsetup{btx:apa:nd} - \else - \texdefinition {\s!btx:\s!cite:inject} { - \btxcitereference - \currentbtxfirst - } - \ifx\currentbtxsecond\empty \else - \btxparameter\c!range - \texdefinition {\s!btx:\s!cite:inject} { - \currentbtxsecond - } - \fi - \btxflushsuffix + \def\currentbtxfirst{\fastsetup{\s!btx:apa:nd}} \fi - %\btxparameter\c!right + \fastsetup{\s!btx:\s!cite:author:year} \stopsetups \startsetups btx:apa:cite:author:years - \fastsetup{btx:apa:cite:author:year} + \ifx\currentbtxfirst\empty + \def\currentbtxfirst{\fastsetup{\s!btx:apa:nd}} + \fi + \fastsetup{\s!btx:\s!cite:author:years} \stopsetups % used in publ-imp-page.mkvi \startsetups [btx:apa:list:page-or-pages] \ifx\currentbtxlastpage\empty - \btxlabeltext{apa:page} + \btxlabeltext{p} \else - \btxlabeltext{apa:pages} + \btxlabeltext{pp} \fi \btxnbsp \stopsetups @@ -756,7 +740,7 @@ \begingroup \language[\mainbtxlanguage] \btxleftbracket - \btxusecommand [apa:\s!list:title:\currentbtxcategory] { + \btxusecommand [apa:\s!list:#title:\currentbtxcategory] { \btxflush{#title:\mainbtxlanguage} } \btxrightbracket @@ -766,10 +750,10 @@ \stoptexdefinition \starttexdefinition unexpanded btx:apa:composed-title #title - \btxstartstyleandcolor[apa:\s!list:title:\currentbtxcategory] + \btxstartstyleandcolor[apa:\s!list:#title:\currentbtxcategory] \begingroup \language[\currentbtxlanguage] - \btxusecommand [apa:\s!list:title:\currentbtxcategory] { + \btxusecommand [apa:\s!list:#title:\currentbtxcategory] { \btxflush{#title} \btxdoif {sub#title} { \btxcolon @@ -797,6 +781,22 @@ \texdefinition{btx:apa:composed-title}{title} } \btxdoif {title} { + % A book might have an editor AND an author + \doif {\currentbtxcategory} {book} { + \doifnot {\btxfoundname{author}} {editor} { + \btxdoif {ineditor} { % ineditor authorconversion + \btxleftparenthesis + \btxflush{ineditor} + \btxcomma + \btxsingularorplural {ineditor} { + \btxlabeltext{apa:Editor} + } { + \btxlabeltext{apa:Editors} + } + \btxrightparenthesis + } + } + } \btxdoif {translator} { \btxleftparenthesis \btxflush{translator} @@ -820,6 +820,10 @@ } \stoptexdefinition +\startsetups btx:apa:nd + \btxlabeltext{apa:nd} +\stopsetups + \starttexdefinition unexpanded btx:apa:suffixedyear \btxdoifelse {year} { \btxflush{year} @@ -838,8 +842,9 @@ % #author may be author(set) or editor \starttexdefinition unexpanded btx:apa:author-or-editor #author - \btxdoif {#author} { + \btxdoifelse {#author} { \btxflush{#author} + % use \processaction [] [] here? \doifelse {\btxfoundname{#author}} {editor} { \btxleftparenthesis \btxsingularorplural {editor} { @@ -848,16 +853,40 @@ \btxlabeltext{apa:Editors} } \btxrightparenthesis - } { - \doifelse {\btxfoundname{#author}} {producer} { - \btxleftparenthesis - \btxsingularorplural {producer} { - \btxlabeltext{apa:Producer} + } {\doif {\btxfoundname{#author}} {ineditor} { + \btxleftparenthesis + \btxsingularorplural {ineditor} { + \btxlabeltext{apa:Editor} + } { + \btxlabeltext{apa:Editors} + } + \btxrightparenthesis + } } + \doif {\currentbtxcategory} {film} { + \btxleftparenthesis + \doifelse {\btxfoundname{#author}} {director} { + \btxsingularorplural {director} { + \btxlabeltext{apa:Director} } { - \btxlabeltext{apa:Producers} + \btxlabeltext{apa:Directors} + } + } { + \doif {\btxfoundname{#author}} {author} { + \btxsingularorplural {author} { + \btxlabeltext{apa:Writer} + } { + \btxlabeltext{apa:Writers} + } + } + \doif {\btxfoundname{#author}} {producer} { + \btxsingularorplural {producer} { + \btxlabeltext{apa:Producer} + } { + \btxlabeltext{apa:Producers} + } } - \btxrightparenthesis \btxdoif {director} { + \btxrightparenthesis \removeunwantedspaces \btxparameter{\c!separator:names:3} \btxflush{director} @@ -867,27 +896,19 @@ } { \btxlabeltext{apa:Directors} } - \btxrightparenthesis - } - } { - \doif {\btxfoundname{#author}} {director} { - \btxleftparenthesis - \btxsingularorplural {director} { - \btxlabeltext{apa:Director} - } { - \btxlabeltext{apa:Directors} - } - \btxrightparenthesis } } + \btxrightparenthesis } \btxdoif {withauthor} { \btxleftparenthesis - \btxlabeltext{apa:with} + \btxlabeltext{with} \btxspace \btxflush{withauthor} \btxrightparenthesis } + } { + \texdefinition{btx:apa:title} } \stoptexdefinition @@ -918,10 +939,10 @@ \starttexdefinition unexpanded btx:apa:editor-in \btxdoif {booktitle} { - \btxlabeltext{apa:In} + \btxlabeltext{In} \doifnot {\btxfoundname{author}} {editor} { \btxspace - \texdefinition{btx:apa:author-or-editor} {editor} + \texdefinition{btx:apa:author-or-editor} {ineditor} } \btxspace \texdefinition{btx:apa:composed-title}{booktitle} @@ -950,7 +971,7 @@ \btxflush{type} } } { - \btxlabeltext{apa:technicalreport} + \btxlabeltext{technicalreport} } } \btxdoif {volume} { @@ -978,9 +999,9 @@ \btxdoif {pages} { \texdefinition{btx:apa:leftparenthesis-or-comma} \btxoneorrange {pages} { - \btxlabeltext{apa:page} + \btxlabeltext{p} } { - \btxlabeltext{apa:pages} + \btxlabeltext{pp} } \btxnbsp \btxflush{pages} @@ -1030,9 +1051,9 @@ \btxcomma \doif {\currentbtxcategory} {newspaper} { \btxoneorrange {pages} { - \btxlabeltext{apa:page} + \btxlabeltext{p} } { - \btxlabeltext{apa:pages} + \btxlabeltext{pp} } \btxnbsp } @@ -1090,9 +1111,6 @@ % use \btxentry here? \starttexdefinition unexpanded btx:apa:url - \btxspace - \btxlabeltext{apa:Retrieved} - \btxspace \begingroup \setbreakpoints[doi] \ifconditional\btxinteractive @@ -1110,7 +1128,6 @@ % use \btxentry here? \starttexdefinition unexpanded btx:apa:doi - \btxspace \begingroup \setbreakpoints[doi] \ifconditional\btxinteractive @@ -1135,9 +1152,13 @@ \starttexdefinition unexpanded btx:apa:url-doi-note \doif {\btxfoundname{doi}} {url} { + \btxspace + \btxlabeltext{apa:Retrieved} + \btxspace \texdefinition{btx:apa:url} } \doif {\btxfoundname{doi}} {doi} { + \btxspace \texdefinition{btx:apa:doi} } \texdefinition{btx:apa:note} @@ -1285,7 +1306,7 @@ \btxflush{type} } } { - \btxlabeltext{apa:\currentbtxcategory} + \btxlabeltext{\currentbtxcategory} } \btxrightparenthesis \btxdoif {school} { @@ -1365,7 +1386,7 @@ \btxflush{nationality} } \btxspace - \btxlabeltext{apa:patent} + \btxlabeltext{patent} \btxdoif {number} { \btxspace \btxlabeltext{apa:number} @@ -1439,7 +1460,7 @@ } \doifnot {\btxfoundname{title}} {album} { \btxdoif {album} { - \btxlabeltext{apa:In} + \btxlabeltext{In} \btxspace \btxflush{album} \btxperiod |