[NTG-context] Learning how to use \setupbtxrendering

Otared Kavian otared at gmail.com
Mon Feb 19 18:04:30 CET 2018


Hi Alan, and all the Gurus on the list,

Many thanks for your help and comments. I am sending again this message which, by mistake, was sent only to Alan, in order to get some help.

The manual mkiv-publications.pdf contains indeed many explanations, but probably the informations there are too vast for the elementary use I am going to need. So many thanks to Alan and Hans for this extensive manual!

Now, this being said, I am neither able, nor do I need, to use the full blown power of this environment. In particular I am not familiar with the style apa (or aps, which seems to exist too…) or other official specifications. That is why I would like to learn by examples, beginning with the one included on page 4 of the above mentioned manual and then modify things to see what can be done…
However, when I use the modifications which Alan suggested (for the style apa, but I dropped the apa: prefix…) I do not get what is desired (please see below the code and the attached test.bib file). And if I give explicitely the specification apa, then many other things are not satisfactory for my needs…

For now, what I get without changing many things in the first example given in the manual, is quite close to what I would like to obtain, except that the title of articles is in roman and the name of the journal is in italic, and the title of books are in italic (and the modifications suggest by Alan do not change this, at least when I am not using apa).

So my first question is: how can one define one's own « specification », when modifying built-in specifications is not satisfactory for one's needs, or does not give the expected result? 

The second question is: how can one write a file containing only the references which are used in a document, so that that file can be in some way included into the main document (this is somewhat analogous to the .bbl file created by BibTeX, which allows to include a series of \bibitem into an article written with LaTeX: this is necessary to do when one submits a paper to a mathematical journal).

Thanks again for your help: OK

%% begin test-bibliography.tex
\setupinteraction[state=start]

\usebtxdataset[test.bib]

%% these four setupbtx suggested by Alan have no effects
\setupbtx[list:volume][style={bold}]
\setupbtx[list:title] [style={\it}]
%(the default for apa)
\setupbtx [list:title:book] [style={\ss\it}]
\setupbtx[list:volume][,style=bold]
%(apa default is italic)

%% this has the correct effect...
\setupbtx[
	interaction=start,
	specification=default,
	left={[},
	right={]},
	]

\starttext
\startbodymatter

See the book by K. Yosida \cite[YosidaK]
and the article by I. Ekeland \cite{EkelandILemme}.

\stopbodymatter

\startbackmatter 

\startchapter[title=Bibliography]

\placelistofpublications
	[method=dataset,
	sorttype=authoryear,
	numbering=yes,
	]
\stopchapter

\stopbackmatter

\stoptext
%% end test-bibliography.tex

%% begin content of the file text.bib

