# [NTG-context] More on XML and citations

Johannes Graumann johannes_graumann at web.de
Wed Apr 5 18:50:03 CEST 2006

Taco Hoekwater wrote:

>> Taco, how would I
>> define a new 'cite' alternative along the lines
>> of 'authoryear'/'authoryears' that would result in 'Author et. al.,
>> 2004'?
>
> Easiest is by using a special macro breaking it up in two bits, like so:
>
>    \def\mycite#1{\cite[author][#1], \cite[year][#1]}
>
> there is a way to create 'official' alternatives, but it is quite a
> bit more cumbersome.
Thanks for that. The problem here is that I use XML as the text source and
would like to be able to use 'authoryear', 'authoryears' as well
as 'mycite' occasionally, which I switch to and from by the 'opt' option in
e.g.  '<cite id="hunt:86" opt="authoryear"/>'. If I understand your above
proposal correctly, I would have to literally call '\mycite[hunt:86]' on
the TeX level, and would have to abandon XML ... and thus the reason to
switch from LaTeX to ConTeXt to begin with - and nobody would want that ;0)
Could you - maybe - point me towards the more cumbersome 'official'
solution?