Changes

Jump to navigation Jump to search
2,878 bytes removed ,  18:06, 17 January 2014
no edit summary
==The data­basedatabase==
The bibTEX for­mat format is rather pop­u­lar popular in the TEX com­mu­nity community and even with its short­com­ings shortcomings it will stay around for a while. Many pub­li­ca­tion web­sites publication websites can ex­port export and many tools are avail­able available to work with this data­base for­matdatabase format. It is rather sim­ple simple and looks a bit like Lua ta­blestables. Un­for­tu­nately Unfortunately the con­tent content can be pol­luted polluted with non-stan­dard­ized standardized TEX com­mands commands which com­pli­cates complicates pre- or post­pro­cess­ing out­side postprocessing outside TEX. In that sense a bibTEX data­base database is of­ten often not coded neu­trallyneutrally. Some lim­i­ta­tionslimitations, like the use of com­mands commands to en­code ac­cented char­ac­ters encode accented characters root in the ascii world and can be by­passed bypassed by us­ing using utf in­stead instead (as han­dled some­what handled somewhat in LATEX through ex­ten­sions extensions such as <tt style="color:rgb(0,102,102);font-size:120%;" >bibtex8</tt>).
<br/>
The nor­mal normal way to deal with a bib­li­og­ra­phy bibliography is to re­fer refer to en­tries us­ing entries using a unique tag or key. When a list of en­tries entries is type­settypeset, this ref­er­ence reference can be used for link­ing pur­poseslinking purposes. The type­set typeset list can be processed and sorted us­ing using the <tt style="color:rgb(0,102,102);font-size:120%;" >bibtex</tt> pro­gram program that con­verts converts the data­base database into some­thing something more TEX friendly (a <tt style="color:rgb(0,102,102);font-size:120%;" >.bbl</tt> file). I never used the pro­gram my­self program myself (nor bib­li­ogra­phiesbibliographies) so I will not go into too much de­tail detail here, if only be­cause because all I say can be wrong.
<br/>
In ConTEXt we no longer use the <tt style="color:rgb(0,102,102);font-size:120%;" >bibtex</tt> pro­gramprogram: we just use data­base database files and deal with the nec­es­sary ma­nip­u­la­tions di­rectly necessary manipulations directly in ConTEXt. One or more such data­bases databases can be used and com­bined combined with ad­di­tional en­tries de­fined additional entries defined within the doc­u­mentdocument. We can have sev­eral several such datasets ac­tive active at the same time.
<br/>
A bibTEX file looks like this:
</pre>
<br/>
Nor­mally Normally a value is given be­tween between quotes (or curly brack­etsbrackets) but sin­gle single words are also OK (there is no real ben­e­fit benefit in not us­ing using quotes, so we ad­vise advise to al­ways always use them). There can be many more fields and in­stead instead of strings one can use pre­de­fined short­cutspredefined shortcuts. The ti­tle title for ex­am­ple example quite of­ten con­tains often contains TEX macros. Some fields, like <tt style="color:rgb(0,102,102);font-size:120%;" >pages</tt> have funny char­ac­ters characters such as the en­dash endash (typ­i­cally typically as <tt style="color:rgb(0,102,102);font-size:120%;" >--</tt>) so we have a mix­ture mixture of data and type­set­ting di­rec­tivestypesetting directives. If you are cov­er­ing covering non--eng­lish ref­er­encesenglish references, you of­ten often need char­ac­ters characters that are not in the ascii sub­set subset but ConTEXt is quite happy with utf. If your data­base database file uses old-fash­ioned fashioned TEX ac­cent com­mands accent commands then these will be in­ter­nally con­verted au­to­mat­i­cally internally converted automatically to utf. Com­mands Commands (macros) are con­verted converted to an in­di­rect indirect call, which is quite ro­bustrobust.
<br/>
The bibTEX files are loaded in mem­ory memory as Lua ta­ble table but can be con­verted converted to xml so that we can ac­cess access them in a more flex­i­ble flexible way, but that is a sub­ject subject for spe­cial­istsspecialists.
<br/>
In the old MkII setup we have two kinds of en­triesentries: the ones that come from the bibTEX run and user sup­plied supplied ones. We no longer rely on bibTEX out­put output but we do still sup­port support the user sup­plied de­f­i­n­i­tionssupplied definitions. These were in fact pre­pared prepared in a way that suits the pro­cess­ing processing of bibTEX gen­er­ated en­triesgenerated entries. The next vari­ant re­flects variant reflects the ConTEXt re­cod­ing recoding of the old bibTEX out­putoutput.
<pre style="color:rgb(102,0,102);font-size:120%">\startpublication[k=Hagen:Second,t=article,a={Hans Hagen},y=2013,s=HH01]
</pre>
<br/>
The split <tt style="color:rgb(0,102,102);font-size:120%;" >\artauthor</tt> fields are col­lapsed collapsed into a sin­gle single <tt style="color:rgb(0,102,102);font-size:120%;" >author</tt> field as we deal with the split­ting splitting later when it gets parsed in Lua. The <tt style="color:rgb(0,102,102);font-size:120%;" >\artauthor</tt> syn­tax syntax is only kept around for back­ward com­pat­i­bil­ity backward compatibility with the pre­vi­ous previous use of bibTEX.
<br/>
In the new setup we sup­port support these vari­ants variants as well:
<pre style="color:rgb(102,0,102);font-size:120%">\startpublication[k=Hagen:Third,t=article]
</pre>
<br/>
Be­cause in­ter­nally Because internally the en­tries entries are Lua ta­blestables, we also sup­port load­ing support loading of Lua based de­f­i­n­i­tionsdefinitions:
<pre style="color:rgb(102,0,102);font-size:120%">return {
</pre>
<br/>
Files set up like this can be loaded too. The fol­low­ing following xml in­put input is rather close to this, and is also ac­cepted accepted as in­putinput.
<pre style="color:rgb(102,0,102);font-size:120%"><?xml version="2.0" standalone="yes" ?>
</pre>
<br/>
Todo: Add some re­marks remarks about load­ing End­Note loading EndNote and RIS for­matsformats, but first we need to com­plete complete the tag map­ping mapping (on Alan’s plate).
<br/>
So the user has a rather wide choice of for­mat­ting formatting style for bib­li­og­ra­phy data­base bibliography database files.
You can load more data than you ac­tu­ally actually need. Only en­tries entries that are re­ferred referred to ex­plic­itly explicitly through the <tt style="color:rgb(0,102,102);font-size:120%;" >\cite</tt> and <tt style="color:rgb(0,102,102);font-size:120%;" >\nocite</tt> com­mands commands will be shown in lists. We will cover these de­tails details later.
==Com­mands Commands in en­triesentries==
One un­for­tu­nate as­pect com­monly unfortunate aspect commonly found in bibTEX files is that they of­ten con­tain often contain TEX com­mandscommands. Even worse is that there is no stan­dard standard on what these com­mands commands can be and what they mean, at least not for­mallyformally, as bibTEX is a pro­gram in­tended program intended to be used with many vari­ants variants of TEX style: plain, LATEX, and oth­ersothers. This means that we need to de­fine define our use of these type­set­ting com­mandstypesetting commands. How­everHowever, in most cases, they are just ab­bre­vi­a­tions abbreviations or font switches and these are of­ten often known. There­foreTherefore, ConTEXt will try to re­solve resolve them be­fore re­port­ing before reporting an is­sueissue. In the log file there is a list of com­mands commands that has been seen in the loaded data­basesdatabases. For in­stanceinstance, load­ing loading <tt style="color:rgb(0,102,102);font-size:120%;" >tugboat.bib</tt> gives a long list of com­mands commands of which we show a small set here:
<pre style="color:rgb(102,0,102);font-size:120%">publications > start used btx commands
</pre>
<br/>
You can de­fine un­known com­mandsdefine unknown commands, or over­load ex­ist­ing de­f­i­n­i­tions overload existing definitions in the fol­low­ing following way:
<pre style="color:rgb(102,0,102);font-size:120%">\definebtxcommand\TUB {TUGboat}
</pre>
<br/>
Un­known com­mands Unknown commands do not stall pro­cess­ingprocessing, but their names are then type­set typeset in a mono- spaced font so they prob­a­bly probably stand out for proof­read­ingproofreading. You can ac­cess access the com­mands commands with <tt style="color:rgb(0,102,102);font-size:120%;" >\btxcommand{...}</tt>, as in:
<pre style="color:rgb(102,0,102);font-size:120%">commands like \btxcommand{MySpecialCommand} are handled in an indirect way
</pre>
<br/>
As this is an un­de­fined com­mand undefined command we get: “com­mands “commands like MySpe­cial­Com­mand MySpecialCommand are han­dled handled in an in­di­rect indirect way”.
<br/>
??
==Datasets==
Nor­mally Normally in a doc­u­ment document you will use only one bib­li­o­graphic data­basebibliographic database, whether or not dis­trib­uted distributed over mul­ti­ple multiple files. Nev­er­the­less Nevertheless we sup­port mul­ti­ple data­bases support multiple databases as well which is why we talk of datasets in­steadinstead. A dataset is loaded with the <tt style="color:rgb(0,102,102);font-size:120%;" >\usebtxdataset</tt> com­mandcommand. Al­though cur­rently Although currently it is not nec­es­sary necessary to de­fine define a (de­faultdefault) dataset you can best do this be­cause because in the fu­ture future we might pro­vide provide more op­tionsoptions. Here are some ex­am­plesexamples:
<pre style="color:rgb(102,0,102);font-size:120%">\definebtxdataset[standard]
</pre>
<br/>
These three suf­fixes suffixes are un­der­stood understood by the loader. Here the dataset has the name <tt style="color:rgb(0,102,102);font-size:120%;" >standard</tt> and the three data­base database files are merged, where later en­tries hav­ing entries having the same tag over­load pre­vi­ous overload previous ones. De­f­i­n­i­tions Definitions in the doc­u­ment document source (coded in TEX speak) are also added, and they are saved for suc­ces­sive successive runs. This means that if you load and de­fine en­triesdefine entries, they will be known at a next run be­fore­handbeforehand, so that ref­er­ences references to them are in­de­pen­dent independent of when load­ing loading and de­f­i­n­i­tions definitions take place.
<div style="border:thin solid black;" >
<span style="font-style:oblique;" > setup definition setupbtxdataset </span >
</div>
<br/>
In this doc­u­ment document we use some ex­am­ple data­basesexample databases, so let’s load one of them now:
<pre style="color:rgb(102,0,102);font-size:120%">\definebtxdataset[example]
</pre>
<br/>
You can ask for an overview of en­tries entries in a dataset with:
<pre style="color:rgb(102,0,102);font-size:120%">\showbtxdatasetfields[example]
|
cat­e­gorycategory
|
|
au­thor in­dex ti­tle author index title year
|
|
cross­ref in­dex crossref index year
|
|
au­thor com­ment in­dex ti­tle author comment index title year
|
|
au­thor com­ment in­dex ti­tle author comment index title year
|
|
au­thor author doi in­dex index pages se­r­ial ti­tle serial title url year
|
<br/>
You can set the cur­rent ac­tive current active dataset with
<pre style="color:rgb(102,0,102);font-size:120%">\setbtxdataset[standard]
</pre>
<br/>
but most pub­li­ca­tionpublication-re­lated com­mands ac­cept op­tional ar­gu­ments related commands accept optional arguments that de­note denote the dataset and ref­er­ences references to en­tries entries can be pre­fixed prefixed with a dataset iden­ti­fieridentifier.. More about that later.
==Ren­der­ingsRenderings==
A list of pub­li­ca­tions publications can be ren­dered rendered at any place in the doc­u­mentdocument. A data­base database can be much larger than needed for a doc­u­mentdocument. The same is true for the fields that make up an en­tryentry. Here is the list of fields that are cur­rently han­dledcurrently handled, but of course there can be ad­di­tional additional ones:
<br/>
<tt style="color:rgb(0,102,102);font-size:120%;" >abstract</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >address</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >annotate</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >assignee</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >author</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >bibnumber</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >booktitle</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >chapter</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >comment</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >country</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >day</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >dayfiled</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >doi</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >edition</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >editor</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >eprint</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >howpublished</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >institution</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >isbn</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >issn</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >journal</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >key</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >keyword</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >keywords</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >language</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >lastchecked</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >month</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >monthfiled</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >names</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >nationality</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >note</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >notes</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >number</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >organization</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >pages</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >publisher</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >revision</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >school</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >series</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >size</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >title</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >type</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >url</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >volume</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >year</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >yearfiled</tt>
<br/>
If you want to see what pub­li­ca­tions publications are in the data­basedatabase, the eas­i­est easiest way is to ask for a com­plete complete list:
<pre style="color:rgb(102,0,102);font-size:120%">\definebtxrendering
</pre>
<br/>
This gives:1 Ha­genHagen, H. and Ot­tenOtten, T. (1996). Type­set­ting ed­u­ca­tion doc­u­ments2 Typesetting education documents2 Scarso, L. (2021). De­sign­ing Designing high speed trains3 au­thor author (year). ti­tle title pages p.
<br/>
The ren­der­ing it­self rendering itself is some­what com­plex somewhat complex to set up be­cause because we have not only many dif­fer­ent stan­dards different standards but also many fields that can be set up. This means that there are sev­eral com­mands in­volvedseveral commands involved. Of­ten Often there is a pre­scribed prescribed style to ren­der bib­li­o­graphic de­scrip­tionsrender bibliographic descriptions, for ex­am­ple example <tt style="color:rgb(0,102,102);font-size:120%;" >apa</tt>. A ren­der­ing rendering is setup and de­fined defined with:
<div style="border:thin solid black;" >
<span style="font-style:oblique;" > setup definition setupbtxrendering </span >
</div>
<br/>
And a list of such de­scrip­tions descriptions is gen­er­ated generated with:
<div style="border:thin solid black;" >
<span style="font-style:oblique;" > setup definition placebtxrendering </span >
</div>
<br/>
A dataset can have all kind of en­triesentries:
<br/>
<tt style="color:rgb(0,102,102);font-size:120%;" >article</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >book</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >booklet</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >conference</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >inbook</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >incollection</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >inproceedings</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >manual</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >mastersthesis</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >misc</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >phdthesis</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >proceedings</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >techreport</tt>, <tt style="color:rgb(0,102,102);font-size:120%;" >unpublished</tt>
<br/>
Each has its own ren­der­ing vari­antrendering variant. To keep things sim­ple simple we have their set­tings sep­a­ratedsettings separated. How­everHowever, these set­tings settings are shared for all ren­der­ing al­ter­na­tivesrendering alternatives. In prac­tice practice this is sel­dom seldom a prob­lem problem in a pub­li­ca­tion publication as only one ren­der­ing al­ter­na­tive rendering alternative will be ac­tiveactive. If this be not suf­fi­cientsufficient, you can al­ways always group lo­cal set­tings local settings in a setup and hook that into the spe­cific ren­der­ingspecific rendering.
<div style="border:thin solid black;" >
<span style="font-style:oblique;" > setup definition setupbtxlistvariant </span >
</div>
<br/>
Ex­am­ples Examples of list vari­ants variants are:
<br/>
<tt style="color:rgb(102,0,102);font-size:120%;" >setupbtxlistvariant : artauthor</tt>
<br/>
The ex­act ren­der­ing exact rendering of list en­tries entries is de­ter­mined determined by the <tt style="color:rgb(0,102,102);font-size:120%;" >alternative</tt> key and de­faults defaults to <tt style="color:rgb(0,102,102);font-size:120%;" >apa</tt> which uses de­f­i­n­i­tions definitions from <tt style="color:rgb(0,102,102);font-size:120%;" >publ-imp-apa.mkiv</tt>. If you look at that file you will see that each cat­e­gory category has its own setup. You may also no­tice notice that ad­di­tional additional tests are needed to make sure that empty fields don’t trig­ger sep­a­ra­tors trigger separators and such.
<br/>
There are a cou­ple couple of ac­ces­sors accessors and helpers to get the job done. When you want to fetch a field from the cur­rent en­try current entry you use <tt style="color:rgb(0,102,102);font-size:120%;" >\btxfield</tt>. In most cases you want to make sure this field has a value, for in­stance be­cause instance because you don’t want fences or punc­tu­a­tion punctuation that be­longs belongs to a field.
<pre style="color:rgb(102,0,102);font-size:120%">\btxdoif {title} {
</pre>
<br/>
An ex­tra con­di­tional extra conditional is avail­able available for test­ing in­ter­ac­tiv­itytesting interactivity:
<pre style="color:rgb(102,0,102);font-size:120%">\btxdoifelseinteraction{action when true}{action when false}
</pre>
<br/>
In ad­di­tion addition there is also a con­di­tional conditional <tt style="color:rgb(0,102,102);font-size:120%;" >\btxinteractive</tt> which is more ef­fi­cientefficient, al­though although in prac­tice ef­fi­ciency practice efficiency is not so im­por­tant important here.
<br/>
There are three com­mands commands to flush data:
{|
|
fetch a ex­plicit explicit field (e.g. <tt style="color:rgb(0,102,102);font-size:120%;" >year</tt>)
|
|
fetch a de­rived derived field (e.g. <tt style="color:rgb(0,102,102);font-size:120%;" >short</tt>)
|
|
fetch a de­rived derived or ex­plicit explicit field
|
<br/>
Nor­mally Normally you can use <tt style="color:rgb(0,102,102);font-size:120%;" >\btxfield</tt> or <tt style="color:rgb(0,102,102);font-size:120%;" >\btxflush</tt> as de­rived derived fields just like an­a­lyzed au­thor analyzed author fields are flushed in a spe­cial special way.
<br/>
You can im­prove read­abil­ity improve readability by us­ing se­tupsusing setups, for in­stanceinstance:
<pre style="color:rgb(102,0,102);font-size:120%">\btxdoifelse {author} {
</pre>
<br/>
Keep in mind that nor­mally normally you don’t need to mess with de­f­i­n­i­tions definitions like this be­cause stan­dard ren­der­ing because standard rendering styles are pro­videdprovided. These styles use a few helpers that in­ject sym­bols inject symbols but also take care of lead­ing leading and trail­ing trailing spaces:
{|
|
be­fore af­terbefore after
|
|
be­forebefore. af­terafter
|
|
be­forebefore, af­terafter
|
|
be­fore before (af­terafter
|
|
be­forebefore) af­terafter
|
|
be­fore before [af­terafter
|
|
be­forebefore] af­terafter
|
<br/>
So, the pre­vi­ous ex­am­ple previous example setup can be rewrit­ten rewritten as:
<pre style="color:rgb(102,0,102);font-size:120%">\btxdoif {title} {
</pre>
<br/>
There is a spe­cial com­mand special command for ren­der­ing rendering a (com­bi­na­tioncombination) of au­thorsauthors:
<pre style="color:rgb(102,0,102);font-size:120%">\btxflushauthor{author}
</pre>
<br/>
In­stead Instead of the last one you can also use:
<pre style="color:rgb(102,0,102);font-size:120%">\btxflushauthorinverted{editor}
</pre>
<br/>
You can use a (con­fig­urableconfigurable) de­fault default or pass di­rec­tivesdirectives: Valid di­rec­tives directives are
{|
|
con­ver­sionconversion
|
|
ren­der­ingrendering
|
|
the Frog jr, Ker­mitKermit
|
|
Ker­mitKermit, the Frog, jr
|
==Ci­ta­tionsCitations==
Ci­ta­tions Citations are ref­er­ences references to bib­li­o­graphic en­tries bibliographic entries that nor­mally normally show up in lists some­place someplace in the doc­u­mentdocument: at the end of a chap­terchapter, in an ap­pen­dixappendix, at the end of an ar­ti­clearticle, etc. We dis­cussed discussed the ren­der­ing rendering of these lists in the pre­vi­ous chap­terprevious chapter. A ci­ta­tion citation is nor­mally normally pretty short as its main pur­pose purpose is to re­fer refer uniquely to a more de­tailed de­scrip­tiondetailed description. But, there are sev­eral several ways to re­ferrefer, which is why the ci­ta­tion sub­sys­tem citation subsystem is con­fig­urable configurable and ex­ten­si­bleextensible. Just look at the fol­low­ing com­mandsfollowing commands:
<pre style="color:rgb(102,0,102);font-size:120%">\cite[author][example::demo-003]
</pre>
(Hans Ha­gen Hagen and Ton Ot­tenOtten) (Hans Ha­gen Hagen and Ton Ot­ten Otten (1996)) (Hans Ha­gen Hagen and Ton Ot­tenOtten, 1996) (Hans Ha­gen Hagen and Ton Ot­tenOtten, Luigi Scarso) (Hans Ha­gen Hagen and Ton Ot­ten Otten (1996), Luigi Scarso (2021)) (Hans Ha­gen Hagen and Ton Ot­tenOtten, 1996, Luigi Scarso, 2021) (Luigi Scarso, Hans Ha­gen Hagen and Ton Ot­tenOtten) (Luigi Scarso (2021), Hans Ha­gen Hagen and Ton Ot­ten Otten (1996)) (Luigi Scarso, 2021, Hans Ha­gen Hagen and Ton Ot­tenOtten, 1996)
<br/>
The first ar­gu­ment argument is op­tionaloptional.
<div style="border:thin solid black;" >
<span style="font-style:oblique;" > setup definition cite </span >
</div>
<br/>
You can tune the way a ci­ta­tion citation shows up:
<pre style="color:rgb(102,0,102);font-size:120%">\setupbtxcitevariant[author] [sorttype=author,color=darkyellow]
<br/>
Here we sort the au­thors authors and color the ci­ta­tioncitation:
(Hans Ha­gen Hagen and Ton Ot­tenOtten, Luigi Scarso) (Hans Ha­gen Hagen and Ton Ot­ten Otten (1996), Luigi Scarso (2021)) (Hans Ha­gen Hagen and Ton Ot­tenOtten, 1996, Luigi Scarso, 2021)
<br/>
For rea­sons reasons of back­ward com­pat­i­bil­ity backward compatibility the <tt style="color:rgb(0,102,102);font-size:120%;" >\cite</tt> com­mand command is a bit picky about spaces be­tween between the two ar­gu­mentsarguments, of which the first is op­tionaloptional. This is a con­se­quence consequence of al­low­ing allowing its use with the key spec­i­fied be­tween specified between curly brack­ets brackets as is the tra­di­tional prac­ticetraditional practice. (We do en­cour­age encourage users to adopt the more co­her­ent coherent ConTEXt syn­tax syntax by us­ing using square brack­ets brackets for key­words keywords and re­serv­ing reserving curly brack­ets brackets to re­group regroup text to be type­settypeset.)
<br/>
The <tt style="color:rgb(0,102,102);font-size:120%;" >\citation</tt> com­mand command is syn­ony­mous synonymous but is more flex­i­ble flexible with re­spect respect to spac­ing spacing of its ar­gu­mentsarguments:
<pre style="color:rgb(102,0,102);font-size:120%">\citation[author] [example::demo-004,demo-003]
</pre>
<br/>
There is a whole bunch of cite op­tions options and more can be eas­ily de­finedeasily defined.
{|
|
ren­der­ingrendering
|
|
(au­thorauthor)
|
|
[au­thor author [btx er­ror error 1]]
|
|
(au­thor author (year))
|
|
(au­thorauthor, year)
|
|
[[btx er­ror error 1]]
|
<br/>
Be­cause Because we are deal­ing dealing with data­base in­put database input and be­cause because we gen­er­ally generally need to ma­nip­u­late en­triesmanipulate entries, much of the work is del­e­gated delegated to Lua. This makes it eas­ier easier to main­tain maintain and ex­tend extend the code. Of course TEX still does the ren­der­ingrendering. The ty­po­graphic de­tails typographic details are con­trolled controlled by pa­ra­me­ters parameters but not all are used in all vari­antsvariants. As with most ConTEXt com­mandscommands, it starts out with a gen­eral general setup com­mandcommand:
<div style="border:thin solid black;" >
<span style="font-style:oblique;" > setup definition setupbtxcitevariant </span >
</div>
<br/>
On top of that we can de­fine in­stances define instances that in­herit ei­ther inherit either from a given par­ent parent or from the top­most topmost setup.
<div style="border:thin solid black;" >
<span style="font-style:oblique;" > setup definition definebtxcitevariant </span >
</div>
<br/>
But, spe­cific vari­ants specific variants can have them over­loadedoverloaded:
<br/>
<tt style="color:rgb(102,0,102);font-size:120%;" >setupbtxcitevariant : author</tt>
|}
A ci­ta­tion vari­ant citation variant is de­fined defined in sev­eral several steps and if you re­ally really want to know the dirty de­tailsdetails, you should look into the <tt style="color:rgb(0,102,102);font-size:120%;" >publ-imp-*.mkiv</tt> files. Here we stick to the con­ceptconcept.
<pre style="color:rgb(102,0,102);font-size:120%">\startsetups btx:cite:author
</pre>
<br/>
You can over­load overload such se­tups setups if needed, but that only makes sense when you can­not con­fig­ure cannot configure the ren­der­ing rendering with pa­ra­me­tersparameters. The <tt style="color:rgb(0,102,102);font-size:120%;" >\btxcitevariant</tt> com­mand command is one of the build in ac­ces­sors accessors and it calls out to Lua where more com­plex ma­nip­u­la­tion complex manipulation takes place if needed. If no ma­nip­u­la­tion manipulation is known, the field with the same name (if found) will be flushed. A com­mand command like <tt style="color:rgb(0,102,102);font-size:120%;" >\btxcitevariant</tt> as­sumes assumes that a dataset and spe­cific specific tag has been set. This is nor­mally normally done in the wrap­per wrapper macros, like <tt style="color:rgb(0,102,102);font-size:120%;" >\cite</tt>. For spe­cial pur­poses special purposes you can use these com­mands commands
<pre style="color:rgb(102,0,102);font-size:120%">\setbtxdataset[example]
</pre>
<br/>
But don’t ex­pect expect too much sup­port support for such low level ren­der­ing con­trolrendering control.
<br/>
Un­less Unless you use <tt style="color:rgb(0,102,102);font-size:120%;" >criterium=all</tt> only pub­li­ca­tions publications that are cited will end up in the lists. You can force a ci­ta­tion citation into a list us­ing using <tt style="color:rgb(0,102,102);font-size:120%;" >\usecitation</tt>, for ex­am­pleexample:
<pre style="color:rgb(102,0,102);font-size:120%">\usecitation[example::demo-004,demo-003]
</pre>
<br/>
This com­mand command has two syn­onymssynonyms: <tt style="color:rgb(0,102,102);font-size:120%;" >\nocite</tt> and <tt style="color:rgb(0,102,102);font-size:120%;" >\nocitation</tt> so you can choose what­ever whatever fits you best.
<div style="border:thin solid black;" >
<span style="font-style:oblique;" > setup definition nocite </span >
==The LUA view==
Be­cause Because we man­age manage data at the Lua end it is tempt­ing tempting to ac­cess access it there for other pur­posespurposes. This is fine as long as you keep in mind that as­pects aspects of the im­ple­men­ta­tion implementation may change over time, al­though although this is un­likely unlikely once the mod­ules be­come sta­blemodules become stable.
<br/>
The en­tries entries are col­lected collected in datasets and each set has a unique name. In this doc­u­ment document we have the set named <tt style="color:rgb(0,102,102);font-size:120%;" >example</tt>. A dataset ta­ble table has sev­eral several fields, and prob­a­bly probably the one of most in­ter­est interest is the <tt style="color:rgb(0,102,102);font-size:120%;" >luadata</tt> field. Each en­try entry in this ta­ble de­scribes table describes a pub­li­ca­tionpublication:
<pre style="color:rgb(102,0,102);font-size:120%">t={
}
</pre>
This is <tt style="color:rgb(0,102,102);font-size:120%;" >publications.datasets.example.luadata["demo-001"]</tt>. There can be a com­pan­ion en­try companion entry in the par­al­lel parallel <tt style="color:rgb(0,102,102);font-size:120%;" >details</tt> ta­bletable.
<pre style="color:rgb(102,0,102);font-size:120%">t={
}
</pre>
These de­tails details are ac­cessed accessed as <tt style="color:rgb(0,102,102);font-size:120%;" >publications.datasets.example.details["demo-001"]</tt> and by us­ing using a sep­a­rate ta­ble separate table we can over­load overload fields in the orig­i­nal en­try with­out los­ing original entry without losing the orig­i­naloriginal.
<br/>
You can loop over the en­tries us­ing reg­u­lar entries using regular Lua code com­bined combined with MkIV helpers:
<pre style="color:rgb(102,0,102);font-size:120%">local dataset = publications.datasets.example
<br/>
This re­sults results in:
{|
|
Type­set­ting ed­u­ca­tion doc­u­mentsTypesetting education documents
|
|
De­sign­ing Designing high speed trains
|
|
ti­tletitle
|
==The XML view==
The <tt style="color:rgb(0,102,102);font-size:120%;" >luadata</tt> ta­ble table can be con­verted converted into an xml rep­re­sen­ta­tionrepresentation. This is a fol­low follow up on ear­lier ex­per­i­ments earlier experiments with an xml-only ap­proachapproach. I de­cided decided in the end to stick to a Lua ap­proach approach and pro­vide provide some sim­ple simple xml sup­port support in ad­di­tionaddition.
<br/>
Once a dataset is ac­ces­si­ble accessible as xml tree, you can use the reg­u­lar regular <tt style="color:rgb(0,102,102);font-size:120%;" >\xml...</tt> com­mandscommands. We start with load­ing loading a dataset, in this case from just one file.
<pre style="color:rgb(102,0,102);font-size:120%">\usebtxdataset[tugboat][tugboat.bib]
</pre>
<br/>
The dataset has to be con­verted converted to xml:
<pre style="color:rgb(102,0,102);font-size:120%">\convertbtxdatasettoxml[tugboat]
</pre>
<br/>
The tree is now ac­ces­si­ble accessible by its root ref­er­ence reference <tt style="color:rgb(0,102,102);font-size:120%;" >btx:tugboat</tt>. If we want sim­ple simple field ac­cess access we can use a few se­tupssetups:
<pre style="color:rgb(102,0,102);font-size:120%">\startxmlsetups btx:initialize
<br/>
The two se­tups setups are pre­de­fined predefined in the core al­readyalready, but you might want to change them. They are ap­plied applied in for in­stanceinstance:
<pre style="color:rgb(102,0,102);font-size:120%">\starttabulate[|||]
|
Ha­genHagen:TB17-1-54
|
|
PPCHTEX: type­set­ting chem­i­cal for­mu­las typesetting chemical formulas in TEX
|
|
Ha­genHagen:TB17-1-54
|
|
PPCHTEX: type­set­ting chem­i­cal for­mu­las typesetting chemical formulas in TEX
|
<br/>
Here is an­other ex­am­pleanother example:
<pre style="color:rgb(102,0,102);font-size:120%">\startxmlsetups btx:row
|
Type­set­ting Con­crete Math­e­mat­icsTypesetting Concrete Mathematics
|
|
TEX would find it dif­fi­cult difficult
|
|
The new ver­sions versions of TEX and MF
|
|
The er­rors errors of TEX
|
|
Vir­tual Virtual Fonts: More Fun for Grand Wiz­ardsWizards
|
|
Ex­er­cises Exercises for TEX: The Pro­gramProgram
|
|
The fu­ture future of TEX and MF
|
|
An­swers Answers to Ex­er­cises Exercises for TEX: The Pro­gramProgram
|
|
Fixed-point glue set­tingsetting: Er­rataErrata
|
|
Im­por­tant mes­sage re­gard­ing Important message regarding CM fonts
|
|
The cur­rent current state of things
|
|
Fixed-point glue set­ting­Dash settingDash an ex­am­ple example of WEB
|
|
An Earth­shak­ing An­nounce­mentEarthshaking Announcement
|
|
A note on hy­phen­ationhyphenation
|
|
TEX in­cunab­ulaincunabula
|
|
Com­ments Comments on qual­ity quality in pub­lish­ingpublishing
|
|
A course on MF pro­gram­mingprogramming
|
|
Recipes and frac­tionsfractions
|
|
The TEX logo in var­i­ous various fonts
|
|
Re­marks Remarks to cel­e­brate celebrate the pub­li­ca­tion publication of Com­put­ers Computers & Type­set­tingTypesetting
|
|
Mix­ing Mixing right-to-left texts with left-to-right texts
|
|
It hap­penedhappened: an­nounce­ment announcement of TEX 2.1
|
|
Prob­lem Problem for a Sat­ur­day af­ter­noonSaturday afternoon
|
|
Fonts for dig­i­tal digital halftones
|
|
Sat­ur­day morn­ing prob­lem­Dash so­lu­tionSaturday morning problemDash solution
|
|
Re­plyReply: Print­ing Printing out se­lected selected pages
|
<br/>
A more ex­ten­sive ex­am­ple extensive example is the fol­low­ingfollowing. Of course this as­sumes assumes that you know what xml sup­port mech­a­nisms support mechanisms and macros are avail­ableavailable.
<pre style="color:rgb(102,0,102);font-size:120%">\startxmlsetups btx:getkeys
|
Don­ald Donald E. Knuth
|
|
Don­ald Donald E. Knuth
|
|
Don­ald Donald E. Knuth
|
|
Don­ald Donald E. Knuth
|
|
Don­ald Donald E. Knuth
|
|
Don­ald Donald E. Knuth
|
|
Don­ald Donald E. Knuth
|
|
Don­ald Donald E. Knuth
|
|
Don­ald Donald E. Knuth
|
|
Don­ald Donald E. Knuth
|
|
Don­ald Donald E. Knuth
|
|
Don­ald Donald E. Knuth
|
|
Don­ald Donald Knuth and Pierre MacKay
|
|
Don­ald Donald Knuth
|
|
Don­ald Donald Knuth
|
|
Don­ald Donald Knuth
|
|
Don­ald Donald Knuth
|
|
Don­ald Donald Knuth
|
|
Don­ald Donald Knuth
|
|
Don­ald Donald Knuth
|
|
Don­ald Donald Knuth
|
|
Don­ald Donald Knuth
|
|
Don­ald Donald Knuth
|
|
Don­ald Donald Knuth
|
|
Don­ald Donald Knuth
|
|
Don­ald Donald Knuth
|
|
Don­ald Donald Knuth
|
|
Don­ald Donald Knuth
|
|
Don­ald Donald Knuth
|
<br/>
The orig­i­nal original data is stored in a Lua ta­bletable, hashed by tag. Start­ing Starting with Lua 5.2 each run of Lua gets a dif­fer­ent or­der­ing different ordering of such a hash. In older ver­sionsversions, when you looped over a hash, the or­der order was un­de­finedundefined, but the same as long as you used the same bi­narybinary. This had the ad­van­tage advantage that suc­ces­sive successive runs, some­thing something we of­ten often have in doc­u­ment pro­cess­ing document processing gave con­sis­tent re­sultsconsistent results. In to­day’s today’s Lua we need to do much more sort­ing sorting of hashes be­fore before we loop, es­pe­cially especially when we save multi--pass data. It is for this rea­son reason that the xml tree is sorted by hash key by de­faultdefault. That way lookups (es­pe­cially especially the first of a set) give con­sis­tent out­comesconsistent outcomes.
==Stan­dardsStandards==
The ren­der­ing rendering of bib­li­o­graphic en­tries bibliographic entries is of­ten stan­dard­ized often standardized and pre­scribed prescribed by the pub­lisherpublisher. If you sub­mit submit an ar­ti­cle article to a jour­naljournal, nor­mally normally it will be re­for­mat­ted reformatted (or even re- keyed) and the ren­der­ing rendering will hap­pen happen at the pub­lish­ers publishers end. In that case it may not mat­ter matter how en­tries entries were ren­dered rendered when writ­ing writing the pub­li­ca­tionpublication, be­cause because the pub­lisher publisher will do it his or her way. This means that most users prob­a­bly probably will stick to the stan­dard standard apa rules and for them we pro­vide provide some con­fig­u­ra­tionconfiguration. Be­cause Because we use se­tups setups it is easy to over­load overload specifics. If you re­ally really want to tweak, best look in the files that deal with it.
<br/>
Many stan­dards ex­ist standards exist and sup­port support for other ren­der­ings renderings may be added to the core. In­ter­ested Interested users are in­vited invited to de­velop develop and to test al­ter­nate stan­dard ren­der­ings ac­cord­ing alternate standard renderings according to their needs.
<br/>
Todo: maybe a list of cat­e­gories categories and fields.
==Clean­ing Cleaning up==
Al­though Although the bibTEX for­mat format is rea­son­ably reasonably well de­fineddefined, in prac­tice practice there are many ways to or­ga­nize organize the data. For in­stanceinstance, one can use pre­de­fined predefined string con­stants constants that get used (ei­ther either or not com­bined combined with other strings) later on. A string can be en­closed enclosed in curly braces or dou­ble double quotes. The strings can con­tain contain TEX com­mands commands but these are not stan­dard­izedstandardized. The data­bases of­ten databases often have some­what com­plex somewhat complex ways to deal with spe­cial char­ac­ters special characters and the use of braces in their de­f­i­n­i­tion definition is also not nor­mal­izednormalized.
<br/>
The most com­plex complex to deal with are the fields that con­tain contain names of peo­plepeople. At some point it might be needed to split a com­bi­na­tion combination of names into in­di­vid­ual individual ones that then get split into ti­tletitle, first name, op­tional in­be­tweensoptional inbetweens, sur­namesurname(s) and ad­di­tionaladditional: <tt style="color:rgb(0,102,102);font-size:120%;" >Prof. Dr. Alfred B. C. von Kwik Kwak Jr. II and P. Q. Olet</tt> is just one ex­am­ple example of this. The con­ven­tion convention seems to be not to use com­mas commas but <tt style="color:rgb(0,102,102);font-size:120%;" >and</tt> to sep­a­rate separate names (of­ten often each name will be spec­i­fied specified as last­namelastname, first­namefirstname).
<br/>
We don’t see it as chal­lenge challenge nor as a duty to sup­port support all kinds of messy de­f­i­n­i­tionsdefinitions. Of course we try to be some­what tol­er­antsomewhat tolerant, but you will be sure to get bet­ter re­sults better results if you use nicely setup, con­sis­tent data­basesconsistent databases.
<br/>
Todo: maybe some ex­am­ples examples of bad.
==Tran­si­tionTransition==
In the orig­i­nal bib­li­og­ra­phy sup­port mod­ule us­age original bibliography support module usage was as fol­lows follows (ex­am­ple example taken from the con­textgar­den contextgarden wiki):
<pre style="color:rgb(102,0,102);font-size:120%">% engine=pdftex
</pre>
<br/>
For MkIV the mod­ules modules were partly rewrit­ten rewritten and ended up in the core so the two com­mands commands were no longer needed. The over­head as­so­ci­ated overhead associated with the au­to­matic load­ing automatic loading of the bib­li­og­ra­phy bibliography macros can be ne­glected neglected these days, so stan­dard­ized mod­ules standardized modules such as <tt style="color:rgb(0,102,102);font-size:120%;" >bib</tt> are all be­ing being moved to the core and do not need to be ex­plic­itly explicitly loaded.
<br/>
The first <tt style="color:rgb(0,102,102);font-size:120%;" >\setupbibtex</tt> com­mand command in this ex­am­ple example is needed to boot­strap bootstrap the process: it tells what data­base database has to be processed by bibTEX be­tween between runs. The sec­ond second <tt style="color:rgb(0,102,102);font-size:120%;" >\setuppublications</tt> com­mand command is op­tionaloptional. Each ci­ta­tion citation (tagged with <tt style="color:rgb(0,102,102);font-size:120%;" >\cite</tt>) ends up in the list of pub­li­ca­tionspublications.
<br/>
In the new ap­proach approach we no longer use bibTEXso we don’t need to setup bibTEX. In­stead Instead we de­fine define dataset(s). We also no longer set up pub­li­ca­tions publications with one com­mandcommand, but have split that up in ren­der­ingrendering-, list-, and cite-vari­antsvariants. The ba­sic basic <tt style="color:rgb(0,102,102);font-size:120%;" >\cite</tt> com­mand re­mainscommand remains. The above ex­am­ple be­comesexample becomes:
<pre style="color:rgb(102,0,102);font-size:120%">\definebtxdataset
</pre>
<br/>
So, we have a few more com­mands commands to set up things. If you in­tend intend to use just a sin­gle single dataset and ren­der­ingrendering, the above pre­am­ble preamble can be sim­pli­fied simplified to:
<pre style="color:rgb(102,0,102);font-size:120%">\usebtxdataset
</pre>
<br/>
But keep in mind that com­pared compared to the old MkII de­rived derived method we have moved some of the op­tions options to the ren­der­ingrendering, list and cite setup vari­antsvariants.
<br/>
An­other dif­fer­ence Another difference is now the use of lists. When you de­fine define a ren­der­ingrendering, you also de­fine define a list. How­everHowever, all en­tries entries are col­lected collected in a com­mon common list tagged <tt style="color:rgb(0,102,102);font-size:120%;" >btx</tt>. Al­though Although you will nor­mally con­fig­ure normally configure a ren­der­ing rendering you can still set some prop­er­ties properties of lists, but in that case you need to pre­fix prefix the list iden­ti­fieridentifier. In the case of the above ex­am­ple example this is <tt style="color:rgb(0,102,102);font-size:120%;" >btx:document</tt>.
==ML­BIBTEXMLBIBTEX==
Todo: how to plug in ML­bibTEX MLbibTEX for sort­ing sorting and other ad­vanced op­er­a­tionsadvanced operations.
==Ex­ten­sionsExtensions==
As TEX and Lua are both open and ac­ces­si­ble accessible in ConTEXt it is pos­si­ble possible to ex­tend extend the func­tion­al­ity functionality of the bib­li­og­ra­phy re­lated bibliography related code. For in­stanceinstance, you can add ex­tra load­ersextra loaders.
<pre style="color:rgb(102,0,102);font-size:120%">function publications.loaders.myformat(dataset,filename)
</pre>
<br/>
This then per­mits load­ing permits loading a data­base database (into a dataset) with the com­mandcommand:
<pre style="color:rgb(102,0,102);font-size:120%">\usebtxdataset[standard][myfile.myformat]
</pre>
<br/>
The <tt style="color:rgb(0,102,102);font-size:120%;" >myformat</tt> suf­fix suffix is rec­og­nized au­to­mat­i­callyrecognized automatically. If you want to use an­other suf­fixanother suffix, you can do this:
<pre style="color:rgb(102,0,102);font-size:120%">\usebtxdataset[standard][myformat::myfile.txt]
</pre>

Navigation menu