Re: [NTG-context] More on XML and citations
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? Thanks for your help, Joh ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] More on XML and citations
Johannes Graumann wrote: Could you - maybe - point me towards the more cumbersome 'official' solution? See attached example. Cheers, taco ixbib.tex Description: TeX document ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] More on XML and citations
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 ,[EMAIL PROTECTED] \xprocesscommaitem \else \if [EMAIL PROTECTED] argument \c!andtext ={ and }, \c!otherstext ={ et al.}, \c!pubsep ={, }, \... \xdogetparameters #1]-\xprocesscommaitem #1 ,],[EMAIL PROTECTED]@ \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 ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] More on XML and citations
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 ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] More on XML and citations
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 - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] More on XML and citations
Hans Hagen wrote: however, best is not to mix tex this way with xml H ... 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 pgp2BhaGnDLoC.pgp Description: PGP signature ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] More on XML and citations
Johannes Graumann wrote: Hans Hagen wrote: however, best is not to mix tex this way with xml H ... 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 ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] More on XML and citations
Johannes Graumann wrote: Hello again, I have a matching rule for cite commands that look as follows: cite id=hunt:86 opt=authoryear/ The rule is this (kudoos to Taco): \defineXMLargument [cite] {\expanded{\cite[\XMLpar{cite}{opt}{}][\XMLpar{cite}{id}{}]}} - reset opt, otherwise the previous one will be used when no opt is given - \XMLop (own parameter) saves a few bytes and can be used here \defineXMLargument [cite] [opt=] {\expanded{\cite[\XMLop{opt}][\XMLop{id}]}} Sometimes I would like to have the '(Hunt et. al., 1986)' produced by above combination to look like '(see e.g. Hunt et. al., 1986)'. Taco pointed out in response to a question to list that I could do that by handing a 'left={(see e.g. }' to the cite command, however I fail to be able to do that. A XML node like this cite id=hunt:86 opt=authoryear,left={(see e.g.}/ results on compilation with above rule in the following error: hm, the problem is that the { } are no longer tex's braces (grouping) \starttext \defineXMLcommand [whatever] [test=unknown] {\XMLop{test}} \startXMLdata whatever test={\bf test}/ \stopXMLdata \def\defXMLtex#1#2% the appended space will go away when {\begingroup% \scantokens is fixed \disableXML \everyeof{\noexpand}% br's hack \edef\ascii{#2}% \edef\ascii{\scantokens\expandafter{\ascii}}% space appended \expandafter\endgroup\expandafter\def\expandafter#1\expandafter{\ascii}} \defineXMLcommand [whatever] [test=unknown] {\defXMLtex\SomethingTex{\XMLop{test}}% \SomethingTex} \startXMLdata whatever test={\bf test}/ \stopXMLdata \stoptext so, then you can for instance feed \SomethingTex into the scite macros however, best is not to mix tex this way with xml 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 - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context