summaryrefslogtreecommitdiff
path: root/tex/context/base/publ-imp-apa.mkvi
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2014-11-11 00:15:03 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2014-11-11 00:15:03 +0100
commit09dd6fdf23ca0bdd27007f0420bc30d841eb5ab0 (patch)
tree77087dddf7319cf4f657b0639515c56bf5d6b84b /tex/context/base/publ-imp-apa.mkvi
parentf853930e63e059af883ee86b9fe5549cfaa75d43 (diff)
downloadcontext-09dd6fdf23ca0bdd27007f0420bc30d841eb5ab0.tar.gz
2014-11-10 23:15:00
Diffstat (limited to 'tex/context/base/publ-imp-apa.mkvi')
-rw-r--r--tex/context/base/publ-imp-apa.mkvi221
1 files changed, 93 insertions, 128 deletions
diff --git a/tex/context/base/publ-imp-apa.mkvi b/tex/context/base/publ-imp-apa.mkvi
index ffb9fb1ca..ef148e657 100644
--- a/tex/context/base/publ-imp-apa.mkvi
+++ b/tex/context/base/publ-imp-apa.mkvi
@@ -46,7 +46,7 @@
\c!etallimit=5,
\c!etaldisplay=\btxlistvariantparameter\c!etallimit,
%\c!journalconversion=\v!normal,
- \c!monthconversion=\v!number,
+ \c!monthconversion=\v!month,
\c!authorconversion=\v!invertedshort]
\definebtxlistvariant
@@ -77,7 +77,7 @@
\c!surnamefirstnamesep=\btxlistvariantparameter\c!surnamefirstnamesep,
\c!etallimit=5, % when 2-4, show all first time, etaldisplay subsequently...
\c!etaldisplay=1,
- \c!monthconversion=\btxlistvariantparameter\c!monthconversion,
+ % \c!monthconversion=\btxlistvariantparameter\c!monthconversion,
\c!authorconversion=\v!name,
\c!interaction=\v!start,
% \c!setups=btx:cite:initialize,
@@ -302,35 +302,11 @@
\fi
\stoptexdefinition
-\starttexdefinition btx:apa:suffixeddate
- \btxleftparenthesis
- \btxdoifelse {year} {
- \btxflush{year}
- \btxflush{suffix}
- \btxdoif {month} {
- \btxcomma
- % language issue here (monthconversion)?
- \btxflush{month}
- \btxdoif {day} {
- \btxspace
- \btxflush{day}
- }
- }
- } {
- \btxlabeltext{apa:nd}
- \btxdoif {suffix} {
- \btxspace
- \btxflush{suffix}
- }
- }
- \btxrightparenthesisperiod
-\stoptexdefinition
-
\starttexdefinition btx:apa:title-subtitle-type
\btxdoif {title} {
\setmode{btx:apa:title-placed}
\btxdoif {file} {
- % we make the title active opening file
+ % we make the title active, opening file
\texdefinition{btx:apa:inject} {url(file:\btxflush{file})}
}
{
@@ -351,77 +327,76 @@
}
\stoptexdefinition
-\starttexdefinition btx:apa:author-or-title
- <\btxfieldname{authors},\btxfieldtype{authors}>\space\btxflush{authors}\space
- \btxdoifelse {author} {
- \btxflushauthor[invertedshort]{author}
- } {
- \texdefinition{btx:apa:title-subtitle-type}
+\starttexdefinition btx:apa:title-if-not-placed #it
+ \doifnotmode {btx:apa:title-placed} {
+ \btxdoif {title} {
+ \btxspace
+ \doifelse {#it} {it} {
+ \begingroup
+ \it
+ \texdefinition{btx:apa:title-subtitle-type}
+ \italiccorrection
+ \endgroup
+ } {
+ \texdefinition{btx:apa:title-subtitle-type}
+ }
+ }
}
\stoptexdefinition
\starttexdefinition btx:apa:editor-or-editors
- \btxleftparenthesis
- \btxsingularorplural {editor} {
- \btxlabeltext{apa:Editor}
- } {
- \btxlabeltext{apa:Editors}
+ \btxdoif {editor} {
+ \btxflush {editor}
+ \btxleftparenthesis
+ \btxsingularorplural {editor} {
+ \btxlabeltext{apa:Editor}
+ } {
+ \btxlabeltext{apa:Editors}
+ }
+ \btxrightparenthesisperiod
}
- \btxrightparenthesisperiod
\stoptexdefinition
-\starttexdefinition btx:apa:author-or-editor-or-publisher-or- #title #publisher
- <\btxfieldname{authors},\btxfieldtype{authors}>\space\btxflush{authors}\space
- \btxdoifelse {author} {
- \btxflushauthor[invertedshort]{author}
- } {
- \btxdoifelse {editor} {
- \btxflushauthor[invertedshort]{editor}
+\unprotect
+
+\starttexdefinition btx:apa:authoryear
+ % we make the authoryear active, pointing to the citation
+ \texdefinition{btx:apa:inject} {\s!internal(\currentbtxinternal)}
+ {
+<\btxfoundname{author},\btxfoundtype{author}>
+ \doifelse {\btxfoundname{author}} {editor} {
\texdefinition{btx:apa:editor-or-editors}
} {
- \btxdoifelse {#publisher} {
-% \setmode{btx:apa:publisher-as-author}
- \btxflush{#publisher}
+ \doifelse {\btxfoundname{author}} {title} {
+ \texdefinition{btx:apa:title-subtitle-type}
} {
- \doif {#title} {title} {
- \texdefinition{btx:apa:title-subtitle-type}
- }
+ \btxflush {author}
}
}
- }
-\stoptexdefinition
-
-\starttexdefinition btx:apa:editor-or-organization #title
- \btxdoifelse {editor} {
- \btxflushauthor[invertedshort]{editor}
- \texdefinition{btx:apa:editor-or-editors}
- } {
- \btxdoifelse {organization} {
- \btxflush{organization}
+ \btxleftparenthesis
+ \btxdoifelse {year} {
+ \btxflush{year}
+ \btxflush{suffix}
+ \btxdoif {month} {
+ \btxcomma
+ \btxflush{month}
+ \btxdoif {day} {
+ \btxspace
+ \btxflush{day}
+ }
+ }
} {
- \doif {#title} {title} {
- \texdefinition{btx:apa:title-subtitle-type}
+ \btxlabeltext{apa:nd}
+ \btxdoif {suffix} {
+ \btxspace
+ \btxflush{suffix}
}
}
+ \btxrightparenthesisperiod
}
\stoptexdefinition
-\starttexdefinition btx:apa:title-if-not-placed #it
- \doifnotmode {btx:apa:title-placed} {
- \btxdoif {title} {
- \btxspace
- \doifelse {#it} {it} {
- \begingroup
- \it
- \texdefinition{btx:apa:title-subtitle-type}
- \italiccorrection
- \endgroup
- } {
- \texdefinition{btx:apa:title-subtitle-type}
- }
- }
- }
-\stoptexdefinition
+\protect
\starttexdefinition btx:apa:italic #field
\begingroup
@@ -441,11 +416,7 @@
\btxspace
}
}
- \btxdoif {editor} {
- \btxflushauthor[normalshort]{editor}
- \btxspace
- \texdefinition{btx:apa:editor-or-editors}
- }
+ \texdefinition{btx:apa:editor-or-editors}
\btxdoif {#title} {
\texdefinition{btx:apa:italic}{Word -> #title}
}
@@ -608,30 +579,41 @@
\btxspace
\btxlabeltext{apa:Retrieved}
\btxspace
- \ifconditional\btxinteractive
+ \btxdoifelseinteractive {url} {
\goto {
\hyphenatedurl{\btxflush{url}}
} [
url(\btxflush{url})
]
- \else
+ } {
\hyphenatedurl{\btxflush{url}}
- \fi
+ }
}
\stoptexdefinition
\starttexdefinition btx:apa:doi
\btxdoif {doi} {
\btxspace
- \ifconditional\btxinteractive
+ \btxdoifelseinteractive {doi} {
\goto {
doi:\btxflush{doi}
} [
url(http://dx.doi.org/\btxflush{doi})
]
- \else
+ } {
doi:\btxflush{doi}
- \fi
+ }
+ }
+\stoptexdefinition
+
+\starttexdefinition btx:apa:isbn
+ % also issn - see publ-imp-apa.lua
+ \btxdoif {isbn} {
+ \btxleftparenthesis
+ %broken: \btxfoundname{WORD -> isbn}:\btxspace
+ \btxfoundname{isbn}:\btxspace
+ \btxflush{isbn}
+ \btxrightparenthesis
}
\stoptexdefinition
@@ -640,8 +622,7 @@
\btxdoif {note} {
\btxleftparenthesis
{\btxflush{note}}
- \btxrightparenthesis\removeunwantedspaces
- % no space if last item!
+ \btxrightparenthesis
}
\stoptexdefinition
@@ -649,8 +630,10 @@
\btxdoifnot {doi} {
\texdefinition{btx:apa:url}
}
+ \texdefinition{btx:apa:isbn}
\texdefinition{btx:apa:note}
\texdefinition{btx:apa:doi}
+ \removeunwantedspaces
\stoptexdefinition
\starttexdefinition btx:apa:doifelse-publisher-or-author-or-editor #author #if #else
@@ -743,8 +726,7 @@
% Note that bibtex (and tools) do not include editor (e.g. special issue or section)
\startsetups btx:apa:article
- \texdefinition{btx:apa:author-or-title}
- \texdefinition{btx:apa:suffixeddate}
+ \texdefinition{btx:apa:authoryear}
\texdefinition{btx:apa:title-if-not-placed}{}
\texdefinition{btx:apa:journal-volume-number-pages}{}
\texdefinition{btx:apa:url-note-doi}
@@ -755,8 +737,7 @@
% Optional fields: volume, number, pages, type, month, day, doi, url, note.
\startsetups btx:apa:magazine
- \texdefinition{btx:apa:author-or-title}
- \texdefinition{btx:apa:suffixeddate}
+ \texdefinition{btx:apa:authoryear}
\texdefinition{btx:apa:title-if-not-placed}{}
\texdefinition{btx:apa:journal-volume-number-pages}{}
\texdefinition{btx:apa:url-note-doi}
@@ -767,8 +748,7 @@
% Optional fields: volume, number, pages, type, month, day, doi, url, note.
\startsetups btx:apa:newspaper
- \texdefinition{btx:apa:author-or-title}
- \texdefinition{btx:apa:suffixeddate}
+ \texdefinition{btx:apa:authoryear}
\texdefinition{btx:apa:title-if-not-placed}{}
\texdefinition{btx:apa:journal-volume-number-pages}{pp}
\texdefinition{btx:apa:url-note-doi}
@@ -782,8 +762,7 @@
% todo: series?
\startsetups btx:apa:book
- \texdefinition{btx:apa:author-or-editor-or-publisher-or-}{title}{publisher}
- \texdefinition{btx:apa:suffixeddate}
+ \texdefinition{btx:apa:authoryear}
\texdefinition{btx:apa:title-if-not-placed}{it}
\texdefinition{btx:apa:edition-volume-number-pages}{edition}
\texdefinition{btx:apa:wherefrom-publisher-author-is-}{author}
@@ -798,8 +777,7 @@
% todo: series?
\startsetups btx:apa:inbook
- \texdefinition{btx:apa:author-or-editor-or-publisher-or-}{}{publisher}
- \texdefinition{btx:apa:suffixeddate}
+ \texdefinition{btx:apa:authoryear}
\btxdoif {chapter} {
\btxflush{Word -> chapter}
\btxspace
@@ -818,8 +796,7 @@
% todo: series?
\startsetups btx:apa:incollection
- \texdefinition{btx:apa:author-or-editor-or-publisher-or-}{title}{publisher}
- \texdefinition{btx:apa:suffixeddate}
+ \texdefinition{btx:apa:authoryear}
\texdefinition{btx:apa:title-if-not-placed}{}
\texdefinition{btx:apa:editor}{booktitle}
\texdefinition{btx:apa:edition-volume-number-pages}{edition}
@@ -833,8 +810,7 @@
% todo: series?
\startsetups btx:apa:proceedings
- \texdefinition{btx:apa:editor-or-organization}{title}
- \texdefinition{btx:apa:suffixeddate}
+ \texdefinition{btx:apa:authoryear}
\texdefinition{btx:apa:title-if-not-placed}{}
\texdefinition{btx:apa:edition-volume-number-pages}{edition}
\btxdoifelse {editor} {
@@ -856,8 +832,7 @@
% todo: series?
\startsetups btx:apa:inproceedings
- \texdefinition{btx:apa:author-or-editor-or-publisher-or-}{title}{publisher}
- \texdefinition{btx:apa:suffixeddate}
+ \texdefinition{btx:apa:authoryear}
\texdefinition{btx:apa:title-if-not-placed}{}
\texdefinition{btx:apa:editor}{booktitle}
\texdefinition{btx:apa:edition-volume-number-pages}{edition}
@@ -880,9 +855,7 @@
\startsetups btx:apa:thesis
\setmode{btx:apa:thesis}
- % unlikely not to have author!
- \texdefinition{btx:apa:author-or-title}
- \texdefinition{btx:apa:suffixeddate}
+ \texdefinition{btx:apa:authoryear}
\texdefinition{btx:apa:title-if-not-placed}{it}
\btxleftparenthesis
\btxdoifelse {type} {
@@ -924,8 +897,7 @@
% Optional fields: author, howpublished, address, month, year, note.
\startsetups btx:apa:booklet
- \texdefinition{btx:apa:author-or-title}
- \texdefinition{btx:apa:suffixeddate}
+ \texdefinition{btx:apa:authoryear}
\texdefinition{btx:apa:title-if-not-placed}{it}
\texdefinition{btx:apa:wherefrom-publisher-author-is-}{howpublished}
\texdefinition{btx:apa:url-note-doi}
@@ -936,8 +908,7 @@
% 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:suffixeddate}
+ \texdefinition{btx:apa:authoryear}
\texdefinition{btx:apa:title-if-not-placed}{it}
\texdefinition{btx:apa:edition-volume-number-pages}{edition}
\texdefinition{btx:apa:wherefrom-publisher-author-is-}{organization}
@@ -949,8 +920,7 @@
% 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:suffixeddate}
+ \texdefinition{btx:apa:authoryear}
\texdefinition{btx:apa:title-if-not-placed}{it}
\texdefinition{btx:apa:edition-volume-number-pages}{type}
\texdefinition{btx:apa:wherefrom-publisher-author-is-}{institution}
@@ -962,8 +932,7 @@
% Optional fields: month, year.
\startsetups btx:apa:unpublished
- \texdefinition{btx:apa:author-or-title}
- \texdefinition{btx:apa:suffixeddate}
+ \texdefinition{btx:apa:authoryear}
\texdefinition{btx:apa:title-if-not-placed}{it}
\texdefinition{btx:apa:url-note-doi}
\stopsetups
@@ -976,8 +945,7 @@
% todo: yearfiled, monthfiled, dayfiled
\startsetups btx:apa:patent
- \texdefinition{btx:apa:author-or-editor-or-publisher-or-}{title}{assignee}
- \texdefinition{btx:apa:suffixeddate}
+ \texdefinition{btx:apa:authoryear}
\texdefinition{btx:apa:title-if-not-placed}{it}
\begingroup
\it
@@ -1036,8 +1004,7 @@
% Like Misc below but includes organization.
\startsetups btx:apa:electronic
- \texdefinition{btx:apa:author-or-title}
- \texdefinition{btx:apa:suffixeddate}
+ \texdefinition{btx:apa:authoryear}
\texdefinition{btx:apa:title-if-not-placed}{it}
\btxdoif {organization} {
\btxspace
@@ -1057,8 +1024,7 @@
% Optional fields: note, doi, url
\startsetups btx:apa:other
- \texdefinition{btx:apa:author-or-title}
- \texdefinition{btx:apa:suffixeddate}
+ \texdefinition{btx:apa:authoryear}
\texdefinition{btx:apa:title-if-not-placed}{it}
\texdefinition{btx:apa:url-note-doi}
\stopsetups
@@ -1068,8 +1034,7 @@
% Optional fields: author, title, howpublished, month, year, note.
\startsetups btx:apa:misc
- \texdefinition{btx:apa:author-or-title}
- \texdefinition{btx:apa:suffixeddate}
+ \texdefinition{btx:apa:authoryear}
\texdefinition{btx:apa:title-if-not-placed}{it}
\btxdoif {howpublished} {
\btxspace