# [NTG-context] Learning how to use \setupbtxrendering

Alan Braslau braslau.list at comcast.net
Sat Feb 17 20:29:54 CET 2018

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