summaryrefslogtreecommitdiff
path: root/tex/context/base/publ-imp-apa.lua
blob: f2625488edf2fdffc6a13d63efe581f4b51a12c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
-- category = {
--     sets     = {
--         authors = { "author", "editor" },
--     },
--     required = { "authors", "title" },
--     optional = { "year", "journal", "editor", "volume", "number", "pages" },
--     virtual  = { "authoryear", "authoryears", "authornum", "num", "suffix" },
-- }

-- category = {
--     sets     = {
--         author = { "author", "editor" },
--     },
--     required = { "author", "title" },
--     optional = { "year", "journal", "editor", "volume", "number", "pages" },
--     virtual  = { "authoryear", "authoryears", "authornum", "num", "suffix" },
-- }

local article = {
    required = { "authors" },
    optional = { "year", "subtitle", "type", "journal", "volume", "number", "pages", "note", "links", "file" },
    sets     = {
        authors = { "author", "editor", "title" },
        links   = { "doi", "url" },
    },
}

local magazine = {
    required = { "authors", "journal", "year" },
    optional = { "subtitle", "volume", "number", "pages", "month", "day", "note", "links", "file" },
    sets     = article.sets,
}

local book = {
    required = { "authors" },
    optional = { "subtitle", "year", "month", "day", "type", "edition", "series", "volume", "number", "pages", "address", "url", "note", "ISBN", "file" },
    sets     = {
        authors = { "author", "editor", "publisher", "title" },
    },
}

local inbook = {
    required = { "authors", "title", "chapter", "pages", "year" },
    optional = { "subtitle", "volume", "number", "series", "type", "address", "edition", "month", "note", "ISBN", "file" },
    sets     = book.sets,
}

local booklet = {
    required = { "authors" },
    optional = { "subtitle", "howpublished", "address", "month", "year", "note", "file" },
    sets     = {
        authors = { "author", "title" },
    },
}

local incollection = {
    required = { "authors", "title", "booktitle", "year" },
    optional = { "subtitle", "volume", "number", "series", "type", "chapter", "pages", "address", "edition", "month", "note", "ISBN", "file" },
    sets     = {
        authors = { "author", "editor", "publisher" },
    },
}

local inproceedings = {
    optional = { "subtitle", "volume", "number", "series", "pages", "address", "month", "organization", "note", "ISBN", "file" },
    required = incollection.required,
    sets     = incollection.sets,
}

local manual = {
    required = { "title" },
    optional = { "subtitle", "author", "organization", "address", "edition", "month", "year", "note", "file" },
}

local thesis = {
    required = { "author", "title", "school", "year", "type" },
    optional = { "subtitle", "address", "month", "note", "file" },
}

local misc = {
    required = { },
    optional = { "author", "title", "subtitle", "howpublished", "month", "year", "note", "file" },
}

local periodical = {
    required = { "title", "year" },
    optional = { "subtitle", "authors", "month", "note", "number", "organization", "series", "volume", "file" },
    sets     = {
        authors = { "editor", "publisher" },
    },
}

local proceedings = {
    required = { "title", "year" },
    optional = { "subtitle", "editor", "volume", "number", "series", "address", "month", "organization", "publisher", "note", "pages", "ISBN", "file" },
}

local techreport = {
    required = { "author", "title", "institution", "year" },
    optional = { "subtitle", "type", "number", "address", "month", "note", "file" },
}

local other = {
    required = { "author", "title", "year" },
    optional = { "subtitle", "note", "doi", "file" },
}

local patent = {
    required = { "nationality", "number", "year", "yearfiled" },
    optional = { "author", "title", "subtitle", "language", "assignee", "address", "type", "day", "dayfiled", "month", "monthfiled", "note", "file" },
}

local electronic = {
    required = { "title" },
    optional = { "subtitle", "address", "author", "howpublished", "month", "note", "organization", "year", "url", "doi", "type", "file" },
}

local standard = {
    required = { "authors", "title", "subtitle", "year", "note", "url" },
    optional = { "doi", "file" },
    sets     = {
        authors = { "author", "institution", "organization" },
    },
}

local unpublished = {
    required = { "author", "title", "note" },
    optional = { "subtitle", "month", "year", "file" },
}

local literal = {
    required = { "key", "text" },
    optional = { },
    virtual  = false,
}

return {
    name = "apa",
    version = "1.00",
    comment = "APA specification.",
    author = "Alan Braslau and Hans Hagen",
    copyright = "ConTeXt development team",
    virtual = {
        -- all share the same default set
        "authoryear", "authoryears", "authornum", "num", "suffix",
    },
    types = {
        --
        -- list of fields that are interpreted as names: "NAME [and NAME]" where
        -- NAME is one of the following:
        --
        -- First vons Last
        -- vons Last, First
        -- vons Last, Jrs, First
        -- Vons, Last, Jrs, First
        --
        author      = "author",
        editor      = "author",
        artist      = "author",
        interpreter = "author",
        composer    = "author",
        producer    = "author",
    },
    categories = {
        article       = article,
        magazine      = magazine,
        newspaper     = magazine,
        book          = book,
        inbook        = inbook,
        booklet       = booklet,
        incollection  = incollection,
        inproceedings = inproceedings,
        conference    = inproceedings,
        manual        = manual,
        thesis        = thesis,
        mastersthesis = thesis,
        phdthesis     = thesis,
        misc          = misc,
        periodical    = periodical,
        proceedings   = proceedings,
        techreport    = techreport,
        other         = other,
        patent        = patent,
        electronic    = electronic,
        standard      = standard,
        unpublished   = unpublished,
        literal       = literal,
        --
        -- the following fields are for documentation and testing purposes
        --
        ["demo-a"] = {
            required = { "author", "title", "year", "note", "url" },
            optional = { "subtitle", "doi", "file" },
            sets     = {
                author  = { "author", "institution", "organization" },
            },
        },
        ["demo-b"] = {
            required = { "authors", "title", "year", "note", "url" },
            optional = { "subtitle", "doi", "file" },
            sets     = {
                authors = { "author", "institution", "organization" },
            },
        },
    },
}