Re: [NTG-context] More on XML and citations
Hans Hagen wrote:
however, best is not to mix tex this way with xml Hmmmm ... will heed that advice then ... as a remedy: Taco, how would I define a new 'cite' alternative along the lines of 'authoryear'/'authoryears' that would result in 'Author et. al., 2004'?
Thanks for any hint, Joh
Johannes Graumann wrote:
Hans Hagen wrote:
however, best is not to mix tex this way with xml
Hmmmm ... will heed that advice then ... as a remedy: 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. Cheers, taco
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
Taco Hoekwater wrote: 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? Thanks for your help, Joh
Taco Hoekwater wrote:
Johannes Graumann wrote:
Could you - maybe - point me towards the more cumbersome 'official' solution?
See attached example.
Cheers, taco
Taco, With this preamble code \unprotect \def\bibauthoryearxref[#1]% {\ixbibauthoryear{#1}% {{\currentbibauthor}\bibalternative\c!inbetween \bibalternative\v!left{\currentbibyear}\bibalternative\v!right} {\bibalternative\c!pubsep{\currentbibauthor}\bibalternative\c!inbetween \bibalternative\v!left {\currentbibyear}\bibalternative\v!right} {\bibalternative\c!lastpubsep{\currentbibauthor}\bibalternative\c!inbetween \bibalternative\v!left {\currentbibyear}\bibalternative\v!right}} \setupcite [authoryearx] [\c!andtext={ and }, \c!otherstext={ et al.}, \c!pubsep={, }, \c!lastpubsep={ and }, \c!compress=\v!yes, \c!inbetween={, }, \c!left={}, \c!right={}] \protect I get the following error at compile time: ! Undefined control sequence. <argument> \c!andtext ={ and } \xprocesscommaitem #1,#2->\if ,#1 ,\@EA \xprocesscommaitem \else \if ]#1\@EAE... <argument> \c!andtext ={ and }, \c!otherstext ={ et al.}, \c!pubsep ={, }, \... \xdogetparameters #1]->\xprocesscommaitem #1 ,],\@relax@ \next1 #1,->\dosetupcite {#1} \doprocesscommaitem \doprocesscommalist ...item \gobbleoneargument #1, ]\relax \global \advance \... l.224 \c!right={}] What am I doing wrong? Outdated ContTeXt/bib module? Joh
Hi Johannes, Johannes Graumann wrote:
What am I doing wrong? Outdated ContTeXt/bib module?
Yes. Get the new one from http://modules.contextgarden.net/bib or wait 'till the new context release (tomorrow, i believe). Cheers, taco
Taco Hoekwater wrote:
Hi Johannes,
Johannes Graumann wrote:
What am I doing wrong? Outdated ContTeXt/bib module?
Yes. Get the new one from http://modules.contextgarden.net/bib or wait 'till the new context release (tomorrow, i believe).
just uploaded Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Johannes Graumann
-
Taco Hoekwater