Changes

Jump to navigation Jump to search
no edit summary
<h1>The databasedata­base</h1>
The <span tag="MKIV" style="font-style:sans;">bibTEX</span> format for­mat is rather popular pop­u­lar in the <span tag="MKIV" style="font-style:sans;">TEX</span> community com­mu­nity and even with its shortcomings short­com­ings it will stay around for a while. Many publication websites pub­li­ca­tion web­sites can export ex­port and many tools are available avail­able to work with this database formatdata­base for­mat. It is rather simple sim­ple and looks a bit like <span tag="MKIV" style="font-style:sans;">Lua</span> tablesta­bles. Unfortunately Un­for­tu­nately the content con­tent can be polluted pol­luted with non-standardized stan­dard­ized <span tag="MKIV" style="font-style:sans;">TEX</span> commands com­mands which complicates com­pli­cates pre- or postprocessing outside post­pro­cess­ing out­side <span tag="MKIV" style="font-style:sans;">TEX</span>. In that sense a <span tag="MKIV" style="font-style:sans;">bibTEX</span> database data­base is often of­ten not coded neutrallyneu­trally. Some limitationslim­i­ta­tions, like the use of commands com­mands to encode accented characters en­code ac­cented char­ac­ters root in the <span tag="MKIV" style="font-style:sans;">ascii</span> world and can be bypassed by­passed by using us­ing <span tag="MKIV" style="font-style:sans;">utf</span> instead in­stead (as handled somewhat han­dled some­what in <span tag="MKIV" style="font-style:sans;">LATEX</span> through extensions ex­ten­sions such as <tt style="color:rgb(0,102,102);font-size:100%;" >bibtex8</tt>).
<p></p>
The normal nor­mal way to deal with a bibliography bib­li­og­ra­phy is to refer re­fer to entries using en­tries us­ing a unique tag or key. When a list of entries en­tries is typesettype­set, this reference ref­er­ence can be used for linking purposeslink­ing pur­poses. The typeset type­set list can be processed and sorted using us­ing the <tt style="color:rgb(0,102,102);font-size:100%;" >bibtex</tt> program pro­gram that converts con­verts the database data­base into something some­thing more <span tag="MKIV" style="font-style:sans;">TEX</span> friendly (a <tt style="color:rgb(0,102,102);font-size:100%;" >.bbl</tt> file). I never used the program myself pro­gram my­self (nor bibliographiesbib­li­ogra­phies) so I will not go into too much detail de­tail here, if only because be­cause all I say can be wrong.
<p></p>
In <span tag="MKIV" style="font-style:sans;">ConTEXt</span> we no longer use the <tt style="color:rgb(0,102,102);font-size:100%;" >bibtex</tt> programpro­gram: we just use database data­base files and deal with the necessary manipulations directly nec­es­sary ma­nip­u­la­tions di­rectly in <span tag="MKIV" style="font-style:sans;">ConTEXt</span>. One or more such databases data­bases can be used and combined com­bined with additional entries defined ad­di­tional en­tries de­fined within the documentdoc­u­ment. We can have several sev­eral such datasets active ac­tive at the same time.
<p></p>
A <span tag="MKIV" style="font-style:sans;">bibTEX</span> file looks like this:
</pre>
<p></p>
Normally Nor­mally a value is given between be­tween quotes (or curly bracketsbrack­ets) but single sin­gle words are also OK (there is no real benefit ben­e­fit in not using us­ing quotes, so we advise ad­vise to always al­ways use them). There can be many more fields and instead in­stead of strings one can use predefined shortcutspre­de­fined short­cuts. The title ti­tle for example ex­am­ple quite often contains of­ten con­tains <span tag="MKIV" style="font-style:sans;">TEX</span> macros. Some fields, like <tt style="color:rgb(0,102,102);font-size:100%;" >pages</tt> have funny characters char­ac­ters such as the endash en­dash (typically typ­i­cally as <tt style="color:rgb(0,102,102);font-size:100%;" >--</tt>) so we have a mixture mix­ture of data and typesetting directivestype­set­ting di­rec­tives. If you are covering cov­er­ing non--english referenceseng­lish ref­er­ences, you often of­ten need characters char­ac­ters that are not in the <span tag="MKIV" style="font-style:sans;">ascii</span> subset sub­set but <span tag="MKIV" style="font-style:sans;">ConTEXt</span> is quite happy with <span tag="MKIV" style="font-style:sans;">utf</span>. If your database data­base file uses old-fashioned fash­ioned <span tag="MKIV" style="font-style:sans;">TEX</span> accent commands ac­cent com­mands then these will be internally converted automatically in­ter­nally con­verted au­to­mat­i­cally to <span tag="MKIV" style="font-style:sans;">utf</span>. Commands Com­mands (macros) are converted con­verted to an indirect in­di­rect call, which is quite robustro­bust.
<p></p>
The <span tag="MKIV" style="font-style:sans;">bibTEX</span> files are loaded in memory mem­ory as <span tag="MKIV" style="font-style:sans;">Lua</span> table ta­ble but can be converted con­verted to <span tag="MKIV" style="font-style:sans;">xml</span> so that we can access ac­cess them in a more flexible flex­i­ble way, but that is a subject sub­ject for specialistsspe­cial­ists.
<p></p>
In the old <span tag="MKIV" style="font-style:sans;">MkII</span> setup we have two kinds of entriesen­tries: the ones that come from the <span tag="MKIV" style="font-style:sans;">bibTEX</span> run and user supplied sup­plied ones. We no longer rely on <span tag="MKIV" style="font-style:sans;">bibTEX</span> output out­put but we do still support sup­port the user supplied definitionssup­plied de­f­i­n­i­tions. These were in fact prepared pre­pared in a way that suits the processing pro­cess­ing of <span tag="MKIV" style="font-style:sans;">bibTEX</span> generated entriesgen­er­ated en­tries. The next variant reflects vari­ant re­flects the <span tag="MKIV" style="font-style:sans;">ConTEXt</span> recoding re­cod­ing of the old <span tag="MKIV" style="font-style:sans;">bibTEX</span> outputout­put.
<pre style="color:rgb(102,0,102);font-size:100%">\startpublication[k=Hagen:Second,t=article,a={Hans Hagen},y=2013,s=HH01]
</pre>
<p></p>
The split <tt style="color:rgb(0,102,102);font-size:100%;" >\artauthor</tt> fields are collapsed col­lapsed into a single sin­gle <tt style="color:rgb(0,102,102);font-size:100%;" >author</tt> field as we deal with the splitting split­ting later when it gets parsed in <span tag="MKIV" style="font-style:sans;">Lua</span>. The <tt style="color:rgb(0,102,102);font-size:100%;" >\artauthor</tt> syntax syn­tax is only kept around for backward compatibility back­ward com­pat­i­bil­ity with the previous pre­vi­ous use of <span tag="MKIV" style="font-style:sans;">bibTEX</span>.
<p></p>
In the new setup we support sup­port these variants vari­ants as well:
<pre style="color:rgb(102,0,102);font-size:100%">\startpublication[k=Hagen:Third,t=article]
</pre>
<p></p>
Because internally Be­cause in­ter­nally the entries en­tries are <span tag="MKIV" style="font-style:sans;">Lua</span> tablesta­bles, we also support loading sup­port load­ing of <span tag="MKIV" style="font-style:sans;">Lua</span> based definitionsde­f­i­n­i­tions:
<pre style="color:rgb(102,0,102);font-size:100%">return {
</pre>
<p></p>
Files set up like this can be loaded too. The following fol­low­ing <span tag="MKIV" style="font-style:sans;">xml</span> input in­put is rather close to this, and is also accepted ac­cepted as inputin­put.
<pre style="color:rgb(102,0,102);font-size:100%"><?xml version="2.0" standalone="yes" ?>
</pre>
<p></p>
Todo: Add some remarks re­marks about loading EndNote load­ing End­Note and RIS formatsfor­mats, but first we need to complete com­plete the tag mapping map­ping (on Alan’s plate).
<p></p>
So the user has a rather wide choice of formatting for­mat­ting style for bibliography database bib­li­og­ra­phy data­base files.
You can load more data than you actually ac­tu­ally need. Only entries en­tries that are referred re­ferred to explicitly ex­plic­itly through the <tt style="color:rgb(0,102,102);font-size:100%;" >\cite</tt> and <tt style="color:rgb(0,102,102);font-size:100%;" >\nocite</tt> commands com­mands will be shown in lists. We will cover these details de­tails later.
<h1>Commands Com­mands in entriesen­tries</h1>
One unfortunate aspect commonly un­for­tu­nate as­pect com­monly found in <span tag="MKIV" style="font-style:sans;">bibTEX</span> files is that they often contain of­ten con­tain <span tag="MKIV" style="font-style:sans;">TEX</span> commandscom­mands. Even worse is that there is no standard stan­dard on what these commands com­mands can be and what they mean, at least not formallyfor­mally, as <span tag="MKIV" style="font-style:sans;">bibTEX</span> is a program intended pro­gram in­tended to be used with many variants vari­ants of <span tag="MKIV" style="font-style:sans;">TEX</span> style: plain, <span tag="MKIV" style="font-style:sans;">LATEX</span>, and othersoth­ers. This means that we need to define de­fine our use of these typesetting commandstype­set­ting com­mands. HoweverHow­ever, in most cases, they are just abbreviations ab­bre­vi­a­tions or font switches and these are often of­ten known. ThereforeThere­fore, <span tag="MKIV" style="font-style:sans;">ConTEXt</span> will try to resolve re­solve them before reporting be­fore re­port­ing an issueis­sue. In the log file there is a list of commands com­mands that has been seen in the loaded databasesdata­bases. For instancein­stance, loading load­ing <tt style="color:rgb(0,102,102);font-size:100%;" >tugboat.bib</tt> gives a long list of commands com­mands of which we show a small set here:
<pre style="color:rgb(102,0,102);font-size:100%">publications > start used btx commands
</pre>
<p></p>
You can define unknown commandsde­fine un­known com­mands, or overload existing definitions over­load ex­ist­ing de­f­i­n­i­tions in the following fol­low­ing way:
<pre style="color:rgb(102,0,102);font-size:100%">\definebtxcommand\TUB {TUGboat}
</pre>
<p></p>
Unknown commands Un­known com­mands do not stall processingpro­cess­ing, but their names are then typeset type­set in a mono- spaced font so they probably prob­a­bly stand out for proofreadingproof­read­ing. You can access ac­cess the commands com­mands with <tt style="color:rgb(0,102,102);font-size:100%;" >\btxcommand{...}</tt>, as in:
<pre style="color:rgb(102,0,102);font-size:100%">commands like \btxcommand{MySpecialCommand} are handled in an indirect way
</pre>
<p></p>
As this is an undefined command un­de­fined com­mand we get: “commands “com­mands like MySpecialCommand MySpe­cial­Com­mand are handled han­dled in an indirect in­di­rect way”.
<p></p>
??
<h1>Datasets</h1>
Normally Nor­mally in a document doc­u­ment you will use only one bibliographic databasebib­li­o­graphic data­base, whether or not distributed dis­trib­uted over multiple mul­ti­ple files. Nevertheless Nev­er­the­less we support multiple databases sup­port mul­ti­ple data­bases as well which is why we talk of datasets insteadin­stead. A dataset is loaded with the <tt style="color:rgb(0,102,102);font-size:100%;" >\usebtxdataset</tt> commandcom­mand. Although currently Al­though cur­rently it is not necessary nec­es­sary to define de­fine a (defaultde­fault) dataset you can best do this because be­cause in the future fu­ture we might provide pro­vide more optionsop­tions. Here are some examplesex­am­ples:
<pre style="color:rgb(102,0,102);font-size:100%">\definebtxdataset[standard]
</pre>
<p></p>
These three suffixes suf­fixes are understood un­der­stood by the loader. Here the dataset has the name <tt style="color:rgb(0,102,102);font-size:100%;" >standard</tt> and the three database data­base files are merged, where later entries having en­tries hav­ing the same tag overload previous over­load pre­vi­ous ones. Definitions De­f­i­n­i­tions in the document doc­u­ment source (coded in <span tag="MKIV" style="font-style:sans;">TEX</span> speak) are also added, and they are saved for successive suc­ces­sive runs. This means that if you load and define entriesde­fine en­tries, they will be known at a next run beforehandbe­fore­hand, so that references ref­er­ences to them are independent in­de­pen­dent of when loading load­ing and definitions de­f­i­n­i­tions take place.
<div style="border:thin solid black;" >TODO
<span style="font-style:oblique;" > setup definition setupbtxdataset </span >
</div>
<p></p>
In this document doc­u­ment we use some example databasesex­am­ple data­bases, so let’s load one of them now:
<pre style="color:rgb(102,0,102);font-size:100%">\definebtxdataset[example]
</pre>
<p></p>
You can ask for an overview of entries en­tries in a dataset with:
<pre style="color:rgb(102,0,102);font-size:100%">\showbtxdatasetfields[example]
<table>
<tr><td>tag</td><td>categorycat­e­gory</td><td>fields</td></tr><tr><td>demo-001</td><td>book</td><td>author index title au­thor in­dex ti­tle year</td></tr><tr><td>demo-002</td><td>book</td><td>crossref index cross­ref in­dex year</td></tr><tr><td>demo-003</td><td>book</td><td>author comment index title au­thor com­ment in­dex ti­tle year</td></tr><tr><td>demo-004</td><td>book</td><td>author comment index title au­thor com­ment in­dex ti­tle year</td></tr><tr><td>demo-005</td><td>book</td><td>author au­thor doi index in­dex pages serial title se­r­ial ti­tle url year</td></tr>
</table>
<p></p>
You can set the current active cur­rent ac­tive dataset with
<pre style="color:rgb(102,0,102);font-size:100%">\setbtxdataset[standard]
</pre>
<p></p>
but most publicationpub­li­ca­tion-related commands accept optional arguments re­lated com­mands ac­cept op­tional ar­gu­ments that denote de­note the dataset and references ref­er­ences to entries en­tries can be prefixed pre­fixed with a dataset identifieriden­ti­fier.. More about that later.
<p></p>
Sometimes Some­times you want to check a databasedata­base. One way of doing do­ing that is the followingfol­low­ing:
<pre style="color:rgb(102,0,102);font-size:100%">\definebtxdataset[check]
</pre>
<p></p>
The database data­base like like this:
<p></p>
The completeness com­plete­ness check shows (with green field names) the required re­quired fields and when one is missing miss­ing this is indicated in­di­cated in red. In blue we show what gets inheritedin­her­ited. <table><tr><td>tag</td><td>test1</td></tr><tr><td>au­thor</td><td>Au­thor 1</td></tr><tr><td>ed­i­tor</td><td>Thomas Schmitz and Alan Braslau</td></tr><tr><td>ti­tle</td><td>Ti­tle 1</td></tr><tr><td>pub­lisher</td><td>Thomas and Alan</td></tr><tr><td>year</td><td>2015</td></tr><tr><td>vol­ume</td><td>1</td></tr></table>  <table><tr><td>tag</td><td>test2 => test1</td></tr><tr><td>au­thor</td><td>Au­thor 2</td></tr><tr><td>ed­i­tor</td><td>Thomas Schmitz and Alan Braslau</td></tr><tr><td>ti­tle</td><td>Ti­tle 2</td></tr><tr><td>pub­lisher</td><td>Thomas and Alan</td></tr><tr><td>year</td><td>2015</td></tr><tr><td>vol­ume</td><td>2</td></tr></table>  <table><tr><td>tag</td><td>test3</td></tr><tr><td>au­thor</td><td>Au­thor 3</td></tr><tr><td>ti­tle</td><td>Ti­tle 3</td></tr><tr><td>pub­lisher</td><td>[miss­ing]</td></tr><tr><td>year</td><td>[miss­ing]</td></tr></table> 
<h1>RenderingsRen­der­ings</h1>
A list of publications pub­li­ca­tions can be rendered ren­dered at any place in the documentdoc­u­ment. A database data­base can be much larger than needed for a documentdoc­u­ment. The same is true for the fields that make up an entryen­try. Here is the list of fields that are currently handledcur­rently han­dled, but of course there can be additional ad­di­tional ones:
<p></p>
<tt style="color:rgb(0,102,102);font-size:100%;" >abstract</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >address</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >annotate</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >assignee</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >author</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >bibnumber</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >booktitle</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >chapter</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >comment</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >country</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >day</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >dayfiled</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >doi</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >edition</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >editor</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >eprint</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >howpublished</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >institution</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >isbn</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >issn</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >journal</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >key</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >keyword</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >keywords</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >language</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >lastchecked</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >month</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >monthfiled</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >names</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >nationality</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >note</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >notes</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >number</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >organization</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >pages</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >publisher</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >revision</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >school</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >series</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >size</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >title</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >type</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >url</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >volume</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >year</tt>, <tt style="color:rgb(0,102,102);font-size:100%;" >yearfiled</tt>
<p></p>
If you want to see what publications pub­li­ca­tions are in the databasedata­base, the easiest eas­i­est way is to ask for a complete com­plete list:
<pre style="color:rgb(102,0,102);font-size:100%">\definebtxrendering
</pre>
<p></p>
This gives:1 HagenHa­gen, H. and OttenOt­ten, T. (1996). Typesetting education documentsType­set­ting ed­u­ca­tion doc­u­ments.2 Scarso, L. (2021). Designing De­sign­ing high speed trains.3 author au­thor (year). titleti­tle. pages p.
<p></p>
The rendering itself ren­der­ing it­self is somewhat complex some­what com­plex to set up because be­cause we have not only many different standards dif­fer­ent stan­dards but also many fields that can be set up. This means that there are several commands involvedsev­eral com­mands in­volved. Often Of­ten there is a prescribed pre­scribed style to render bibliographic descriptionsren­der bib­li­o­graphic de­scrip­tions, for example ex­am­ple <tt style="color:rgb(0,102,102);font-size:100%;" >apa</tt>. A rendering ren­der­ing is setup and defined de­fined with:
<div style="border:thin solid black;" >TODO
<span style="font-style:oblique;" > setup definition setupbtxrendering </span >
</div>
<p></p>
And a list of such descriptions de­scrip­tions is generated gen­er­ated with:
<div style="border:thin solid black;" >TODO
<span style="font-style:oblique;" > setup definition placebtxrendering </span >
</div>
<p></p>
A dataset can have all kind of entriesen­tries:
<p></p>
Each has its own rendering variantren­der­ing vari­ant. To keep things simple sim­ple we have their settings separatedset­tings sep­a­rated. HoweverHow­ever, these settings set­tings are shared for all rendering alternativesren­der­ing al­ter­na­tives. In practice prac­tice this is seldom sel­dom a problem prob­lem in a publication pub­li­ca­tion as only one rendering alternative ren­der­ing al­ter­na­tive will be activeac­tive. If this be not sufficientsuf­fi­cient, you can always al­ways group local settings lo­cal set­tings in a setup and hook that into the specific renderingspe­cific ren­der­ing.
<div style="border:thin solid black;" >TODO
<span style="font-style:oblique;" > setup definition setupbtxlistvariant </span >
</div>
<p></p>
Examples Ex­am­ples of list variants vari­ants are:
<p></p>
<tt style="color:rgb(102,0,102);font-size:100%;" >setupbtxlistvariant : artauthor</tt>
<p></p>
The exact rendering ex­act ren­der­ing of list entries en­tries is determined de­ter­mined by the <tt style="color:rgb(0,102,102);font-size:100%;" >alternative</tt> key and defaults de­faults to <tt style="color:rgb(0,102,102);font-size:100%;" >apa</tt> which uses definitions de­f­i­n­i­tions from <tt style="color:rgb(0,102,102);font-size:100%;" >publ-imp-apa.mkiv</tt>. If you look at that file you will see that each category cat­e­gory has its own setup. You may also notice no­tice that additional ad­di­tional tests are needed to make sure that empty fields don’t trigger separators trig­ger sep­a­ra­tors and such.
<p></p>
There are a couple cou­ple of accessors ac­ces­sors and helpers to get the job done. When you want to fetch a field from the current entry cur­rent en­try you use <tt style="color:rgb(0,102,102);font-size:100%;" >\btxfield</tt>. In most cases you want to make sure this field has a value, for instance because in­stance be­cause you don’t want fences or punctuation punc­tu­a­tion that belongs be­longs to a field.
<pre style="color:rgb(102,0,102);font-size:100%">\btxdoif {title} {
</pre>
<p></p>
An extra conditional ex­tra con­di­tional is available avail­able for testing interactivitytest­ing in­ter­ac­tiv­ity:
<pre style="color:rgb(102,0,102);font-size:100%">\btxdoifelseinteraction{action when true}{action when false}
</pre>
<p></p>
In addition ad­di­tion there is also a conditional con­di­tional <tt style="color:rgb(0,102,102);font-size:100%;" >\btxinteractive</tt> which is more efficientef­fi­cient, although al­though in practice efficiency prac­tice ef­fi­ciency is not so important im­por­tant here.
<p></p>
There are three commands com­mands to flush data:
<table>
<tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >\btxfield</tt></td><td>fetch a explicit ex­plicit field (e.g. <tt style="color:rgb(0,102,102);font-size:100%;" >year</tt>)</td></tr><tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >\btxdetail</tt></td><td>fetch a derived de­rived field (e.g. <tt style="color:rgb(0,102,102);font-size:100%;" >short</tt>)</td></tr><tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >\btxflush</tt></td><td>fetch a derived de­rived or explicit ex­plicit field</td></tr>
</table>
<p></p>
Normally Nor­mally you can use <tt style="color:rgb(0,102,102);font-size:100%;" >\btxfield</tt> or <tt style="color:rgb(0,102,102);font-size:100%;" >\btxflush</tt> as derived de­rived fields just like analyzed author an­a­lyzed au­thor fields are flushed in a special spe­cial way.
<p></p>
You can improve readability im­prove read­abil­ity by using setupsus­ing se­tups, for instancein­stance:
<pre style="color:rgb(102,0,102);font-size:100%">\btxdoifelse {author} {
</pre>
<p></p>
Keep in mind that normally nor­mally you don’t need to mess with definitions de­f­i­n­i­tions like this because standard rendering be­cause stan­dard ren­der­ing styles are providedpro­vided. These styles use a few helpers that inject symbols in­ject sym­bols but also take care of leading lead­ing and trailing trail­ing spaces:
<table>
<tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >\btxspace</tt></td><td>before afterbe­fore af­ter</td></tr><tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >\btxperiod</tt></td><td>beforebe­fore. afteraf­ter</td></tr><tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >\btxcomma</tt></td><td>beforebe­fore, afteraf­ter</td></tr><tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >\btxlparent</tt></td><td>before be­fore (afteraf­ter</td></tr><tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >\btxrparent</tt></td><td>beforebe­fore) afteraf­ter</td></tr><tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >\btxlbracket</tt></td><td>before be­fore [afteraf­ter</td></tr><tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >\btxrbracket</tt></td><td>beforebe­fore] afteraf­ter</td></tr>
</table>
<p></p>
So, the previous example pre­vi­ous ex­am­ple setup can be rewritten rewrit­ten as:
<pre style="color:rgb(102,0,102);font-size:100%">\btxdoif {title} {
</pre>
<p></p>
There is a special command spe­cial com­mand for rendering ren­der­ing a (combinationcom­bi­na­tion) of authorsau­thors:
<pre style="color:rgb(102,0,102);font-size:100%">\btxflushauthor{author}
</pre>
<p></p>
Instead In­stead of the last one you can also use:
<pre style="color:rgb(102,0,102);font-size:100%">\btxflushauthorinverted{editor}
</pre>
<p></p>
You can use a (configurablecon­fig­urable) default de­fault or pass directivesdi­rec­tives: Valid directives di­rec­tives are
<table>
<tr><td>conversioncon­ver­sion</td><td>renderingren­der­ing</td></tr><tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >inverted</tt></td><td>the Frog jr, KermitKer­mit</td></tr>
<tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >invertedshort</tt></td><td>the Frog jr, K</td></tr>
<tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >normal</tt></td><td>KermitKer­mit, the Frog, jr</td></tr>
<tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >normalshort</tt></td><td>K, the Frog, jr</td></tr>
</table>
<h1>CitationsCi­ta­tions</h1>
Citations Ci­ta­tions are references ref­er­ences to bibliographic entries bib­li­o­graphic en­tries that normally nor­mally show up in lists someplace some­place in the documentdoc­u­ment: at the end of a chapterchap­ter, in an appendixap­pen­dix, at the end of an articlear­ti­cle, etc. We discussed dis­cussed the rendering ren­der­ing of these lists in the previous chapterpre­vi­ous chap­ter. A citation ci­ta­tion is normally nor­mally pretty short as its main purpose pur­pose is to refer re­fer uniquely to a more detailed descriptionde­tailed de­scrip­tion. But, there are several sev­eral ways to referre­fer, which is why the citation subsystem ci­ta­tion sub­sys­tem is configurable con­fig­urable and extensibleex­ten­si­ble. Just look at the following commandsfol­low­ing com­mands:
<pre style="color:rgb(102,0,102);font-size:100%">\cite[author][example::demo-003]
<div>
<div>(Hans Hagen Ha­gen and Ton OttenOt­ten)</div><div>(Hans Hagen Ha­gen and Ton Otten Ot­ten (1996))</div><div>(Hans Hagen Ha­gen and Ton OttenOt­ten, 1996)</div><div>(Hans Hagen Ha­gen and Ton OttenOt­ten, Luigi Scarso)</div><div>(Hans Hagen Ha­gen and Ton Otten Ot­ten (1996), Luigi Scarso (2021))</div><div>(Hans Hagen Ha­gen and Ton OttenOt­ten, 1996, Luigi Scarso, 2021)</div><div>(Luigi Scarso, Hans Hagen Ha­gen and Ton OttenOt­ten)</div><div>(Luigi Scarso (2021), Hans Hagen Ha­gen and Ton Otten Ot­ten (1996))</div><div>(Luigi Scarso, 2021, Hans Hagen Ha­gen and Ton OttenOt­ten, 1996)</div>
</div>
<p></p>
The first argument ar­gu­ment is optionalop­tional.
<div style="border:thin solid black;" >TODO
<span style="font-style:oblique;" > setup definition cite </span >
</div>
<p></p>
You can tune the way a citation ci­ta­tion shows up:
<pre style="color:rgb(102,0,102);font-size:100%">\setupbtxcitevariant[author] [sorttype=author,color=darkyellow]
</pre>
<p></p>
Here we sort the authors au­thors and color the citationci­ta­tion:
<div>
<div>(Hans Hagen Ha­gen and Ton OttenOt­ten, Luigi Scarso)</div><div>(Hans Hagen Ha­gen and Ton Otten Ot­ten (1996), Luigi Scarso (2021))</div><div>(Hans Hagen Ha­gen and Ton OttenOt­ten, 1996, Luigi Scarso, 2021)</div>
</div>
<p></p>
For reasons rea­sons of backward compatibility back­ward com­pat­i­bil­ity the <tt style="color:rgb(0,102,102);font-size:100%;" >\cite</tt> command com­mand is a bit picky about spaces between be­tween the two argumentsar­gu­ments, of which the first is optionalop­tional. This is a consequence con­se­quence of allowing al­low­ing its use with the key specified between spec­i­fied be­tween curly brackets brack­ets as is the traditional practicetra­di­tional prac­tice. (We do encourage en­cour­age users to adopt the more coherent co­her­ent <span tag="MKIV" style="font-style:sans;">ConTEXt</span> syntax syn­tax by using us­ing square brackets brack­ets for keywords key­words and reserving re­serv­ing curly brackets brack­ets to regroup re­group text to be typesettype­set.)
<p></p>
The <tt style="color:rgb(0,102,102);font-size:100%;" >\citation</tt> command com­mand is synonymous syn­ony­mous but is more flexible flex­i­ble with respect re­spect to spacing spac­ing of its argumentsar­gu­ments:
<pre style="color:rgb(102,0,102);font-size:100%">\citation[author] [example::demo-004,demo-003]
</pre>
<p></p>
There is a whole bunch of cite options op­tions and more can be easily definedeas­ily de­fined.
<table>
<tr><td>key</td><td>renderingren­der­ing</td></tr><tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >author</tt></td><td>(authorau­thor)</td></tr><tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >authornum</tt></td><td>[author au­thor [btx error er­ror 1]]</td></tr><tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >authoryear</tt></td><td>(author au­thor (year))</td></tr><tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >authoryears</tt></td><td>(authorau­thor, year)</td></tr>
<tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >doi</tt></td><td>[todo: doi]</td></tr>
<tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >key</tt></td><td>[demo-005]</td></tr>
<tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >none</tt></td><td></td></tr>
<tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >num</tt></td><td>[[btx error er­ror 1]]</td></tr>
<tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >page</tt></td><td>pages</td></tr>
<tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >serial</tt></td><td>[5]</td></tr>
<p></p>
Because Be­cause we are dealing deal­ing with database input data­base in­put and because be­cause we generally gen­er­ally need to manipulate entriesma­nip­u­late en­tries, much of the work is delegated del­e­gated to <span tag="MKIV" style="font-style:sans;">Lua</span>. This makes it easier eas­ier to maintain main­tain and extend ex­tend the code. Of course <span tag="MKIV" style="font-style:sans;">TEX</span> still does the renderingren­der­ing. The typographic details ty­po­graphic de­tails are controlled con­trolled by parameters pa­ra­me­ters but not all are used in all variantsvari­ants. As with most <span tag="MKIV" style="font-style:sans;">ConTEXt</span> commandscom­mands, it starts out with a general gen­eral setup commandcom­mand:
<div style="border:thin solid black;" >TODO
<span style="font-style:oblique;" > setup definition setupbtxcitevariant </span >
</div>
<p></p>
On top of that we can define instances de­fine in­stances that inherit either in­herit ei­ther from a given parent par­ent or from the topmost top­most setup.
<div style="border:thin solid black;" >TODO
<span style="font-style:oblique;" > setup definition definebtxcitevariant </span >
</div>
<p></p>
But, specific variants spe­cific vari­ants can have them overloadedover­loaded:
<p></p>
<tt style="color:rgb(102,0,102);font-size:100%;" >setupbtxcitevariant : author</tt>
</table>
A citation variant ci­ta­tion vari­ant is defined de­fined in several sev­eral steps and if you really re­ally want to know the dirty detailsde­tails, you should look into the <tt style="color:rgb(0,102,102);font-size:100%;" >publ-imp-*.mkiv</tt> files. Here we stick to the conceptcon­cept.
<pre style="color:rgb(102,0,102);font-size:100%">\startsetups btx:cite:author
</pre>
<p></p>
You can overload over­load such setups se­tups if needed, but that only makes sense when you cannot configure can­not con­fig­ure the rendering ren­der­ing with parameterspa­ra­me­ters. The <tt style="color:rgb(0,102,102);font-size:100%;" >\btxcitevariant</tt> command com­mand is one of the build in accessors ac­ces­sors and it calls out to <span tag="MKIV" style="font-style:sans;">Lua</span> where more complex manipulation com­plex ma­nip­u­la­tion takes place if needed. If no manipulation ma­nip­u­la­tion is known, the field with the same name (if found) will be flushed. A command com­mand like <tt style="color:rgb(0,102,102);font-size:100%;" >\btxcitevariant</tt> assumes as­sumes that a dataset and specific spe­cific tag has been set. This is normally nor­mally done in the wrapper wrap­per macros, like <tt style="color:rgb(0,102,102);font-size:100%;" >\cite</tt>. For special purposes spe­cial pur­poses you can use these commands com­mands
<pre style="color:rgb(102,0,102);font-size:100%">\setbtxdataset[example]
</pre>
<p></p>
But don’t expect ex­pect too much support sup­port for such low level rendering controlren­der­ing con­trol.
<p></p>
Unless Un­less you use <tt style="color:rgb(0,102,102);font-size:100%;" >criterium=all</tt> only publications pub­li­ca­tions that are cited will end up in the lists. You can force a citation ci­ta­tion into a list using us­ing <tt style="color:rgb(0,102,102);font-size:100%;" >\usecitation</tt>, for exampleex­am­ple:
<pre style="color:rgb(102,0,102);font-size:100%">\usecitation[example::demo-004,demo-003]
</pre>
<p></p>
This command com­mand has two synonymssyn­onyms: <tt style="color:rgb(0,102,102);font-size:100%;" >\nocite</tt> and <tt style="color:rgb(0,102,102);font-size:100%;" >\nocitation</tt> so you can choose whatever what­ever fits you best.
<div style="border:thin solid black;" >TODO
<span style="font-style:oblique;" > setup definition nocite </span >
<h1>The LUA view</h1>
Because Be­cause we manage man­age data at the <span tag="MKIV" style="font-style:sans;">Lua</span> end it is tempting tempt­ing to access ac­cess it there for other purposespur­poses. This is fine as long as you keep in mind that aspects as­pects of the implementation im­ple­men­ta­tion may change over time, although al­though this is unlikely un­likely once the modules become stablemod­ules be­come sta­ble.
<p></p>
The entries en­tries are collected col­lected in datasets and each set has a unique name. In this document doc­u­ment we have the set named <tt style="color:rgb(0,102,102);font-size:100%;" >example</tt>. A dataset table ta­ble has several sev­eral fields, and probably prob­a­bly the one of most interest in­ter­est is the <tt style="color:rgb(0,102,102);font-size:100%;" >luadata</tt> field. Each entry en­try in this table describes ta­ble de­scribes a publicationpub­li­ca­tion:
<pre style="color:rgb(102,0,102);font-size:100%">t={
}
</pre>
This is <tt style="color:rgb(0,102,102);font-size:100%;" >publications.datasets.example.luadata["demo-001"]</tt>. There can be a companion entry com­pan­ion en­try in the parallel par­al­lel <tt style="color:rgb(0,102,102);font-size:100%;" >details</tt> tableta­ble.
<pre style="color:rgb(102,0,102);font-size:100%">t={
}
</pre>
These details de­tails are accessed ac­cessed as <tt style="color:rgb(0,102,102);font-size:100%;" >publications.datasets.example.details["demo-001"]</tt> and by using us­ing a separate table sep­a­rate ta­ble we can overload over­load fields in the original entry without losing orig­i­nal en­try with­out los­ing the originalorig­i­nal.
<p></p>
You can loop over the entries using regular en­tries us­ing reg­u­lar <span tag="MKIV" style="font-style:sans;">Lua</span> code combined com­bined with <span tag="MKIV" style="font-style:sans;">MkIV</span> helpers:
<pre style="color:rgb(102,0,102);font-size:100%">local dataset = publications.datasets.example
</pre>
<p></p>
This results re­sults in:
<table>
<tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >demo-001</tt></td><td>Hag13</td><td><span tag="MKIV" style="font-style:sans;">bibTEX</span>, the <span tag="MKIV" style="font-style:sans;">ConTEXt</span> way</td></tr>
<tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >demo-002</tt></td><td>Hag14</td><td><span tag="MKIV" style="font-style:sans;">bibTEX</span>, the <span tag="MKIV" style="font-style:sans;">ConTEXt</span> way</td></tr>
<tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >demo-003</tt></td><td>HO96</td><td>Typesetting education documentsType­set­ting ed­u­ca­tion doc­u­ments</td></tr><tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >demo-004</tt></td><td>Sca21</td><td>Designing De­sign­ing high speed trains</td></tr><tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >demo-005</tt></td><td>aut00</td><td>titleti­tle</td></tr>
</table>
<p></p>
You can manipulate ma­nip­u­late a dataset after loadingaf­ter load­ing. Of course this assumes as­sumes that you know what kind of content con­tent you have and what you need for renderingren­der­ing. As example ex­am­ple we load a small dataset.
<pre style="color:rgb(102,0,102);font-size:100%">\definebtxdataset[drumming]
</pre>
<p></p>
Because Be­cause we’re going go­ing to do some <span tag="MKIV" style="font-style:sans;">Lua</span>, we could also have loaded the dataset with:
<pre style="color:rgb(102,0,102);font-size:100%">publications.load("drumming","mkiv-publications.lua","lua")
</pre>
<p></p>
The dataset has three entriesen­tries:
<p></p>
As you can see, we can have a subtitlesub­ti­tle. We will combine com­bine the title ti­tle and subtitle sub­ti­tle into one:
<pre style="color:rgb(102,0,102);font-size:100%">\startluacode
</pre>
<p></p>
We can now typeset type­set the entries en­tries with:
<pre style="color:rgb(102,0,102);font-size:100%">\definebtxrendering[drumming][dataset=drumming,method=dataset]
</pre>
<p></p>
Because Be­cause we just want to show the entriesen­tries, and have no citations ci­ta­tions that force them to be shown, we have to the <tt style="color:rgb(0,102,102);font-size:100%;" >method</tt> to <tt style="color:rgb(0,102,102);font-size:100%;" >dataset</tt>.1 Har­ri­son, G. (1996). Rhyth­mic Il­lu­sions, for drums. Warner. Har­ri­son, G. (1999). Rhyth­mic Per­spec­tives, a mul­ti­di­men­sional study of rhyth­mic com­po­si­tion. Al­fred Pub­lish­ing Co., Inc. Har­ri­son, G. and Bran­ham, T. (2010). Rhyth­mic De­signs, a study of prac­ti­cal cre­ativ­ity. Hud­son.
<h1>The XML view</h1>
The <tt style="color:rgb(0,102,102);font-size:100%;" >luadata</tt> table ta­ble can be converted con­verted into an <span tag="MKIV" style="font-style:sans;">xml</span> representationrep­re­sen­ta­tion. This is a follow fol­low up on earlier experiments ear­lier ex­per­i­ments with an <span tag="MKIV" style="font-style:sans;">xml</span>-only approachap­proach. I decided de­cided in the end to stick to a <span tag="MKIV" style="font-style:sans;">Lua</span> approach ap­proach and provide pro­vide some simple sim­ple <span tag="MKIV" style="font-style:sans;">xml</span> support sup­port in additionad­di­tion.
<p></p>
Once a dataset is accessible ac­ces­si­ble as <span tag="MKIV" style="font-style:sans;">xml</span> tree, you can use the regular reg­u­lar <tt style="color:rgb(0,102,102);font-size:100%;" >\xml...</tt> commandscom­mands. We start with loading load­ing a dataset, in this case from just one file.
<pre style="color:rgb(102,0,102);font-size:100%">\usebtxdataset[tugboat][tugboat.bib]
</pre>
<p></p>
The dataset has to be converted con­verted to <span tag="MKIV" style="font-style:sans;">xml</span>:
<pre style="color:rgb(102,0,102);font-size:100%">\convertbtxdatasettoxml[tugboat]
</pre>
<p></p>
The tree is now accessible ac­ces­si­ble by its root reference ref­er­ence <tt style="color:rgb(0,102,102);font-size:100%;" >btx:tugboat</tt>. If we want simple sim­ple field access ac­cess we can use a few setupsse­tups:
<pre style="color:rgb(102,0,102);font-size:100%">\startxmlsetups btx:initialize
</pre>
<p></p>
The two setups se­tups are predefined pre­de­fined in the core alreadyal­ready, but you might want to change them. They are applied ap­plied in for instancein­stance:
<pre style="color:rgb(102,0,102);font-size:100%">\starttabulate[|||]
<table>
<tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >tag</tt></td><td>HagenHa­gen:TB17-1-54</td></tr><tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >title</tt></td><td>PPCHTEX: typesetting chemical formulas type­set­ting chem­i­cal for­mu­las in TEX</td></tr>
</table>
<table>
<tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >tag</tt></td><td>HagenHa­gen:TB17-1-54</td></tr><tr><td><tt style="color:rgb(0,102,102);font-size:100%;" >title</tt></td><td>PPCHTEX: typesetting chemical formulas type­set­ting chem­i­cal for­mu­las in TEX</td></tr>
</table>
<p></p>
Here is another examplean­other ex­am­ple:
<pre style="color:rgb(102,0,102);font-size:100%">\startxmlsetups btx:row
<table>
<tr><td>Knuth:TB10-1-31</td><td>Typesetting Concrete MathematicsType­set­ting Con­crete Math­e­mat­ics</td></tr><tr><td>Knuth:TB10-1-8</td><td>TEX would find it difficult dif­fi­cult …</td></tr><tr><td>Knuth:TB10-3-325</td><td>The new versions ver­sions of TEX and MF</td></tr><tr><td>Knuth:TB10-4-529</td><td>The errors er­rors of TEX</td></tr><tr><td>Knuth:TB11-1-13</td><td>Virtual Vir­tual Fonts: More Fun for Grand WizardsWiz­ards</td></tr><tr><td>Knuth:TB11-2-165</td><td>Exercises Ex­er­cises for TEX: The ProgramPro­gram</td></tr><tr><td>Knuth:TB11-4-489</td><td>The future fu­ture of TEX and MF</td></tr>
<tr><td>Knuth:TB11-4-497</td><td>Arthur Lee Samuel, 1901--1990</td></tr>
<tr><td>Knuth:TB11-4-499</td><td>Answers An­swers to Exercises Ex­er­cises for TEX: The ProgramPro­gram</td></tr><tr><td>Knuth:TB12-2-313</td><td>Fixed-point glue settingset­ting: ErrataEr­rata</td></tr>
<tr><td>Knuth:TB14-4-387</td><td>Icons for TEX and MF</td></tr>
<tr><td>Knuth:TB17-1-29</td><td>Important message regarding Im­por­tant mes­sage re­gard­ing CM fonts</td></tr><tr><td>Knuth:TB2-3-5</td><td>The current cur­rent state of things</td></tr><tr><td>Knuth:TB3-1-10</td><td>Fixed-point glue settingDashan example set­ting­Dashan ex­am­ple of WEB</td></tr><tr><td>Knuth:TB31-2-121</td><td>An Earthshaking AnnouncementEarth­shak­ing An­nounce­ment</td></tr><tr><td>Knuth:TB4-2-64</td><td>A note on hyphenationhy­phen­ation</td></tr><tr><td>Knuth:TB5-1-4</td><td>TEX incunabulain­cunab­ula</td></tr><tr><td>Knuth:TB5-1-67</td><td>Comments Com­ments on quality qual­ity in publishingpub­lish­ing</td></tr><tr><td>Knuth:TB5-2-105</td><td>A course on MF programmingpro­gram­ming</td></tr><tr><td>Knuth:TB6-1-36</td><td>Recipes and fractionsfrac­tions</td></tr><tr><td>Knuth:TB7-2-101</td><td>The TEX logo in various var­i­ous fonts</td></tr><tr><td>Knuth:TB7-2-95</td><td>Remarks Re­marks to celebrate cel­e­brate the publication pub­li­ca­tion of Computers Com­put­ers & TypesettingType­set­ting</td></tr><tr><td>Knuth:TB8-1-14</td><td>Mixing Mix­ing right-to-left texts with left-to-right texts</td></tr><tr><td>Knuth:TB8-1-6</td><td>It happenedhap­pened: announcement an­nounce­ment of TEX 2.1</td></tr><tr><td>Knuth:TB8-1-73</td><td>Problem Prob­lem for a Saturday afternoonSat­ur­day af­ter­noon</td></tr><tr><td>Knuth:TB8-2-135</td><td>Fonts for digital dig­i­tal halftones</td></tr><tr><td>Knuth:TB8-2-210</td><td>Saturday morning problemDashsolutionSat­ur­day morn­ing prob­lem­Dash­so­lu­tion</td></tr><tr><td>Knuth:TB8-2-217</td><td>ReplyRe­ply: Printing Print­ing out selected se­lected pages</td></tr>
<tr><td>Knuth:TB8-3-309</td><td>Macros for Jill</td></tr>
<tr><td>Knuth:TB9-2-152</td><td>A Punk Meta-Font</td></tr>
<p></p>
A more extensive example ex­ten­sive ex­am­ple is the followingfol­low­ing. Of course this assumes as­sumes that you know what <span tag="MKIV" style="font-style:sans;">xml</span> support mechanisms sup­port mech­a­nisms and macros are availableavail­able.
<pre style="color:rgb(102,0,102);font-size:100%">\startxmlsetups btx:getkeys
<table>
<tr><td>1984</td><td>Knuth:TB5-1-67</td><td>Don Knuth</td></tr>
<tr><td>1984</td><td>Knuth:TB5-1-4</td><td>Donald Don­ald E. Knuth</td></tr><tr><td>1984</td><td>Knuth:TB5-2-105</td><td>Donald Don­ald E. Knuth</td></tr><tr><td>1985</td><td>Knuth:TB6-1-36</td><td>Donald Don­ald E. Knuth</td></tr><tr><td>1986</td><td>Knuth:TB7-2-101</td><td>Donald Don­ald E. Knuth</td></tr><tr><td>1987</td><td>Knuth:TB8-2-135</td><td>Donald Don­ald E. Knuth</td></tr><tr><td>1987</td><td>Knuth:TB8-3-309</td><td>Donald Don­ald E. Knuth</td></tr><tr><td>1988</td><td>Knuth:TB9-2-152</td><td>Donald Don­ald E. Knuth</td></tr><tr><td>1989</td><td>Knuth:TB10-3-325</td><td>Donald Don­ald E. Knuth</td></tr><tr><td>1989</td><td>Knuth:TB10-4-529</td><td>Donald Don­ald E. Knuth</td></tr><tr><td>1990</td><td>Knuth:TB11-4-489</td><td>Donald Don­ald E. Knuth</td></tr><tr><td>1993</td><td>Knuth:TB14-4-387</td><td>Donald Don­ald E. Knuth</td></tr><tr><td>1996</td><td>Knuth:TB17-1-29</td><td>Donald Don­ald E. Knuth</td></tr><tr><td>1987</td><td>Knuth:TB8-1-14</td><td>Donald Don­ald Knuth and Pierre MacKay</td></tr><tr><td>1981</td><td>Knuth:TB2-3-5</td><td>Donald Don­ald Knuth</td></tr><tr><td>1982</td><td>Knuth:TB3-1-10</td><td>Donald Don­ald Knuth</td></tr><tr><td>1983</td><td>Knuth:TB4-2-64</td><td>Donald Don­ald Knuth</td></tr><tr><td>1986</td><td>Knuth:TB7-2-95</td><td>Donald Don­ald Knuth</td></tr><tr><td>1987</td><td>Knuth:TB8-1-6</td><td>Donald Don­ald Knuth</td></tr><tr><td>1987</td><td>Knuth:TB8-1-73</td><td>Donald Don­ald Knuth</td></tr><tr><td>1987</td><td>Knuth:TB8-2-210</td><td>Donald Don­ald Knuth</td></tr><tr><td>1987</td><td>Knuth:TB8-2-217</td><td>Donald Don­ald Knuth</td></tr><tr><td>1989</td><td>Knuth:TB10-1-8</td><td>Donald Don­ald Knuth</td></tr><tr><td>1989</td><td>Knuth:TB10-1-31</td><td>Donald Don­ald Knuth</td></tr><tr><td>1990</td><td>Knuth:TB11-1-13</td><td>Donald Don­ald Knuth</td></tr><tr><td>1990</td><td>Knuth:TB11-2-165</td><td>Donald Don­ald Knuth</td></tr><tr><td>1990</td><td>Knuth:TB11-4-497</td><td>Donald Don­ald Knuth</td></tr><tr><td>1990</td><td>Knuth:TB11-4-499</td><td>Donald Don­ald Knuth</td></tr><tr><td>1991</td><td>Knuth:TB12-2-313</td><td>Donald Don­ald Knuth</td></tr><tr><td>2010</td><td>Knuth:TB31-2-121</td><td>Donald Don­ald Knuth</td></tr>
</table>
<p></p>
The original orig­i­nal data is stored in a <span tag="MKIV" style="font-style:sans;">Lua</span> tableta­ble, hashed by tag. Starting Start­ing with <span tag="MKIV" style="font-style:sans;">Lua</span> 5.2 each run of <span tag="MKIV" style="font-style:sans;">Lua</span> gets a different ordering dif­fer­ent or­der­ing of such a hash. In older versionsver­sions, when you looped over a hash, the order or­der was undefinedun­de­fined, but the same as long as you used the same binarybi­nary. This had the advantage ad­van­tage that successive suc­ces­sive runs, something some­thing we often of­ten have in document processing doc­u­ment pro­cess­ing gave consistent resultscon­sis­tent re­sults. In today’s to­day’s <span tag="MKIV" style="font-style:sans;">Lua</span> we need to do much more sorting sort­ing of hashes before be­fore we loop, especially es­pe­cially when we save multi--pass data. It is for this reason rea­son that the <span tag="MKIV" style="font-style:sans;">xml</span> tree is sorted by hash key by defaultde­fault. That way lookups (especially es­pe­cially the first of a set) give consistent outcomescon­sis­tent out­comes.
<h1>StandardsStan­dards</h1>
The rendering ren­der­ing of bibliographic entries bib­li­o­graphic en­tries is often standardized of­ten stan­dard­ized and prescribed pre­scribed by the publisherpub­lisher. If you submit sub­mit an article ar­ti­cle to a journaljour­nal, normally nor­mally it will be reformatted re­for­mat­ted (or even re- keyed) and the rendering ren­der­ing will happen hap­pen at the publishers pub­lish­ers end. In that case it may not matter mat­ter how entries en­tries were rendered ren­dered when writing writ­ing the publicationpub­li­ca­tion, because be­cause the publisher pub­lisher will do it his or her way. This means that most users probably prob­a­bly will stick to the standard stan­dard <span tag="MKIV" style="font-style:sans;">apa</span> rules and for them we provide pro­vide some configurationcon­fig­u­ra­tion. Because Be­cause we use setups se­tups it is easy to overload over­load specifics. If you really re­ally want to tweak, best look in the files that deal with it.
<p></p>
Many standards exist stan­dards ex­ist and support sup­port for other renderings ren­der­ings may be added to the core. Interested In­ter­ested users are invited in­vited to develop de­velop and to test alternate standard renderings according al­ter­nate stan­dard ren­der­ings ac­cord­ing to their needs.
<p></p>
Todo: maybe a list of categories cat­e­gories and fields.
<h1>Cleaning Clean­ing up</h1>
Although Al­though the <span tag="MKIV" style="font-style:sans;">bibTEX</span> format for­mat is reasonably rea­son­ably well definedde­fined, in practice prac­tice there are many ways to organize or­ga­nize the data. For instancein­stance, one can use predefined pre­de­fined string constants con­stants that get used (either ei­ther or not combined com­bined with other strings) later on. A string can be enclosed en­closed in curly braces or double dou­ble quotes. The strings can contain con­tain <span tag="MKIV" style="font-style:sans;">TEX</span> commands com­mands but these are not standardizedstan­dard­ized. The databases often data­bases of­ten have somewhat complex some­what com­plex ways to deal with special characters spe­cial char­ac­ters and the use of braces in their definition de­f­i­n­i­tion is also not normalizednor­mal­ized.
<p></p>
The most complex com­plex to deal with are the fields that contain con­tain names of peoplepeo­ple. At some point it might be needed to split a combination com­bi­na­tion of names into individual in­di­vid­ual ones that then get split into titleti­tle, first name, optional inbetweensop­tional in­be­tweens, surnamesur­name(s) and additionalad­di­tional: <tt style="color:rgb(0,102,102);font-size:100%;" >Prof. Dr. Alfred B. C. von Kwik Kwak Jr. II and P. Q. Olet</tt> is just one example ex­am­ple of this. The convention con­ven­tion seems to be not to use commas com­mas but <tt style="color:rgb(0,102,102);font-size:100%;" >and</tt> to separate sep­a­rate names (often of­ten each name will be specified spec­i­fied as lastnamelast­name, firstnamefirst­name).
<p></p>
We don’t see it as challenge chal­lenge nor as a duty to support sup­port all kinds of messy definitionsde­f­i­n­i­tions. Of course we try to be somewhat tolerantsome­what tol­er­ant, but you will be sure to get better results bet­ter re­sults if you use nicely setup, consistent databasescon­sis­tent data­bases.
<p></p>
Todo: maybe some examples ex­am­ples of bad.
<h1>TransitionTran­si­tion</h1>
In the original bibliography support module usage orig­i­nal bib­li­og­ra­phy sup­port mod­ule us­age was as follows fol­lows (example ex­am­ple taken from the contextgarden con­textgar­den wiki):
<pre style="color:rgb(102,0,102);font-size:100%">% engine=pdftex
</pre>
<p></p>
For <span tag="MKIV" style="font-style:sans;">MkIV</span> the modules mod­ules were partly rewritten rewrit­ten and ended up in the core so the two commands com­mands were no longer needed. The overhead associated over­head as­so­ci­ated with the automatic loading au­to­matic load­ing of the bibliography bib­li­og­ra­phy macros can be neglected ne­glected these days, so standardized modules stan­dard­ized mod­ules such as <tt style="color:rgb(0,102,102);font-size:100%;" >bib</tt> are all being be­ing moved to the core and do not need to be explicitly ex­plic­itly loaded.
<p></p>
The first <tt style="color:rgb(0,102,102);font-size:100%;" >\setupbibtex</tt> command com­mand in this example ex­am­ple is needed to bootstrap boot­strap the process: it tells what database data­base has to be processed by <span tag="MKIV" style="font-style:sans;">bibTEX</span> between be­tween runs. The second sec­ond <tt style="color:rgb(0,102,102);font-size:100%;" >\setuppublications</tt> command com­mand is optionalop­tional. Each citation ci­ta­tion (tagged with <tt style="color:rgb(0,102,102);font-size:100%;" >\cite</tt>) ends up in the list of publicationspub­li­ca­tions.
<p></p>
In the new approach ap­proach we no longer use <span tag="MKIV" style="font-style:sans;">bibTEX</span>so we don’t need to setup <span tag="MKIV" style="font-style:sans;">bibTEX</span>. Instead In­stead we define de­fine dataset(s). We also no longer set up publications pub­li­ca­tions with one commandcom­mand, but have split that up in renderingren­der­ing-, list-, and cite-variantsvari­ants. The basic ba­sic <tt style="color:rgb(0,102,102);font-size:100%;" >\cite</tt> command remainscom­mand re­mains. The above example becomesex­am­ple be­comes:
<pre style="color:rgb(102,0,102);font-size:100%">\definebtxdataset
</pre>
<p></p>
So, we have a few more commands com­mands to set up things. If you intend in­tend to use just a single sin­gle dataset and renderingren­der­ing, the above preamble pre­am­ble can be simplified sim­pli­fied to:
<pre style="color:rgb(102,0,102);font-size:100%">\usebtxdataset
</pre>
<p></p>
But keep in mind that compared com­pared to the old <span tag="MKIV" style="font-style:sans;">MkII</span> derived de­rived method we have moved some of the options op­tions to the renderingren­der­ing, list and cite setup variantsvari­ants.
<p></p>
Another difference An­other dif­fer­ence is now the use of lists. When you define de­fine a renderingren­der­ing, you also define de­fine a list. HoweverHow­ever, all entries en­tries are collected col­lected in a common com­mon list tagged <tt style="color:rgb(0,102,102);font-size:100%;" >btx</tt>. Although Al­though you will normally configure nor­mally con­fig­ure a rendering ren­der­ing you can still set some properties prop­er­ties of lists, but in that case you need to prefix pre­fix the list identifieriden­ti­fier. In the case of the above example ex­am­ple this is <tt style="color:rgb(0,102,102);font-size:100%;" >btx:document</tt>.
<h1>MLBIBTEXML­BIBTEX</h1>
Todo: how to plug in <span tag="MKIV" style="font-style:sans;">MLbibTEXML­bibTEX</span> for sorting sort­ing and other advanced operationsad­vanced op­er­a­tions.
<h1>ExtensionsEx­ten­sions</h1>
As <span tag="MKIV" style="font-style:sans;">TEX</span> and <span tag="MKIV" style="font-style:sans;">Lua</span> are both open and accessible ac­ces­si­ble in <span tag="MKIV" style="font-style:sans;">ConTEXt</span> it is possible pos­si­ble to extend ex­tend the functionality func­tion­al­ity of the bibliography related bib­li­og­ra­phy re­lated code. For instancein­stance, you can add extra loadersex­tra load­ers.
<pre style="color:rgb(102,0,102);font-size:100%">function publications.loaders.myformat(dataset,filename)
</pre>
<p></p>
This then permits loading per­mits load­ing a database data­base (into a dataset) with the commandcom­mand:
<pre style="color:rgb(102,0,102);font-size:100%">\usebtxdataset[standard][myfile.myformat]
</pre>
<p></p>
The <tt style="color:rgb(0,102,102);font-size:100%;" >myformat</tt> suffix suf­fix is recognized automaticallyrec­og­nized au­to­mat­i­cally. If you want to use another suffixan­other suf­fix, you can do this:
<pre style="color:rgb(102,0,102);font-size:100%">\usebtxdataset[standard][myformat::myfile.txt]
<h1>Notes</h1>
The move from external ex­ter­nal <span tag="MKIV" style="font-style:sans;">bibTEX</span> processing pro­cess­ing to internal processing in­ter­nal pro­cess­ing has the advantage ad­van­tage that we stay within the same run. In the traditional approach tra­di­tional ap­proach we had roughly the following fol­low­ing steps:
<div>
<div><span>• </span><span>the first run information in­for­ma­tion is collected col­lected and written writ­ten to file</span></div><div><span>• </span><span>after af­ter that run the <span tag="MKIV" style="font-style:sans;">bibTEX</span> program converts pro­gram con­verts that file to another an­other one</span></div><div><span>• </span><span>successive suc­ces­sive runs use that data for references ref­er­ences and producing pro­duc­ing lists</span></div>
</div>
<p></p>
In the <span tag="MKIV" style="font-style:sans;">MkIV</span> approach ap­proach the bibliographic database bib­li­o­graphic data­base is loaded in memory mem­ory each run and processing pro­cess­ing also happens hap­pens each run. On paper pa­per this looks less efficient ef­fi­cient but as <span tag="MKIV" style="font-style:sans;">Lua</span> is quite fast, in practice performance prac­tice per­for­mance is much betterbet­ter.
<p></p>
Probably Prob­a­bly most demanding de­mand­ing is the treatment treat­ment of authors au­thors as we have to analyze an­a­lyze names, split multiple authors mul­ti­ple au­thors and reassemble firstnamesre­assem­ble first­names, vons, surnames sur­names and juniorsju­niors. When we sort by author sorting vectors au­thor sort­ing vec­tors have to be made which also has a penalty. HoweverHow­ever, in practice prac­tice the user will not notice no­tice a performance degradationper­for­mance degra­da­tion. We did some tests with a list of 500.000 authorsau­thors, sorted them and typeset type­set them as list (producing pro­duc­ing some 5400 dense pages in a small font and with small marginsmar­gins). This is typical typ­i­cal one of these cases where using us­ing <span tag="MKIV" style="font-style:sans;">LuajitTEXLu­a­jitTEX</span> saves quite time. On my machine ma­chine it took just over 100 seconds sec­onds to get this done. Unfortunately Un­for­tu­nately not all operating systems performed op­er­at­ing sys­tems per­formed equally well: 32 bit versions ver­sions worked fine, but 64 bit <span tag="MKIV" style="font-style:sans;">linux</span> either ei­ther crashed (stalled) the machine ma­chine or ran out of memory mem­ory rather fast, while <span tag="MKIV" style="font-style:sans;">MacOSXMa­cOSX</span> and <span tag="MKIV" style="font-style:sans;">WindowsWin­dows</span> performed per­formed fine. In practice prac­tice you will never run into this, unless un­less you produce massive pro­duce mas­sive amounts of bibliographic entriesbib­li­o­graphic en­tries. <span tag="MKIV" style="font-style:sans;">LuaJITLu­a­JIT</span> has some benefits ben­e­fits but also some drawbacksdraw­backs.

Navigation menu