publications-customize.tex /size: 26 Kb    last modification: 2020-07-01 14:35
1\environment publications-style
2
3\startcomponent publications-customize
4
5\startchapter[title=Custom renderings,reference=ch:custom]
6
7\startsection[title=Introduction]
8
9The rendering of citations and bibliography lists is highly configurable and
10custom rendering schemes can be added. The details can get quite complicated so
11we will begin with a description of how citation variations can be used in the
12running text, followed by a description on how to control the rending of the
13associated bibliography list.
14
15\startaside
16Loading the specification file defines a \Index {namespace}, say \TEXcode {apa},
17containing subspaces \TEXcode {apa:list} and \TEXcode {apa:cite} as well as
18variants, for example \TEXcode {apa:cite:authoryear}, allowing \emphasis
19{parameters} to be tuned independently for each form. This insures independence
20but can get somewhat confusing. Most users will not encounter any problems as all
21of this setup work is taken care of in the specification file; only those needing
22to fine|-|tune specific settings need to better understand the underlying
23mechanism.
24
25The rendering of the variants can be adjusted through \Cindex {setupbtx} in the
26appropriate \Index {namespace}, for example modifying (or suppressing)
27parenthesis or activating or deactivating interaction \Index {hyperlink}s. Beyond
28the settings of parameters in the appropriate \Index {namespace},
29\emphasis{setups} are used to perform the actual renderings of citations as well
30as of lists. One must be aware of \Index {namespace} \Index {isolation} and
31\Index {inheritance} as well as fall|-|back when attempting to make changes.
32
33When small modifications on one of the pre|-|defined specifications are desired,
34we suggest loading the specification and then adjusting certain parameters and
35overloading the appropriate setups. Eventually, a new specification might be
36necessary.
37\stopaside
38
39A common setup will enable or disable interaction:
40
41\startbuffer
42\setupbtx [interaction=start]
43\stopbuffer
44
45\cindex{setupbtx}
46
47\typeTEXbuffer
48
49Notice that this is applied to the root \Index {namespace}.
50
51Other root|-|\Index {namespace} parameters that have been used are \TEXcode
52{specification}, \TEXcode {dataset} and \TEXcode {numbering}.
53
54Associated with \TEXcode {specification} is an additional parameter \TEXcode
55{default=} that defines a fall|-|back specification to be used to complete a
56derived specification. \startfootnote For example, a variant on a specification
57can be defined by only addressing specific differences, for example \index
58{style+RMP}\TEXcode {specification=rmp} would be associated with \index
59{style+APS}\TEXcode {default=aps}, as this describes a style used by the journal:
60The Review of Modern Physics, mostly based on the style of the American Physical
61Society. \stopfootnote
62
63Further \quote {low|-|level} formatting parameters, mostly dealing with the
64formatting of names, are also defined by default in the root namespace. These are
65listed in \in {table} [tab:setupbtx]. Some might eventually be redefined by the
66specification in other namespaces, and may with good reason differ by context:
67between the \TEXcode {[cite]} and \TEXcode {[list]} namespaces, for example.
68
69In order to insure the independence of specifications, each one defines its own
70root namespace, for example \TEXcode {[default]}, \TEXcode {[apa]} or \TEXcode
71{[aps]}, inheriting its settings from root, upon which are built the other
72namespaces.
73
74\startplacetable
75  [reference=tab:setupbtx,
76   list={\TEXcode {\setupbtx} low|-|level formatting parameters},
77   title={\Cindex {setupbtx} low|-|level formatting parameters. Some may be
78   redefined differently in the \TEXcode {cite} and \TEXcode {list} namespaces.}]
79\starttabulate [|Tr|Tl|p|]
80    \NC specification                \NC default               \NC default style \NC \NR
81    \NC default                      \NC <null>                \NC fall|-|back style \NC \NR
82    \NC interaction                  \NC start                 \NC active hyperlinks \NC \NR
83    \NC separator                    \NC \Cindex{btxsemicolon} \NC between multiple references \NC \NR
84    \NC separator:firstnames         \NC \Cindex{btxspace}     \NC between first names \NC \NR
85    \NC separator:juniors            \NC \Cindex{btxspace}     \NC before \quote{juniors} \NC \NR
86    \NC separator:vons               \NC \Cindex{btxspace}     \NC before \quote{vons} \NC \NR
87    \NC separator:initials           \NC \Cindex{btxspace}     \NC between initials \NC \NR
88    \NC stopper:initials             \NC .                     \NC initialization truncation symbol \NC \NR
89    \NC separator:invertedinitials   \NC \Cindex{btxcomma}     \NC before initials, inverted form \NC \NR
90    \NC separator:invertedfirstnames \NC \Cindex{btxcomma}     \NC before first names, inverted form \NC \NR
91    \NC authorconversion             \NC normal                \NC normal, normalshort, inverted, invertedshort, name (see \in{table}[tab:authorconversion]) \NC \NR
92    \NC monthconversion              \NC number                \NC month, month:mnen (see \TEXcode {\convertnumber}) \NC \NR
93    \NC journalconversion            \NC normal                \NC normal, abbreviated(short?) \NC \NR
94    \NC etallimit                    \NC 3                     \NC length of author list \NC \NR
95    \NC etaldisplay                  \NC 3                     \NC length of truncated author list \NC \NR
96    \NC \tindex{others}otherstext    \NC et al.                \NC author list truncation text \NC \NR
97    \NC separator:names:2            \NC \Cindex{btxcomma}     \NC separates multiple names \NC \NR
98    \NC separator:names:3            \NC \Cindex{btxcomma}     \NC before last name in a list \NC \NR
99    \NC separator:names:4            \NC \Cindex{btxcomma}     \NC between only two names \NC \NR
100    \NC separator:2                  \NC \Cindex{btxsemicolon} \NC separates multiple objects \NC \NR
101    \NC separator:3                  \NC \Cindex{btxsemicolon} \NC before last object in a list \NC \NR
102    \NC separator:4                  \NC \Cindex{btxsemicolon} \NC between only two objects \NC \NR
103\stoptabulate
104\stopplacetable
105
106\cindex   {setupbtx}
107\showsetup[setupbtx]
108
109\stopsection
110
111\startsection
112  [reference=sec:customcite,
113   title=Custom citation renderings]
114
115\startsubsubject [title=Parameters]
116
117Citation variants are mostly controlled though adjustment of their parameters
118within the appropriate \Index {namespace}. For example, the cite variant \cindex
119{cite}\TEXcode {\cite[num]} would be addressed through
120
121
122\cindex {setupbtx}
123
124\startTEX
125\setupbtx[default:cite:num]
126\stopTEX
127
128for the \TEXcode {default} specification, or alternately, through
129
130\cindex {setupbtx}
131
132\startTEX
133\setupbtx[apa:cite:num]
134\stopTEX
135
136for the \index {style+APA}\TEXcode {apa} specification. For example, superscript
137numbered citations in the \index {style+APS}\TEXcode {aps} specification could be
138obtained through
139
140\cindex{setupbtx}
141
142\startTEX
143\setupbtx[aps:cite:num][command=\high]
144\stopTEX
145
146Typical parameters (in addition to those listed in \in {table} [tab:setupbtx])
147are presented in \in {table} [tab:setupbtxcite].
148
149\startplacetable
150  [reference=tab:setupbtxcite,
151   location=force,
152   list= {\TEXcode{\setupbtx [cite]} parameters},
153   title={\cindex{setupbtx}\TEXcode{\setupbtx[cite]} parameters}]
154\starttabulate [|Tr|l|l|]
155\NC alternative \NC num               \NC default cite form \NC \NR
156\NC left        \NC                   \NC opening string    \NC \NR
157\NC right       \NC                   \NC closing string    \NC \NR
158\NC inbetween   \NC \Cindex{btxspace} \NC  \NC \NR
159\NC range       \NC \TEXcode{\endash} \NC  \NC \NR
160\NC command     \NC                   \NC  \NC \NR
161\NC style       \NC                   \NC  \NC \NR
162\NC sorttype    \NC normal            \NC  \NC \NR
163\NC compress    \NC yes               \NC  \NC \NR
164\stoptabulate
165\stopplacetable
166
167A demonstration of how these parameters can be manipulated in an individual
168\TEXcode {\cite} call is shown in \in{table} [tab:authorconversion], which also
169illustrates the different ways of formatting names.
170
171\startplacetable
172  [title={\TEXcode{authorconversion}},
173   reference=tab:authorconversion]
174\starttabulate [|Tl|p|]
175\NC ac            \NC \TEXcode{\cite[alternative=author,etallimit=,authorconversion=ac][article]} \NC \NR
176\HL
177\NC name          \NC \cite[alternative=author,etallimit=,authorconversion=name]         [article] \NC \NR
178\NC normal        \NC \cite[alternative=author,etallimit=,authorconversion=normal]       [article] \NC \NR
179\NC normalshort   \NC \cite[alternative=author,etallimit=,authorconversion=normalshort]  [article] \NC \NR
180\NC inverted      \NC \cite[alternative=author,etallimit=,authorconversion=inverted]     [article] \NC \NR
181\NC invertedshort \NC \cite[alternative=author,etallimit=,authorconversion=invertedshort][article] \NC \NR
182\stoptabulate
183\stopplacetable
184
185\stopsubsubject
186
187\startsubsubject [title=Setups]
188
189The next step in the customization of citation variants is through the overlaying
190of setups that handle the actual rendering of the citation. These rarely will
191need to be changed as most tuning can be done through the adjustment of
192parameters such as those given above. \startfootnote An exception is for special
193features, such as in the \index {style+APA}\TEXcode {apa} specification where a
194missing date is replaced by the notation \quotation {n..d.}. \stopfootnote
195
196It is to be pointed|-|out that original citation variants can be easily added. As
197an example, imagine that one might like to access the field \TEXcode {abstract}
198that is normally not rendered (like many other unused dataset fields). One would
199start by defining a parameter \Index {namespace} inheriting from the \TEXcode
200{cite} \Index {namespace}, followed by a simple setup (remember that the \TEXcode
201{apa} specification is currently active):
202
203\startbuffer
204\definebtx[apa:cite:abstract][apa:cite]
205\startsetups btx:apa:cite:abstract
206    \btxcitereference
207    \btxflush{abstract}
208\stopsetups
209
210\startparagraph [style=slanted]
211\cite[abstract][boekplan::Hagen2010metafun]
212\stopparagraph
213\stopbuffer
214
215\cindex{definebtx}
216\cindex{btxcitereference}
217\cindex{btxflush}
218\cindex{cite}
219\cindex{startsetups}
220\cindex{stopsetups}
221\tindex{::}
222
223\typeTEXbuffer
224
225\getbuffer
226
227If no special manipulation is known, the field with the same name (if found) will
228be simply flushed. This will only work, however, if the field is identified as
229either required or optional, that is not flagged as ignored in \in {table}
230[tab:fields] (see also \in {Appendix} [ch:datasetfields]). For the sake of the
231present manual, the field \BTXcode{abstract} has been defined as optional for the
232\BTXcode{book} entry in the specification's lua file.
233
234But don't expect too much support for such low|-|level rendering control.
235
236\stopsubsubject
237
238\stopsection
239
240\startsection[title=Custom list renderings,reference=sec:list]
241
242The rendering of lists is much more flexible and configurable than the rendering
243of citation markers. This is because the nature of data to be rendered requires
244many tools and helpers to deal with all of the eventual contingencies inherent in
245describing bibliographical references.
246
247The same \quote {low|-|level} formatting parameters used for citations also apply
248for \TEXcode {list} \Index {namespace}s, although their settings may differ from
249those of the citations. Consider the \index {style+APA}\TEXcode {apa} style that
250specifies the use of \tindex {others} \quotation {et al.} in citations but
251\quotation {\textellipsis} in the bibliography list, \quotation {and} in
252citations but \quotation {\textampersand} in lists, last names only in \TEXcode
253{authoryear} citations, etc.
254
255\startsubsubject[title=Bibliographies as lists]
256
257At another level of detail, the bibliography list is rendered in a standard
258\CONTEXT\ list environment that can be setup using the command \Cindex
259{setupbtxlist} (which is only \Cindex {setuplist} working in the protected
260bibliography environment: \TEXcode {btx}). The root settings, appropriate for a
261numbered bibliography list, are:
262
263\cindex{setuplist}
264
265\startTEX
266\setuplist
267  [btx]
268  [prefixstopper=:,
269   state=start,
270   alternative=a,
271   before=\blank,
272   after=\blank]
273\stopTEX
274
275whereas an unnumbered, author|-|year sorted list might have:
276
277\cindex{setupbtxlist}
278
279\startTEX
280\setupbtxlist
281  [apa]
282  [alternative=paragraph,
283   margin=3\emwidth]
284\stopTEX
285
286as already seen in \in {Chapter} [ch:renderings]. The above demonstrate that
287\cindex {setupbtxlist}\TEXcode {\setupbtxlist[name]} is just a synonym for
288\cindex {setuplist}\TEXcode {\setuplist[btx:name]}.
289
290\cindex   {setupbtxlist}
291\showsetup[setupbtxlist]
292
293\cindex   {setuplist}
294\showsetup[setuplist] % too big for the page!
295
296Each specification will have its own list \Index {namespace} (\TEXcode
297{btx:specification}) that inherits from the root \TEXcode {btx} \Index
298{namespace}. This model of inheritance holds true for the citation and list
299details as described earlier.
300
301\stopsubsubject
302
303\startsubsubject[title=Setups]
304
305The layout of the information presented in the list is entirely controlled
306through setups, with the help of some underlying \LUA\ code organizing the data
307stored in the dataset. These setups rely on further setups as well as some
308convenient helpers or defined special commands. To understand this, consider as
309an illustration the setups defined for the \TEXcode {default} specification
310(taken from the source file \type {publ-imp-default.mkvi}):
311
312\cindex{startsetups}
313\cindex{stopsetups}
314\cindex{texdefinition}
315\cindex{btxperiod}
316
317\startTEX
318\startsetups btx:default:list:book
319    \texdefinition{btx:default:author}
320    \texdefinition{btx:default:title}
321    \texdefinition{btx:default:editionset}
322    \texdefinition{btx:default:publisher}
323    \texdefinition{btx:default:year}
324    \btxperiod
325\stopsetups
326\stopTEX
327
328\cindex{startsetups}
329\cindex{stopsetups}
330\cindex{texdefinition}
331\cindex{btxperiod}
332
333\startTEX
334\startsetups btx:default:list:article
335    \texdefinition{btx:default:author}
336    \texdefinition{btx:default:title}
337    \texdefinition{btx:default:journal}
338    \texdefinition{btx:default:year}
339    \btxperiod
340\stopsetups
341\stopTEX
342
343This specification could be extended to handle publication categories other than
344\TEXcode {book} and \TEXcode {article} simply by defining an additional setup,
345\emphasis {almost} (see the following).
346
347\stopsubsubject
348
349\startsubsubject[title=\LUA\ tables]
350
351The qualification above is to bring attention to an important \LUA\ component
352that is defined in a companion source file: \TEXcode {publ-imp-default.lua}. This
353file defines a hierarchical \LUA\ table containing an element \TEXcode
354{categories} that itself contains the entries \TEXcode {book}, \TEXcode
355{article}, etc. The entries for each \Index {category} themselves contain the
356entries \index {field+required}\TEXcode {required} and \index
357{field+optional}\TEXcode {optional} listing the dataset fields that are to be
358used. Any field that is not declared either \index {field+required}required or
359\index {field+optional}optional will be \index {field+ignored}\emphasis
360{ignored}. \startfootnote The difference between \index {field+required}\quote
361{required} and \index {field+optional}\quote {optional} is only a question of
362diagnostics as described in the Appendices. Their functional meaning is rather
363\quote {handled} in contrast to \index {field+ignored}\quote {ignored}.
364\stopfootnote Note that if a category is \emphasis {not} declared in this \LUA\
365table, than \emphasis {all} of its fields will be considered \index
366{field+optional}\quote {optional}. Thus, ignoring this level of control and
367simply defining additional setups might be sufficient for most use.
368
369The advantage of the \LUA\ table is a great simplification of the logic of the
370helper setups. Fields that might be irrelevant for one category yet used in
371another can be tested; if the field is to be \index {field+ignored}\quote
372{ignored}, than a fetch will return nothing. Indeed, the above two setups could
373be replaced by a single setup as \TEXcode {journal} is irrelevant and thus
374ignored for the \Index {category} \TEXcode {book} but not for the \Index
375{category} \TEXcode {journal}. However, an oversimplification such as just
376described would be rather confusing and would not extend well to a more complete
377specification (such as \index {style+APA}\TEXcode {apa}) handling many different
378categories.
379
380Note, as well, that fields \index {field+ignored}\quote {ignored} for certain
381\index {category}categories in the bibliography list will also be ignored in
382citations. For example, choosing to ignore \TEXcode {title} in some \Index
383{category}, say \TEXcode {article}, will cause \TEXcode {\cite[title]} to fail
384(return nothing) when referring to an entry of that category. In the example
385shown in \in {section} [sec:customcite], the abstract field would not return
386anything if it did not appear in the \LUA\ table.
387
388This \LUA\ table also defines (as \index {type}\quote {types}, outside of \index
389{category}\quote {categories}) what fields are to be interpreted as names, what
390fields are to eventually be interpreted as a number or range of numbers, and what
391fields are to be interpreted specially as a (semi|-|colon) separated list (for
392example, \TEXcode {keywords}).
393
394A more subtle feature of the \LUA\ level is the notion of \index {set}\quote
395{sets}. Related fields can be grouped into sets, for example.
396
397\startLUA
398book = {
399    sets = {
400        author     = { "author", "editor", },
401        editionset = { "edition", "volume", "number" },
402    },
403},
404\stopLUA
405
406A fetch of the set \text {author} (i.e. \cindex {btxflush}\TEXcode
407{\btxflush{author}}, to be described below) will return the \text {author} field
408if this is present, otherwise it will return the \TEXcode {editor} field, for an
409edited book, for example. Testing for the presence of a set in a data entry is
410equivalent to a logical \emphasis{or} in testing for the presence of each element
411of the set. This mechanism can appear confusing yet it has served to greatly
412simplify the logic of the various setups. \startfootnote Sometimes a \Index {set}
413will be defined using the same name as its first element, sometimes it can be
414given a unique name (typically ending in \quote {set}). \stopfootnote
415
416The \TEXcode {author} set is a bit special given its use in the \TEXcode
417{authoryear(s)}, \TEXcode {authornum}, and \TEXcode {short} citation variants.
418This \Index {set} determines what fields are to enter into the citation \Index
419{tag}s, a generalization of the notion of author. For example, in the \index
420{style+APA}APA style, this set would include the author, editor, or title fields
421or an article and the author, editor, publisher, or title fields for a book and
422still other sequences of fields for other categories of publications.
423
424\stopsubsubject
425
426\startsubsubject[title=Defined helpers]
427
428Fetching data from the dataset is performed using the command encountered above:
429\TEXcode {\btxflush}. If the field (or no elements of the set) is not found, then
430this command will return nothing.
431
432\cindex   {btxflush}
433\showsetup[btxflush]
434
435Alternately, one might need to explicitly test for the presence or absence of the
436field, in order to conditionally include punctuation or not to trigger
437separators, for example. Three test macros have been defined:
438
439\startplacetable [title=Conditional macros]
440\cindex{btxdoifelse}
441\cindex{btxdoif}
442\cindex{btxdoifnot}
443\startTEX
444\btxdoifelse{fieldname}{action when found}{action when not found}
445\btxdoif    {fieldname}{action when found}
446\btxdoifnot {fieldname}                   {action when not found}
447\stopTEX
448\stopplacetable
449
450In many cases, the readability can be improved by using further setups, for
451instance:
452
453\cindex{btxdoifelse}
454\cindex{fastsetup}
455
456\startTEX
457\btxdoifelse {author} {
458    \fastsetup{btx:apa:author:yes}
459} {
460    \fastsetup{btx:apa:author:nop}
461}
462\stopTEX
463
464Note that the choice between using setups (defined through \Cindex {startsetups}
465\unknown\ \Cindex {stopsetups} and recalled through \Cindex {fastsetup}) versus
466textdefinitions without arguments (defined through \Cindex {starttexdefinition}
467\unknown\ \Cindex {stoptexdefinition} and recalled through \Cindex
468{texdefinition}) is a question of taste and opportunity. One should keep in mind
469not get carried away abusing setups and texdefinitions for simple code fragments
470that are to be used uniquely.
471
472An extra conditional is available for testing interactivity:
473
474\cindex{btxdoifelseinteraction}
475
476\startTEX
477\btxdoifelseinteraction{action when true}{action when false}
478\stopTEX
479
480There is also a conditional \Cindex {btxinteractive} which is more efficient,
481although in practice efficiency is not so important here.
482
483\blank
484
485In addition to \Index {set}s, there are derived or special fields such as
486\TEXcode {num} (for the reference number), \TEXcode {suffix} (to be appended in
487some cases to \TEXcode {year}), \TEXcode {short} (for names), etc. These all can
488be retrieved using \Cindex {btxflush}. Sometimes one might want to force access
489to a particular data field (such as \TEXcode {author}) rather than eventually an
490element of a \Index {set} having the same name. There are three basic commands to
491flush data and a few others to flush associated information:
492
493\startplacetable [title=Field access macros]
494\starttabulate[|l|l|]
495\NC \Cindex{btxflush}     \NC fetch a derived or explicit field \NC \NR
496\NC \Cindex{btxdetail}    \NC fetch a derived field (e.g.\ \TEXcode {short}) \NC \NR
497\NC \Cindex{btxfield}     \NC fetch a explicit field (e.g.\ \TEXcode {year}) \NC \NR
498\NR
499\NC \Cindex{btxfieldname} \NC fetch the field name \NC \NR
500\NC \Cindex{btxfieldtype} \NC fetch the field type (e.g.\ \TEXcode{author}, \TEXcode{range}, \unknown \NC \NR
501\NC \Cindex{btxfoundname} \NC fetch the field name of a set (or field) \NC \NR
502\NC \Cindex{btxfoundtype} \NC fetch the field type of a set (or field) \NC \NR
503\stoptabulate
504\stopplacetable
505
506A few helpers are provided to inject symbols but also take care of leading and
507trailing spaces: \startfootnote These make use of the \CONTEXT\ command \Cindex
508{removeunwantedspaces}. There is also a \quote {secret} command \TEXcode
509{\removepunctuation} that can be quite useful, but also lead to undesired
510consequences when wielded blindly! \stopfootnote
511
512\startplacetable [title=Punctuation macros]
513\starttabulate[|||]
514\NC \Cindex{btxspace}                  \NC before \btxspace        after \NC \NR
515\NC \Cindex{btxnbsp}                   \NC before \btxnbsp         after \NC \NR
516\NC \Cindex{btxnobreakspace}           \NC before \btxnobreakspace after (same as \Cindex {btxnbsp}) \NC \NR
517\NC \Cindex{btxperiod}                 \NC before \btxperiod       after \NC \NR
518\NC \Cindex{btxcomma}                  \NC before \btxcomma        after \NC \NR
519\NC \Cindex{btxcommabreak}             \NC before \btxcommabreak   after (allows a line break) \NC \NR
520\NC \Cindex{btxleftparenthesis}        \NC before \btxleftparenthesis  after \NC \NR
521\NC \Cindex{btxrightparenthesis}       \NC before \btxrightparenthesis after \NC \NR
522\NC \Cindex{btxrightparenthesiscomma}  \NC before \btxrightparenthesiscomma after \NC \NR
523\NC \Cindex{btxrightparenthesisperiod} \NC before \btxrightparenthesisperiod after \NC \NR
524\NC \Cindex{btxleftbracket}            \NC before \btxleftbracket  after \NC \NR
525\NC \Cindex{btxrightbracket}           \NC before \btxrightbracket after \NC \NR
526\NC \Cindex{btxrightbracketcomma}      \NC before \btxrightbracketcomma after \NC \NR
527\NC \Cindex{btxrightbracketperiod}     \NC before \btxrightbracketperiod after \NC \NR
528\stoptabulate
529\stopplacetable
530
531\stopsubsubject
532
533\starthiding
534
535Normally you can use \TEXcode {\btxfield} or \TEXcode {\btxflush} as derived
536fields just like analyzed author fields are flushed in a special way. There is
537experimental support for so called manipulators. You can for instance say this:
538
539\starttyping
540\btxflush{lowercase->title}
541\stoptyping
542
543A sequence of manipulators is applied to fetched field, where a sequence is one
544or more manipulators:
545
546\starttyping
547\btxflush{stripperiod->uppercase->title}
548\stoptyping
549
550Some actions are recognized (built|-|in) but you can also use actions from other
551namespaces, like in:
552
553\starttyping
554\btxflush{converters.Word -> title}
555\stoptyping
556
557Watch how we can use spaces around the \TEXcode {->} which is nicer for wrapped
558around usage. Eventually, we might put some more function in the default
559namespace.
560
561So, the previous example setup can be rewritten as:
562
563\starttyping
564\btxdoif {title} {
565   \bold{\btxfield{title}}
566   \btxcomma
567}
568\stoptyping
569
570There is a special command for rendering a (combination) of authors:
571
572\starttyping
573\btxflushauthor{author}
574\btxflushauthor{editor}
575\btxflushauthor[inverted]{editor}
576\stoptyping
577
578Instead of the last one you can also use:
579
580\starttyping
581\btxflushauthorinverted{editor}
582\stoptyping
583
584You can use a (configurable) default or pass directives: Valid directives are
585
586\starttabulate
587\NC \bf conversion          \NC \bf rendering        \NC \NR
588\HL
589\NC \TEXcode{inverted}      \NC the Frog jr, Kermit  \NC \NR
590\NC \TEXcode{invertedshort} \NC the Frog jr, K       \NC \NR
591\NC \TEXcode{normal}        \NC Kermit, the Frog, jr \NC \NR
592\NC \TEXcode{normalshort}   \NC K, the Frog, jr      \NC \NR
593\stoptabulate
594
595The list itself is not a list in the sense of a regular \CONTEXT\ structure
596related list. We do use the list mechanism to keep track of used entries but that
597is mostly because we can then reuse filtering mechanisms. The actual rendering of
598a reference and entry runs on top of so called constructions (other examples of
599constructions are descriptions, enumerations and notes).
600
601\showsetup[setupbtxlist]
602
603You need to be aware what command is used to achieve the desired result. For
604instance, in order to put parentheses around a number reference you say:
605
606\starttyping
607\setupbtxlistvariant
608 [num]
609 [left=(,
610  right=)]
611\stoptyping
612
613If you want automated width calculations, the following does the trick:
614
615\starttyping
616\setupbtxrendering
617 [default]
618 [width=auto]
619\stoptyping
620
621but if you want to control it yourself you say something:
622
623\starttyping
624\setupbtxrendering
625 [width=none]
626
627\setupbtxlist
628 [default]
629 [width=3cm,
630  distance=\emwidth,
631  color=red,
632  headcolor=blue,
633  headalign=flushright]
634\stoptyping
635
636In most cases the defaults will work out fine.
637
638Normally the references are numbered using one counter for the whole document. If
639you want each list to have its own number, then you can set the \TEXcode
640{continue} parameter:
641
642\starttyping
643\setupbtxrendering[continue=no]
644\stoptyping
645
646In a similar fashion you can influence if references are included only once of in
647each list:
648
649\starttyping
650\setupbtxrendering[repeat=yes]
651\stoptyping
652
653\stophiding
654
655\stopsection
656
657\stopchapter
658
659\stopcomponent
660