Changes

Jump to navigation Jump to search
no edit summary
==The data­base==
The bibTEX for­mat is rather pop­u­lar in the TEX com­mu­nity and even with its short­com­ings it will stay around for a while. Many pub­li­ca­tion web­sites can ex­port and many tools are avail­able to work with this data­base for­mat. It is rather sim­ple and looks a bit like Lua ta­bles. Un­for­tu­nately the con­tent can be pol­luted with non-stan­dard­ized TEX com­mands which com­pli­cates pre- or post­pro­cess­ing out­side TEX. In that sense a bibTEX data­base is of­ten not coded neu­trally. Some lim­i­ta­tions, like the use of com­mands to en­code ac­cented char­ac­ters root in the ascii world and can be by­passed by us­ing utf in­stead (as han­dled some­what in LATEX through ex­ten­sions such as ><ttstyle="color:rgb(0,102,102);font-size:120%;" >bibtex8</tt>).
<br/>
The nor­mal way to deal with a bib­li­og­ra­phy is to re­fer to en­tries us­ing a unique tag or key. When a list of en­tries is type­set, this ref­er­ence can be used for link­ing pur­poses. The type­set list can be processed and sorted us­ing the ><ttstyle="color:rgb(0,102,102);font-size:120%;" >bibtex</tt> pro­gram that con­verts the data­base into some­thing more TEX friendly (a ><ttstyle="color:rgb(0,102,102);font-size:120%;" >.bbl</tt> file). I never used the pro­gram my­self (nor bib­li­ogra­phies) so I will not go into too much de­tail here, if only be­cause all I say can be wrong.
<br/>
In ConTEXt we no longer use the ><ttstyle="color:rgb(0,102,102);font-size:120%;" >bibtex</tt> pro­gram: we just use data­base files and deal with the nec­es­sary ma­nip­u­la­tions di­rectly in ConTEXt. One or more such data­bases can be used and com­bined with ad­di­tional en­tries de­fined within the doc­u­ment. We can have sev­eral such datasets ac­tive at the same time.
<br/>
A bibTEX file looks like this:
</pre>
<br/>
Nor­mally a value is given be­tween quotes (or curly brack­ets) but sin­gle words are also OK (there is no real ben­e­fit in not us­ing quotes, so we ad­vise to al­ways use them). There can be many more fields and in­stead of strings one can use pre­de­fined short­cuts. The ti­tle for ex­am­ple quite of­ten con­tains TEX macros. Some fields, like ><ttstyle="color:rgb(0,102,102);font-size:120%;" >pages</tt> have funny char­ac­ters such as the en­dash (typ­i­cally as ><ttstyle="color:rgb(0,102,102);font-size:120%;" >--</tt>) so we have a mix­ture of data and type­set­ting di­rec­tives. If you are cov­er­ing non--eng­lish ref­er­ences, you of­ten need char­ac­ters that are not in the ascii sub­set but ConTEXt is quite happy with utf. If your data­base file uses old-fash­ioned TEX ac­cent com­mands then these will be in­ter­nally con­verted au­to­mat­i­cally to utf. Com­mands (macros) are con­verted to an in­di­rect call, which is quite ro­bust.
<br/>
The bibTEX files are loaded in mem­ory as Lua ta­ble but can be con­verted to xml so that we can ac­cess them in a more flex­i­ble way, but that is a sub­ject for spe­cial­ists.
</pre>
<br/>
The split ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\artauthor</tt> fields are col­lapsed into a sin­gle ><ttstyle="color:rgb(0,102,102);font-size:120%;" >author</tt> field as we deal with the split­ting later when it gets parsed in Lua. The ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\artauthor</tt> syn­tax is only kept around for back­ward com­pat­i­bil­ity with the pre­vi­ous use of bibTEX.
<br/>
In the new setup we sup­port these vari­ants as well:
So the user has a rather wide choice of for­mat­ting style for bib­li­og­ra­phy data­base files.
You can load more data than you ac­tu­ally need. Only en­tries that are re­ferred to ex­plic­itly through the ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\cite</tt> and ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\nocite</tt> com­mands will be shown in lists. We will cover these de­tails later.
==Com­mands in en­tries==
One un­for­tu­nate as­pect com­monly found in bibTEX files is that they of­ten con­tain TEX com­mands. Even worse is that there is no stan­dard on what these com­mands can be and what they mean, at least not for­mally, as bibTEX is a pro­gram in­tended to be used with many vari­ants of TEX style: plain, LATEX, and oth­ers. This means that we need to de­fine our use of these type­set­ting com­mands. How­ever, in most cases, they are just ab­bre­vi­a­tions or font switches and these are of­ten known. There­fore, ConTEXt will try to re­solve them be­fore re­port­ing an is­sue. In the log file there is a list of com­mands that has been seen in the loaded data­bases. For in­stance, load­ing ><ttstyle="color:rgb(0,102,102);font-size:120%;" >tugboat.bib</tt> gives a long list of com­mands 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/>
Un­known com­mands do not stall pro­cess­ing, but their names are then type­set in a mono- spaced font so they prob­a­bly stand out for proof­read­ing. You can ac­cess the com­mands with ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\btxcommand{...}</tt>, as in:
commands like \btxcommand{MySpecialCommand} are handled in an indirect way
==Datasets==
Nor­mally in a doc­u­ment you will use only one bib­li­o­graphic data­base, whether or not dis­trib­uted over mul­ti­ple files. Nev­er­the­less we sup­port mul­ti­ple data­bases as well which is why we talk of datasets in­stead. A dataset is loaded with the ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\usebtxdataset</tt> com­mand. Al­though cur­rently it is not nec­es­sary to de­fine a (de­fault) dataset you can best do this be­cause in the fu­ture we might pro­vide more op­tions. Here are some ex­am­ples:
<pre style="color:rgb(102,0,102);font-size:120%">\definebtxdataset[standard]
</pre>
<br/>
These three suf­fixes are un­der­stood by the loader. Here the dataset has the name ><ttstyle="color:rgb(0,102,102);font-size:120%;" >standard</tt> and the three data­base files are merged, where later en­tries hav­ing the same tag over­load pre­vi­ous ones. De­f­i­n­i­tions in the doc­u­ment source (coded in TEX speak) are also added, and they are saved for suc­ces­sive runs. This means that if you load and de­fine en­tries, they will be known at a next run be­fore­hand, so that ref­er­ences to them are in­de­pen­dent of when load­ing and de­f­i­n­i­tions take place.
<div style="border:thin solid black;" >
<span style="font-style:oblique;" > setup definition setupbtxdataset </span >
A list of pub­li­ca­tions can be ren­dered at any place in the doc­u­ment. A data­base can be much larger than needed for a doc­u­ment. The same is true for the fields that make up an en­try. Here is the list of fields that are cur­rently han­dled, but of course there can be ad­di­tional ones:
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >abstract</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >address</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >annotate</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >assignee</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >author</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >bibnumber</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >booktitle</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >chapter</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >comment</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >country</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >day</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >dayfiled</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >doi</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >edition</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >editor</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >eprint</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >howpublished</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >institution</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >isbn</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >issn</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >journal</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >key</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >keyword</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >keywords</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >language</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >lastchecked</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >month</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >monthfiled</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >names</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >nationality</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >note</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >notes</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >number</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >organization</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >pages</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >publisher</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >revision</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >school</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >series</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >size</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >title</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >type</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >url</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >volume</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >year</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >yearfiled</tt>
<br/>
If you want to see what pub­li­ca­tions are in the data­base, the eas­i­est way is to ask for a com­plete list:
This gives:1 Ha­gen, H. and Ot­ten, T. (1996). Type­set­ting ed­u­ca­tion doc­u­ments2 Scarso, L. (2021). De­sign­ing high speed trains3 au­thor (year). ti­tle pages p.
<br/>
The ren­der­ing it­self is some­what com­plex to set up be­cause we have not only many dif­fer­ent stan­dards but also many fields that can be set up. This means that there are sev­eral com­mands in­volved. Of­ten there is a pre­scribed style to ren­der bib­li­o­graphic de­scrip­tions, for ex­am­ple ><ttstyle="color:rgb(0,102,102);font-size:120%;" >apa</tt>. A ren­der­ing is setup and de­fined with:
<div style="border:thin solid black;" >
<span style="font-style:oblique;" > setup definition setupbtxrendering </span >
A dataset can have all kind of en­tries:
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >article</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >book</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >booklet</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >conference</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >inbook</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >incollection</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >inproceedings</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >manual</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >mastersthesis</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >misc</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >phdthesis</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >proceedings</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >techreport</tt>, ><ttstyle="color:rgb(0,102,102);font-size:120%;" >unpublished</tt>
<br/>
Each has its own ren­der­ing vari­ant. To keep things sim­ple we have their set­tings sep­a­rated. How­ever, these set­tings are shared for all ren­der­ing al­ter­na­tives. In prac­tice this is sel­dom a prob­lem in a pub­li­ca­tion as only one ren­der­ing al­ter­na­tive will be ac­tive. If this be not suf­fi­cient, you can al­ways group lo­cal set­tings in a setup and hook that into the spe­cific ren­der­ing.
Ex­am­ples of list vari­ants are:
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >setupbtxlistvariant : artauthor</tt>
{|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >no specific settings</tt>
|
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >setupbtxlistvariant : author</tt>
{|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >no specific settings</tt>
|
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >setupbtxlistvariant : editor</tt>
{|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >no specific settings</tt>
|
<br/>
The ex­act ren­der­ing of list en­tries is de­ter­mined by the ><ttstyle="color:rgb(0,102,102);font-size:120%;" >alternative</tt> key and de­faults to ><ttstyle="color:rgb(0,102,102);font-size:120%;" >apa</tt> which uses de­f­i­n­i­tions from ><ttstyle="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 has its own setup. You may also no­tice that ad­di­tional tests are needed to make sure that empty fields don’t trig­ger sep­a­ra­tors and such.
<br/>
There are a cou­ple of ac­ces­sors and helpers to get the job done. When you want to fetch a field from the cur­rent en­try you use ><ttstyle="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 you don’t want fences or punc­tu­a­tion that be­longs to a field.
<pre style="color:rgb(102,0,102);font-size:120%">\btxdoif {title} {
</pre>
<br/>
In ad­di­tion there is also a con­di­tional ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\btxinteractive</tt> which is more ef­fi­cient, al­though in prac­tice ef­fi­ciency is not so im­por­tant here.
<br/>
There are three com­mands to flush data:
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >\btxfield</tt>
|
|
fetch a ex­plicit field (e.g. ><ttstyle="color:rgb(0,102,102);font-size:120%;" >year</tt>)
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >\btxdetail</tt>
|
|
fetch a de­rived field (e.g. ><ttstyle="color:rgb(0,102,102);font-size:120%;" >short</tt>)
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >\btxflush</tt>
|
<br/>
Nor­mally you can use ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\btxfield</tt> or ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\btxflush</tt> as de­rived fields just like an­a­lyzed au­thor fields are flushed in a spe­cial way.
<br/>
You can im­prove read­abil­ity by us­ing se­tups, for in­stance:
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >\btxspace</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >\btxperiod</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >\btxcomma</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >\btxlparent</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >\btxrparent</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >\btxlbracket</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >\btxrbracket</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >inverted</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >invertedshort</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >normal</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >normalshort</tt>
|
<br/>
For rea­sons of back­ward com­pat­i­bil­ity the ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\cite</tt> com­mand is a bit picky about spaces be­tween the two ar­gu­ments, of which the first is op­tional. This is a con­se­quence of al­low­ing its use with the key spec­i­fied be­tween curly brack­ets as is the tra­di­tional prac­tice. (We do en­cour­age users to adopt the more co­her­ent ConTEXt syn­tax by us­ing square brack­ets for key­words and re­serv­ing curly brack­ets to re­group text to be type­set.)
<br/>
The ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\citation</tt> com­mand is syn­ony­mous but is more flex­i­ble with re­spect to spac­ing of its ar­gu­ments:
<pre style="color:rgb(102,0,102);font-size:120%">\citation[author] [example::demo-004,demo-003]
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >author</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >authornum</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >authoryear</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >authoryears</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >doi</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >key</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >none</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >num</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >page</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >serial</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >short</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >type</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >url</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >year</tt>
|
But, spe­cific vari­ants can have them over­loaded:
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >setupbtxcitevariant : author</tt>
{|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >right</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >)</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >middle</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >, </tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >left</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >(</tt>
|
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >setupbtxcitevariant : authornum</tt>
{|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >right</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >]</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >middle</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >, </tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >left</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >[</tt>
|
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >setupbtxcitevariant : authoryear</tt>
{|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >compress</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >yes</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >inbetween</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >, </tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >right</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >)</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >middle</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >, </tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >left</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >(</tt>
|
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >setupbtxcitevariant : authoryears</tt>
{|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >compress</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >yes</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >inbetween</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >, </tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >right</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >)</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >middle</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >, </tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >left</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >(</tt>
|
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >setupbtxcitevariant : doi</tt>
{|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >right</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >]</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >left</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >[</tt>
|
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >setupbtxcitevariant : key</tt>
{|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >right</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >]</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >left</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >[</tt>
|
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >setupbtxcitevariant : none</tt>
{|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >no specific settings</tt>
|
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >setupbtxcitevariant : num</tt>
{|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >compress</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >yes</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >inbetween</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >--</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >right</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >]</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >left</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >[</tt>
|
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >setupbtxcitevariant : page</tt>
{|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >inbetween</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >–</tt>
|
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >setupbtxcitevariant : serial</tt>
{|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >right</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >]</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >left</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >[</tt>
|
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >setupbtxcitevariant : short</tt>
{|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >right</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >]</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >left</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >[</tt>
|
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >setupbtxcitevariant : type</tt>
{|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >right</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >]</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >left</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >[</tt>
|
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >setupbtxcitevariant : url</tt>
{|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >right</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >]</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >left</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >[</tt>
|
<br/>
><ttstyle="color:rgb(0,102,102);font-size:120%;" >setupbtxcitevariant : year</tt>
{|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >right</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >)</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >left</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >(</tt>
|
|}
A ci­ta­tion vari­ant is de­fined in sev­eral steps and if you re­ally want to know the dirty de­tails, you should look into the ><ttstyle="color:rgb(0,102,102);font-size:120%;" >publ-imp-*.mkiv</tt> files. Here we stick to the con­cept.
<pre style="color:rgb(102,0,102);font-size:120%">\startsetups btx:cite:author
</pre>
<br/>
You can over­load such se­tups if needed, but that only makes sense when you can­not con­fig­ure the ren­der­ing with pa­ra­me­ters. The ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\btxcitevariant</tt> com­mand is one of the build in ac­ces­sors and it calls out to Lua where more com­plex ma­nip­u­la­tion takes place if needed. If no ma­nip­u­la­tion is known, the field with the same name (if found) will be flushed. A com­mand like ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\btxcitevariant</tt> as­sumes that a dataset and spe­cific tag has been set. This is nor­mally done in the wrap­per macros, like ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\cite</tt>. For spe­cial pur­poses you can use these com­mands
<pre style="color:rgb(102,0,102);font-size:120%">\setbtxdataset[example]
But don’t ex­pect too much sup­port for such low level ren­der­ing con­trol.
<br/>
Un­less you use ><ttstyle="color:rgb(0,102,102);font-size:120%;" >criterium=all</tt> only pub­li­ca­tions that are cited will end up in the lists. You can force a ci­ta­tion into a list us­ing ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\usecitation</tt>, for ex­am­ple:
<pre style="color:rgb(102,0,102);font-size:120%">\usecitation[example::demo-004,demo-003]
</pre>
<br/>
This com­mand has two syn­onyms: ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\nocite</tt> and ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\nocitation</tt> so you can choose what­ever fits you best.
<div style="border:thin solid black;" >
<span style="font-style:oblique;" > setup definition nocite </span >
Be­cause we man­age data at the Lua end it is tempt­ing to ac­cess it there for other pur­poses. This is fine as long as you keep in mind that as­pects of the im­ple­men­ta­tion may change over time, al­though this is un­likely once the mod­ules be­come sta­ble.
<br/>
The en­tries are col­lected in datasets and each set has a unique name. In this doc­u­ment we have the set named ><ttstyle="color:rgb(0,102,102);font-size:120%;" >example</tt>. A dataset ta­ble has sev­eral fields, and prob­a­bly the one of most in­ter­est is the ><ttstyle="color:rgb(0,102,102);font-size:120%;" >luadata</tt> field. Each en­try in this ta­ble de­scribes a pub­li­ca­tion:
<pre style="color:rgb(102,0,102);font-size:120%">t={
}
</pre>
This is ><ttstyle="color:rgb(0,102,102);font-size:120%;" >publications.datasets.example.luadata["demo-001"]</tt>. There can be a com­pan­ion en­try in the par­al­lel ><ttstyle="color:rgb(0,102,102);font-size:120%;" >details</tt> ta­ble.
<pre style="color:rgb(102,0,102);font-size:120%">t={
}
</pre>
These de­tails are ac­cessed as ><ttstyle="color:rgb(0,102,102);font-size:120%;" >publications.datasets.example.details["demo-001"]</tt> and by us­ing a sep­a­rate ta­ble we can over­load fields in the orig­i­nal en­try with­out los­ing the orig­i­nal.
<br/>
You can loop over the en­tries us­ing reg­u­lar Lua code com­bined with MkIV helpers:
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >demo-001</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >demo-002</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >demo-003</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >demo-004</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >demo-005</tt>
|
==The XML view==
The ><ttstyle="color:rgb(0,102,102);font-size:120%;" >luadata</tt> ta­ble can be con­verted into an xml rep­re­sen­ta­tion. This is a fol­low up on ear­lier ex­per­i­ments with an xml-only ap­proach. I de­cided in the end to stick to a Lua ap­proach and pro­vide some sim­ple xml sup­port in ad­di­tion.
<br/>
Once a dataset is ac­ces­si­ble as xml tree, you can use the reg­u­lar ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\xml...</tt> com­mands. We start with load­ing a dataset, in this case from just one file.
\usebtxdataset[tugboat][tugboat.bib]
<br/>
The tree is now ac­ces­si­ble by its root ref­er­ence ><ttstyle="color:rgb(0,102,102);font-size:120%;" >btx:tugboat</tt>. If we want sim­ple field ac­cess we can use a few se­tups:
\startxmlsetups btx:initialize
\xmlsetsetup{#1}{bibtex|entry|field}{btx:*}
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >tag</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >title</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >tag</tt>
|
|
><ttstyle="color:rgb(0,102,102);font-size:120%;" >title</tt>
|
Al­though the bibTEX for­mat is rea­son­ably well de­fined, in prac­tice there are many ways to or­ga­nize the data. For in­stance, one can use pre­de­fined string con­stants that get used (ei­ther or not com­bined with other strings) later on. A string can be en­closed in curly braces or dou­ble quotes. The strings can con­tain TEX com­mands but these are not stan­dard­ized. The data­bases of­ten have some­what com­plex ways to deal with spe­cial char­ac­ters and the use of braces in their de­f­i­n­i­tion is also not nor­mal­ized.
<br/>
The most com­plex to deal with are the fields that con­tain names of peo­ple. At some point it might be needed to split a com­bi­na­tion of names into in­di­vid­ual ones that then get split into ti­tle, first name, op­tional in­be­tweens, sur­name(s) and ad­di­tional: ><ttstyle="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 of this. The con­ven­tion seems to be not to use com­mas but ><ttstyle="color:rgb(0,102,102);font-size:120%;" >and</tt> to sep­a­rate names (of­ten each name will be spec­i­fied as last­name, first­name).
<br/>
We don’t see it as chal­lenge nor as a duty to sup­port all kinds of messy de­f­i­n­i­tions. Of course we try to be some­what tol­er­ant, but you will be sure to get bet­ter re­sults if you use nicely setup, con­sis­tent data­bases.
</pre>
<br/>
For MkIV the mod­ules were partly rewrit­ten and ended up in the core so the two com­mands were no longer needed. The over­head as­so­ci­ated with the au­to­matic load­ing of the bib­li­og­ra­phy macros can be ne­glected these days, so stan­dard­ized mod­ules such as ><ttstyle="color:rgb(0,102,102);font-size:120%;" >bib</tt> are all be­ing moved to the core and do not need to be ex­plic­itly loaded.
<br/>
The first ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\setupbibtex</tt> com­mand in this ex­am­ple is needed to boot­strap the process: it tells what data­base has to be processed by bibTEX be­tween runs. The sec­ond ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\setuppublications</tt> com­mand is op­tional. Each ci­ta­tion (tagged with ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\cite</tt>) ends up in the list of pub­li­ca­tions.
<br/>
In the new ap­proach we no longer use bibTEXso we don’t need to setup bibTEX. In­stead we de­fine dataset(s). We also no longer set up pub­li­ca­tions with one com­mand, but have split that up in ren­der­ing-, list-, and cite-vari­ants. The ba­sic ><ttstyle="color:rgb(0,102,102);font-size:120%;" >\cite</tt> com­mand re­mains. The above ex­am­ple be­comes:
<pre style="color:rgb(102,0,102);font-size:120%">\definebtxdataset
But keep in mind that com­pared to the old MkII de­rived method we have moved some of the op­tions to the ren­der­ing, list and cite setup vari­ants.
<br/>
An­other dif­fer­ence is now the use of lists. When you de­fine a ren­der­ing, you also de­fine a list. How­ever, all en­tries are col­lected in a com­mon list tagged ><ttstyle="color:rgb(0,102,102);font-size:120%;" >btx</tt>. Al­though you will nor­mally con­fig­ure a ren­der­ing you can still set some prop­er­ties of lists, but in that case you need to pre­fix the list iden­ti­fier. In the case of the above ex­am­ple this is ><ttstyle="color:rgb(0,102,102);font-size:120%;" >btx:document</tt>.
</pre>
<br/>
The ><ttstyle="color:rgb(0,102,102);font-size:120%;" >myformat</tt> suf­fix is rec­og­nized au­to­mat­i­cally. If you want to use an­other suf­fix, you can do this:
<pre style="color:rgb(102,0,102);font-size:120%">\usebtxdataset[standard][myformat::myfile.txt]
</pre>

Navigation menu