@article{FabesEBStrook,
	Author = {E.B. Fabes and D.W. Strook},
	Journal = {Archives for Rational Mechanics and Analysis},
	Pages = {327--338},
	Title = {A new proof of Moser's parabolic Harnack inequality via the old ideas of Nash},
	Volume = {96},
	Year = {1986}
	}

@book{EvansLC,
	Address = {Providence, RI},
	Author = {Lawrence C. Evans},
	Publisher = {American Mathematical Society},
	Series = {Conference Board of the Mathematical Sciences Regional Conference Series in Mathematics},
	Title = {Weak convergence methods for nonlinear partial differential equations},
	Volume = {74},
	Year = {1990}
	}

@book{EkelandITemam,
	Address = {Paris},
	Author = {Ivar Ekeland and Roger Temam},
	Publisher = {Dunod-Gauthiers-Villars},
	Title = {Analyse Convexe et Problèmes Variationnels},
	Year = {1974}
	}

@article{EkelandILemme,
	Author = {Ivar Ekeland},
	Journal = {Journal of Mathematical Analysis and Applications},
	Pages = {324--353},
	Title = {On the variational principle},
	Volume = {47},
	Year = {1974}
	}

@book{DieudonneJ,
	Address = {Paris},
	Author = {Jean Dieudonné},
	Publisher = {Gauthiers-Villars},
	Title = {Éléments d'Analyse},
	Volume = {1},
	Year = {1969}
	}

@book{YosidaK,
	Address = {New York},
	Author = {Kôsaku Yosida},
	Publisher = {Springer-Verlag},
	Series = {Die Grundlehren der Mathematischen Wissenschaften},
	Title = {Functional Analysis},
	Volume = {123},
	Year = {1974}
	}

%% end content of the file test.bib

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.bib
Type: application/octet-stream
Size: 1617 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20180219/30857655/attachment.obj>
-------------- next part --------------



> On 17 Feb 2018, at 20:29, Alan Braslau <braslau.list at comcast.net> wrote:
> 
> HANS: there is one specific comment for you, below.
> 
> On Sat, 17 Feb 2018 15:27:03 +0100
> Otared Kavian <otared at gmail.com> wrote:
> 
>> Dear all,
>> 
>> I am in the process of learning how to use the bibliography mechanism
>> in mkiv, and I would lik eto understand the meanings of the various
>> parameters in the command:
>> 
>> \setupbtxrendering [...,1,...] [..,..2=..,..]
>> 1 NAME
>> 2 textstate	= start stop
>> pagestate		= start stop
>> separator		= COMMAND
>> criterium		= previous cite here all none 
>> filter		= TEXT
>> specification	= NAME
>> title			= TEXT
>> before		= COMMAND
>> after			= COMMAND
>> dataset		= NAME
>> method		= dataset force local global none
>> sorttype		= short dataset list reference used default
>> cite index repeat		= yes no
>> group		= NAME
>> numbering	= yes no num index tag short page
>> 
>> Indeed serveral of them are clear enough (such as dataset), some can
>> be guessed by trial and error (such as numbering=yes or no) but some
>> seem to me obscure or difficult to guess (what would numbering=page
>> mean, or what would separator=COMMAND do, what does the title=TEXT
>> corresponds to, etc).
>> 
>> Has someone some examples to play with in order to learn the meaning
>> of these options?
>> 
>> Also, in real case document I would like to be able to typeset the
>> bibliography with the following style:
>> 
>> the autho's name is followed by a « : »
>> the title of an article is in italic
>> the title of a book is in slanted sans serif
>> the number of the volume is in bold
>> 
>> Is it possible to do this by an appropriate setting of btxrendering,
>> without going into the BibTeX file?
>> 
>> Thanks in advance for any help: OK
> 
> First of all, don't put any such formatting in the BibTeX file: that is
> a LaTeX-style hack, and we have designed the ConTeXt system to avoid
> any such need. The dataset should contain only data, and hacks should
> be avoided.
> 
> There is some limitation to this. Say, for example that the title
> contains mathematical symbols. One would be hard pressed not to include
> dollar-sign delimiters and math syntax! Another example could be
> "edition={second}" and "edition={2\high{nd}}". Of course, one could
> introduce conversion sets (like for months), but this gets complicated.
> How about "edition={second, revised with corrections}"?
> 
> 
> Most of the customizations that you ask are obtained through setups:
> 
> For the author's name, depends on what you want: " : " after the list
> of authors or after each author? If you want this after the list of
> authors, then one needs to redefine a setup:
> 
> From publ-imp-authors.mkvi
> 
> \startsetups \s!btx:\s!list:\s!author:others
>   \ifcase\currentbtxoverflow \else
>       \btxparameter\c!otherstext
>   \fi
> \stopsetups
> 
> (this gets called at the end of the author list construction). One could add at
> the end \btxcolon, defined (in publ-ini.mkiv) as
> \unexpanded\def\btxcolon                 {\removeunwantedspaces:\space}
> but you would want a space before, so you would probably want to add, rather
> "\space:\space"
> 
> HANS: perhaps this requested use might call for a new parameter
> (separator:names:5=,) to be put at the *end* of an author list in *all*
> of the appropriate setups, rather than having to redefine the :others
> setup which is sort-of a hack? In this case, Otared would then use
> \setupbtx [apa:list:author] [separator:names:5={\space:\space}]
> (assuming that he uses the apa specification)
> DON'T try this, as we do not implement it (yet)!
> 
> 
> For the other requests:
> 
> \setupbtx [apa:list:title] [style=italic]
> (the default for apa)
> 
> \setupbtx [apa:list:title:book] [style={slanted,sans}]
> (untested)
> 
> \setupbtx [apa:list:volume] [style=bold]
> (apa default is italic)
> 
> 
> On your other questions, a rendering uses the standard list mechanism,
> so some of the parameters (such as pagestate) get passed on. See
> \setuplist
> 
> Others, such as numbering= yes no num index tag short page
> controls the numbering of the list. It is numbering=num (or yes for
> default and aps) but numbering=no (for apa).
> numbering=index puts the dataset index (which depends on an internal
> hash) rather than num which is a cite instance number.
> numbering=tag puts the bibtex tag (as used in \cite).
> numbering=short puts the short tag, for example KAV18, that is a short
> author-year concoction.
> numbering=page, I don't know what this does (in my test, it put "?").
> 
> Many (but not all) of the rendering parameters are described (somewhat)
> in the documentation, which of course is not perfect!
> 
> Alan



More information about the ntg-context mailing list