publ-imp-aps.lua /size: 10 Kb    last modification: 2020-07-01 14:35
1local specification = {
2    --
3    -- metadata
4    --
5    name      = "aps",
6    version   = "1.00",
7    comment   = "APS specification",
8    author    = "Alan Braslau and Hans Hagen",
9    copyright = "ConTeXt development team",
10    --
11    -- derived (combinations of) fields (all share the same default set)
12    --
13    virtual = {
14        "authoryear",
15        "authoryears",
16        "authornum",
17        "num",
18        "suffix",
19    },
20    --
21    -- special datatypes
22    --
23    types = {
24        --
25        -- list of fields that are interpreted as names: "NAME [and NAME]" where
26        -- NAME is one of the following:
27        --
28        -- First vons Last
29        -- vons Last, First
30        -- vons Last, Jrs, First
31        -- Vons, Last, Jrs, First
32        --
33        author      = "author", -- interpreted as name(s)
34        editor      = "author",
35        doi         = "url",        -- an external link
36        url         = "url",
37        page        = "pagenumber", -- number or range: f--t
38        pages       = "pagenumber",
39        volume      = "range",
40        number      = "range",
41        keywords    = "keyword",    -- comma|-|separated list
42        year        = "number",
43    },
44    --
45    -- categories with their specific fields
46    --
47    categories = {
48        --
49        -- categories are added below
50        --
51    },
52}
53
54local generic = {
55    --
56    -- A set returns the first field (in order of position below) that is found
57    -- present in an entry. A set having the same name as a field conditionally
58    -- allows the substitution of an alternate field.
59    --
60    -- note that anything can get assigned a doi or be available online.
61    editionset = { "edition", "volume", "number", "pages" },
62}
63
64-- Note that the APS specification allows an additional field "collaboration"
65-- to be rendered following the author list (if the collaboration name appears
66-- in the byline of the cited article).
67
68-- Definition of recognized categories and the fields that they contain.
69-- Required fields should be present; optional fields may also be rendered;
70-- all other fields will be ignored.
71
72-- Sets contain either/or in order of precedence.
73--
74-- For a category *not* defined here yet present in the dataset, *all* fields
75-- are taken as optional. This allows for flexibility in the addition of new
76-- categories.
77
78local categories = specification.categories
79
80-- an article from a journal
81
82categories.article = {
83    sets = {
84        author = { "author", "editor" },
85    },
86    required = {
87        "author",
88    },
89    optional = {
90        "collaboration",
91        "year",
92        "title", "subtitle", "type", "file",
93        "journal", "volume", "number", "pages",
94        "doi", "url", "note",
95    },
96}
97
98-- an article from a magazine
99
100categories.magazine = {
101    sets = categories.article.sets,
102    required = {
103        "author",
104        "year",
105        "journal",
106    },
107    optional = {
108        "collaboration",
109        "title", "subtitle", "type", "file",
110        "number", "pages",
111        "month", "day",
112        "doi", "url", "note",
113    },
114}
115
116categories.newspaper = categories.magazine
117
118-- (from jabref) to be identified and setup ...
119
120categories.periodical = {
121    sets = {
122        author = { "editor", "publisher" },
123    },
124    required = {
125        "title",
126        "year",
127    },
128    optional = {
129        "author",
130        "collaboration",
131        "subtitle", "file",
132        "series", "volume", "number", "month",
133        "organization",
134        "doi", "url", "note",
135    },
136}
137
138-- (from jabref) to be identified and setup ...
139
140categories.standard = {
141    sets = {
142        author = { "author", "institution", "organization" },
143    },
144    required = {
145        "author",
146        "year",
147        "title", "subtitle",
148        "doi", "note",
149    },
150    optional = {
151        "collaboration",
152        "url",
153    },
154}
155
156-- a book with an explicit publisher.
157
158categories.book = {
159    sets = {
160        author     = { "author", "editor", "publisher" },
161        editionset = generic.editionset,
162    },
163    required = {
164        "author",
165        "title",
166    },
167    optional = {
168        "collaboration",
169        "year", "month", "day",
170        "title", "subtitle", "type",  "file",
171        "editionset", "series",
172        "address",
173        "doi", "url", "note",
174    },
175}
176
177-- a part of a book, which may be a chapter (or section or whatever) and/or a range of pages.
178
179categories.inbook = {
180    sets = {
181        author     = { "author", "editor", "publisher", },
182        editionset = generic.editionset,
183    },
184    required = {
185        "author",
186        "year" ,
187        "title",
188    },
189    optional = {
190        "collaboration",
191        "subtitle", "type", "file",
192        "booktitle",
193        -- "chapter",
194        "editionset", "series",
195        "month",
196        "address",
197        "doi", "url", "note",
198    },
199}
200
201-- a book having its own title as part of a collection.
202-- (like inbook, but we here make booktitle required)
203
204categories.incollection = {
205    sets = {
206        author     = { "author", "editor", "publisher" },
207        editionset = generic.editionset,
208    },
209    required = {
210        "author",
211        "booktitle",
212        "year",
213    },
214    optional = {
215        "collaboration",
216        "title", "subtitle", "type", "file",
217        "editionset", "series",
218        "chapter",
219        "month",
220        "address",
221        "doi", "url", "note",
222    },
223}
224
225-- a work that is printed and bound, but without a named publisher or sponsoring institution.
226
227categories.booklet = {
228    sets = {
229        publisher = { "howpublished" }, -- no "publisher"!
230    },
231    required = {
232        "author",
233        "title",
234    },
235    optional = {
236        "publisher",
237        "collaboration",
238        "year", "month",
239        "subtitle", "type", "file",
240        "address",
241        "doi", "url", "note",
242     },
243}
244
245-- the proceedings of a conference.
246
247categories.proceedings = {
248    sets = {
249        author     = { "editor", "organization", "publisher" }, -- no "author"!
250        publisher  = { "publisher", "organization" },
251        editionset = generic.editionset,
252    },
253    required = {
254        "author",
255        "year"
256    },
257    optional = {
258        "collaboration",
259        "publisher",
260        "title", "subtitle", "file",
261        "editionset", "series",
262        "month",
263        "address",
264        "doi", "url", "note",
265    },
266}
267
268-- an article in a conference proceedings.
269
270categories.inproceedings = {
271    sets     = categories.incollection.sets,
272    required = categories.incollection.required,
273    optional = {
274        "collaboration",
275        "title", "subtitle", "type", "file",
276        "month",
277        "edition", "series",
278        "address", "organization",
279        "doi", "url", "note",
280    },
281}
282
283categories.conference = categories.inproceedings
284
285-- a thesis (of course).
286
287categories.thesis = {
288    required = {
289        "author",
290        "title",
291        "school",
292        "year",
293        "type"
294    },
295    optional = {
296        "collaboration",
297        "subtitle", "file",
298        "month",
299        "address",
300        "doi", "url", "note",
301    },
302}
303
304categories.mastersthesis = {
305    sets     = categories.thesis.sets,
306    required = {
307        "author",
308        "title",
309        "school",
310        "year"
311    },
312    optional = {
313        "collaboration",
314        "type",
315        "subtitle", "file",
316        "month",
317        "address",
318        "doi", "url", "note",
319    },
320}
321categories.phdthesis = categories.mastersthesis
322
323-- a report published by a school or other institution, usually numbered within a series.
324
325categories.techreport = {
326    sets = {
327        author     = { "author", "institution", "publisher" },
328        publisher  = { "publisher", "institution", },
329        editionset = { "type", "volume", "number", "pages" }, -- no "edition"!
330    },
331    required = {
332        "author",
333        "title",
334        "institution",
335        "year"
336    },
337    optional = {
338        "collaboration",
339        "publisher",
340        "address",
341        "subtitle", "file",
342        "editionset",
343        "month",
344        "doi", "url", "note",
345    },
346}
347
348-- technical documentation.
349
350categories.manual = {
351    sets = {
352        author     = { "author", "organization", "publisher" },
353        publisher  = { "publisher", "organization", },
354        editionset = generic.editionset,
355    },
356    required = {
357        "title"
358    },
359    optional = {
360        "author", "publisher",
361        "collaboration",
362        "address",
363        "subtitle", "file",
364        "editionset", "month", "year",
365        "doi", "url", "note",
366    },
367}
368
369-- a patent (of course).
370
371categories.patent = {
372    sets = {
373        author = { "author", "assignee", },
374        publisher = { "publisher", "assignee", },
375        year = { "year", "yearfiled", },
376        month = { "month", "monthfiled", },
377        day = { "day", "dayfiled", },
378    },
379    required = {
380        "nationality",
381        "number",
382        "year",
383    },
384    optional = {
385        "type",
386        --check this: "language",
387        "author", "publisher",
388        "collaboration",
389        "title", "subtitle", "file",
390        "address",
391        "day", "month",
392        "doi", "url", "note",
393    },
394}
395
396-- a document having an author and title, but not formally published.
397
398categories.unpublished = {
399    required = {
400        "author",
401        "title",
402        "note"
403    },
404    optional = {
405        "collaboration",
406        "subtitle", "file",
407        "year", "month",
408        "doi", "url",
409    },
410}
411
412-- like misc below but includes organization.
413
414categories.electronic = {
415    sets = {
416        author = { "author", "collaboration", "organization", },
417        howpublished = { "howpublished", "doi", "url", },
418    },
419    required = {
420        "title"
421    },
422    optional = {
423        "subtitle", "type", "file",
424        "year", "month",
425        "author",
426        "collaboration",
427        "organization",
428        "address",
429        "howpublished",
430        "doi", "url", "note",
431    },
432}
433
434-- use this type when nothing else fits.
435
436categories.misc = {
437    sets = {
438        author = { "author", "collaboration", },
439        howpublished = { "howpublished", "doi", "url", },
440    },
441    required = {
442        -- nothing is really important here
443    },
444    optional = {
445        "author",
446        "collaboration",
447        "title", "subtitle", "file",
448        "year", "month",
449        "howpublished",
450        "doi", "url", "note",
451    },
452}
453
454-- other (whatever jabref does not know!)
455
456categories.other = {
457    required = {
458        "author",
459        "title",
460        "year"
461    },
462    optional = {
463        "collaboration",
464        "subtitle", "file",
465        "doi", "url", "note",
466    },
467}
468
469-- if all else fails to match:
470
471categories.literal = {
472    sets = {
473        author = { "tag" }, -- need to check this!
474    },
475    required = {
476        "text"
477    },
478    optional = {
479        "author",
480        "doi", "url", "note"
481    },
482    virtual = false,
483}
484
485-- done
486
487return specification
488