summaryrefslogtreecommitdiff
path: root/tex/context/base/publ-imp-apa.mkvi
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/publ-imp-apa.mkvi')
-rw-r--r--tex/context/base/publ-imp-apa.mkvi216
1 files changed, 84 insertions, 132 deletions
diff --git a/tex/context/base/publ-imp-apa.mkvi b/tex/context/base/publ-imp-apa.mkvi
index 256636325..87a9c522b 100644
--- a/tex/context/base/publ-imp-apa.mkvi
+++ b/tex/context/base/publ-imp-apa.mkvi
@@ -29,12 +29,6 @@
% The APA style sorts the unnumbered rendered list by authoryear
-% Hans: should we be using or not using \c!, \s! and \v! ??
-
-% Sure: not using \c! and v! would mean that only the english interface is
-% supported and \s! saves some bytes (only within the setups). I'll deal with
-% that in the end.
-
\definebtxrendering
[apa]
[\c!specification=apa,
@@ -48,55 +42,14 @@
\c!distance=.5\emwidth,
\c!margin=3\emwidth]
-% The sameauthor feature may not be APA compliant
-% (there is nothing in the manual cited above).
-% It can be removed using the command:
-% \resetsetups [apa:list:sameauthor]
-
-% Or texdefinition?
-
-\startsetups [apa:list:sameauthor]
- \fastsetup{apa:list:sameauthor:rule}
-\stopsetups
-
-\startsetups [apa:list:sameauthor:rule]
- \blackrule
- [\c!width=\dimexpr\listparameter\c!margin-\interwordspace\relax,
- \c!height=1.5\linewidth]% are you sure you want to inconsistent with the rest? happens nowhere!
-\stopsetups
-
-\startsetups [apa:list:sameauthor:\v!empty]% it's not a space
- \kern\dimexpr\listparameter\c!margin-\interwordspace\relax
-\stopsetups
-
-\startsetups [apa:list:sameauthor:ditto] % horrible !
- \inframed
- [\c!width=\dimexpr\listparameter\c!margin-\interwordspace\relax,
- \c!frame=\v!off,
- \c!align=\v!middle]
- {\doubleprime}
-\stopsetups
-
% set ALL specific APA compliant values
-% Note that fallback is apa, default, then root
\definebtx
[apa]
- [\c!default=, % no fallback on default rendering
- \c!namesep={,\space},
- \c!lastnamesep={,\nobreakspace\textampersand\space}, % comma separated list
- \c!finalnamesep={\nobreakspace\textampersand\space}, % last of two, no comma!
- \c!firstnamesep=\space,
+ [\c!default=default,
\c!otherstext={\space\btxlabeltext{apa:others}},
- \c!juniorsep={\space},
- \c!vonsep={\space},
- \c!initialsep={\space},
- \c!surnamesep={,\space},
- \c!surnameinitialsep={,\space},
- \c!surnamefirstnamesep={,\space},
- \c!pubsep={,\space},
- \c!lastpubsep={,\space\btxlabeltext{apa:and}\space},% not btxcomma?
- \c!finalpubsep={\space\btxlabeltext{apa:and}\space}]
+ %c!journalconversion=\v!normal,
+ \c!monthconversion=\v!month]
\definebtx
[apa:list]
@@ -104,9 +57,10 @@
[\c!otherstext={,\nobreakspace\textellipsis\space},
\c!etallimit=7,
\c!etaldisplay=6,
- %c!journalconversion=\v!normal,
- \c!monthconversion=\v!month,
- \c!authorconversion=invertedshort]
+ \c!authorconversion=invertedshort,
+ \c!separator:names:2={,\space}, % aka namesep - in this namespace
+ \c!separator:names:3={,\nobreakspace\textampersand\space}, % comma separated list
+ \c!separator:names:4= {\nobreakspace\textampersand\space}] % last of two, no comma!
% The following are similar to default, but inherit from apa:list
@@ -282,18 +236,13 @@
\c!etaldisplay=1, % TODO: when 2-4, show all first time, etaldisplay subsequently...
\c!authorconversion=\v!name,
\c!sorttype=authoryear,
- \c!compress=\v!no,
- \c!inbetween=\space,
- \c!range=\endash,
- \c!left=,
- \c!middle=,
- \c!right=]
+ \c!separator:names:2={,\space},
+ \c!separator:names:3={,\space\btxlabeltext{apa:and}\space}, % not \textampersand
+ \c!separator:names:4= {\space\btxlabeltext{apa:and}\space}] % not \textampersand
\definebtx
[apa:cite:author]
[apa:cite]
- [\c!lastnamesep={,\space\btxlabeltext{apa:and}\space}, % not \textampersand
- \c!finalnamesep={\space\btxlabeltext{apa:and}\space}] % not \textampersand
% The following are similar to default, but inherit from apa:cite
@@ -303,20 +252,18 @@
[\c!compress=\v!yes,
\c!left={(},
\c!right={)},
- \c!inbetween={,\space},
- \c!pubsep={;\space},
- \c!lastpubsep={;\space},
- \c!finalpubsep={;\space}]
+ \c!inbetween={,\space}]
+
+\definebtx
+ [apa:cite:default]
+ [apa:cite:authoryear]
\definebtx
[apa:cite:authoryears]
[apa:cite:authoryear]
[\c!left=,
\c!right=,
- \c!inbetween={\space},
- \c!pubsep={;\space},
- \c!lastpubsep={;\space},
- \c!finalpubsep={;\space}]
+ \c!inbetween={\space}]
\definebtx
[apa:cite:authornum]
@@ -351,18 +298,18 @@
\definebtx
[apa:cite:year]
[apa:cite]
- [\c!pubsep={,\space},
- \c!lastpubsep={,\space\btxlabeltext{apa:and}\space}, % not \textampersand
- \c!finalpubsep={\space\btxlabeltext{apa:and}\space}, % not \textampersand
+ [\c!separator:2={,\space}, % :0 and :1 - between items of a list
+ \c!separator:3={,\space\btxlabeltext{apa:and}\space}, % not \textampersand
+ \c!separator:4= {\space\btxlabeltext{apa:and}\space}, % not \textampersand
\c!compress=\v!yes,
\c!sorttype=\v!default]
\definebtx
[apa:cite:title]
[apa:cite]
- [\c!pubsep={,\space},
- \c!lastpubsep={,\space\btxlabeltext{apa:and}\space}, % not \textampersand
- \c!finalpubsep={\space\btxlabeltext{apa:and}\space}, % not \textampersand
+ [\c!separator:2={,\space}, % :0 and :1 - between items of a list
+ \c!separator:3={,\space\btxlabeltext{apa:and}\space}, % not \textampersand
+ \c!separator:4= {\space\btxlabeltext{apa:and}\space}, % not \textampersand
\c!command={\language[\currentbtxlanguage]}, % BAH
\c!style=\v!italic]
@@ -391,9 +338,9 @@
[apa:cite]
[\c!left=,
\c!right=,
- \c!pubsep={,\space},
- \c!lastpubsep={,\space\btxlabeltext{apa:and}\space}, % not \textampersand
- \c!finalpubsep={\space\btxlabeltext{apa:and}\space}] % not \textampersand
+ [\c!separator:2={,\space}, % :0 and :1 - between items of a list
+ \c!separator:3={,\space\btxlabeltext{apa:and}\space}, % not \textampersand
+ \c!separator:4= {\space\btxlabeltext{apa:and}\space}] % not \textampersand
\definebtx
[apa:cite:pages]
@@ -441,18 +388,28 @@
[\c!compress=\v!yes,
\c!left={[},
\c!right={]},
- \c!pubsep={,},
- \c!lastpubsep={,},
- \c!finalpubsep={,}]
+ \c!separator:2={,}, % no space
+ \c!separator:3=\btxparameter{\c!separator:2},
+ \c!separator:4=\btxparameter{\c!separator:2}]
\definebtx
[apa:cite:textnum]
[apa:cite:num]
[\c!left={Ref.\nbsp},
\c!right=,
- \c!pubsep={,},
- \c!lastpubsep={\space\btxlabeltext{apa:and}\space},
- \c!finalpubsep={\space\btxlabeltext{apa:and}\space}]
+ \c!separator:2={,\space},
+ \c!separator:3={\space\btxlabeltext{apa:and}\space},
+ \c!separator:4={\space\btxlabeltext{apa:and}\space}]
+
+\definebtx
+ [apa:cite:entry]
+ [apa:cite]
+ [\c!left=,
+ \c!right=,
+ \c!inbetween={\space},
+ \c!separator:2={;\space},
+ \c!separator:3=\btxparameter{\c!separator:2},
+ \c!separator:4=\btxparameter{\c!separator:2}]
%D Sometimes we have verbose injections in an entry and these can be language
%D dependent, so we use labels.
@@ -476,10 +433,10 @@
apa:mastersthesis={Master's thesis},
apa:phdthesis={Doctoral dissertation},
apa:technicalreport={Tech. Rep.}, % Technical report
- apa:supplement={Suppl.}, % Supplement
+ apa:supplement={Suppl.}, % Supplement (not used?)
apa:patent=Patent,
apa:Author=Author,
- apa:Translator={Trans.}, % Translator(s)
+ apa:Translator={Trans.}, % Translator(s) (not used?)
apa:Advanced={Advanced online publication},
apa:Retrieved={Available from}, % {Retrieved from},
apa:In=In]
@@ -611,46 +568,6 @@
% cite setups
-% as we don't fallback on default (no sane person will render the titles
-% differently so it's a bit over the top):
-
-\startsetups btx:apa:cite:empty
- \fastsetup{\s!btx:\s!cite:\s!empty}
-\stopsetups
-\startsetups btx:apa:cite:unknown
- \fastsetup{\s!btx:\s!cite:\s!unknown}
-\stopsetups
-\startsetups btx:apa:cite:author
- \fastsetup{\s!btx:\s!cite:author}
-\stopsetups
-\startsetups btx:apa:cite:authoryear
- \fastsetup{\s!btx:\s!cite:author}
-\stopsetups
-\startsetups btx:apa:cite:authoryears
- \fastsetup{\s!btx:\s!cite:author}
-\stopsetups
-\startsetups btx:apa:cite:authornum
- \fastsetup{\s!btx:\s!cite:author}
-\stopsetups
-\startsetups btx:apa:cite:title
- \fastsetup{\s!btx:\s!cite:\s!normal}
-\stopsetups
-\startsetups btx:apa:cite:booktitle
- \fastsetup{btx:apa:cite:title}
-\stopsetups
-\startsetups btx:apa:cite:entry
- \fastsetup{\s!btx:\s!cite:\s!normal}
-\stopsetups
-\startsetups btx:apa:cite:num
- \fastsetup{\s!btx:\s!cite:range}
-\stopsetups
-\startsetups btx:apa:cite:textnum
- \fastsetup{\s!btx:\s!cite:range}
-\stopsetups
-\startsetups btx:apa:cite:year
- \fastsetup{\s!btx:\s!cite:range}
-\stopsetups
-
\startsetups btx:apa:cite:author:year
\texdefinition{\s!btx:\s!cite:concat}
\ifx\currentbtxfirst\empty
@@ -709,6 +626,35 @@
\fi
\stopsetups
+% The sameauthor feature may not be APA compliant
+% (there is nothing in the manual cited above).
+% It can be removed using the command:
+% \resetsetups [apa:list:sameauthor]
+
+% Or texdefinition?
+
+\startsetups [apa:list:sameauthor]
+ \fastsetup{apa:list:sameauthor:rule}
+\stopsetups
+
+\startsetups [apa:list:sameauthor:rule]
+ \blackrule
+ [\c!width=\dimexpr\listparameter\c!margin-\interwordspace\relax,
+ \c!height=1.5\linewidth]% are you sure you want to inconsistent with the rest? happens nowhere!
+\stopsetups
+
+\startsetups [apa:list:sameauthor:\v!empty]% it's not a space
+ \kern\dimexpr\listparameter\c!margin-\interwordspace\relax
+\stopsetups
+
+\startsetups [apa:list:sameauthor:ditto] % horrible !
+ \inframed
+ [\c!width=\dimexpr\listparameter\c!margin-\interwordspace\relax,
+ \c!frame=\v!off,
+ \c!align=\v!middle]
+ {\doubleprime}
+\stopsetups
+
%D Instead of texdefinitions without arguments, we could have used setups but in my
%D editor (hh, scite) the commands stand out better. It also saves an additional
%D component in the name (e.g. common:) because commands and setups have a different
@@ -853,7 +799,7 @@
\texdefinition{btx:apa:author-or-editor} {editor}
}
\btxspace
- \btxstartstyleandcolor[apa:list:title] % NOT :\currentbtxcategory !
+ \btxstartstyleandcolor[apa:list:title]
\texdefinition{btx:apa:composed-title} {booktitle}
\btxstopstyleandcolor
\btxperiod
@@ -917,8 +863,9 @@
}
\stoptexdefinition
+ % this could be simplified!
+
\starttexdefinition btx:apa:journal-volume-number-pages
- % this could be simplified!
\btxdoif {journal} {
\btxspace
\btxstartstyleandcolor[apa:list:journal]
@@ -1020,8 +967,9 @@
\definebreakpoint [doi][-][nleft=3,type=1]
\definebreakpoint [doi][.][nleft=3,type=1]
+% use \btxentry here?
+
\starttexdefinition btx:apa:url
- % use \btxentry here?
\btxspace
\btxlabeltext{apa:Retrieved}
\btxspace
@@ -1039,8 +987,9 @@
\endgroup
\stoptexdefinition
+% use \btxentry here?
+
\starttexdefinition btx:apa:doi
- % use \btxentry here?
\btxspace
\begingroup
\setbreakpoints[doi]
@@ -1056,8 +1005,9 @@
\endgroup
\stoptexdefinition
+% also issn - see publ-imp-apa.lua
+
\starttexdefinition btx:apa:isbn
- % also issn - see publ-imp-apa.lua
\btxdoif {isbn} {
\btxleftparenthesis
\WORD{\btxfoundname{isbn}}:\btxspace
@@ -1121,8 +1071,10 @@
% Required fields: title, year
% Optional fields: editor, publisher, subtitle, series, volume, number, month, organization, doi, url, issn, note
+% needs to be tuned...
+
\startsetups btx:apa:list:periodical
- \fastsetup{btx:apa:list:article} % needs to be tuned...
+ \fastsetup{btx:apa:list:article}
\stopsetups
% National and international standards issued by a standards body