From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/50463 Path: news.gmane.org!not-for-mail From: Taco Hoekwater Newsgroups: gmane.comp.tex.context Subject: Re: bibmodule (again) Date: Thu, 14 May 2009 10:08:26 +0200 Message-ID: <4A0BD17A.1050106@elvenkind.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1242288573 29656 80.91.229.12 (14 May 2009 08:09:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 May 2009 08:09:33 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu May 14 10:09:25 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1M4W0L-00031T-Go for gctc-ntg-context-518@m.gmane.org; Thu, 14 May 2009 10:09:25 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id BC84C1FFA2; Thu, 14 May 2009 10:09:23 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 29494-05; Thu, 14 May 2009 10:08:39 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 4D5841FF95; Thu, 14 May 2009 10:08:39 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3A0EE1FF95 for ; Thu, 14 May 2009 10:08:38 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 01925-01-2 for ; Thu, 14 May 2009 10:08:27 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by ronja.ntg.nl (Postfix) with ESMTP id 7D5A51FF92 for ; Thu, 14 May 2009 10:08:27 +0200 (CEST) Original-Received: from plane.elvenkind.com (elvenknd.xs4all.nl [82.95.203.226]) by filter2-ams.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n4E88QxF015321 for ; Thu, 14 May 2009 10:08:27 +0200 Original-Received: from glenlivet.elvenkind.com (glenlivet.elvenkind.com [10.10.0.6]) by plane.elvenkind.com (Postfix) with ESMTP id 7370E8041A0F for ; Thu, 14 May 2009 10:08:26 +0200 (CEST) User-Agent: Thunderbird 2.0.0.21 (X11/20090319) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=82.95.203.226; country=NL; region=11; city=Rotterdam; latitude=51.9167; longitude=4.5000; http://maps.google.com/maps?q=51.9167,4.5000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 225207604 - 8568eedbcb86 - 20090514 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:50463 Archived-At: Hi, I can't fix everything, but I believe I have made some progress. The new structure and referencing code is totally different from the old code and I understand less than half of it. What's worse: I seem to be really bad at explaining to Hans all the things that should happen wrt. references in the bib module. Anyway: Thomas A. Schmitz wrote: > > \usemodule[bib] At this point, please add these three (re)definitions: %%%%%%%%%%%%%%% \def\bibrefprefix{} \def\preparebibreflist#1{\edef\bibreflist{#1}} \def\docitation#1{% \iftrialtypesetting \else \ifdoinpututilities\else \doglobal\increment\citationnumber \expanded{\rawreference{}{cite-\jobname-\citationnumber}{#1}}% \fi \fi \expanded{\writedatatolist[pubs][bibref=#1]}} %%%%%%%%%%%%%%%%% If you turn cite compression off, it will now work (somewhat, at least). With compression on, there is backward compatibility problem in mkiv that I do not know how to deal with. Si here is the explanation and then I hope Hans can make sense out of it. In Thomas' example, in the first run the \placepublications[criterium=all] creates a reference 'belfiorepleasure' with value '1', like so: \reference[belfiorepleasure]{1} In the second run, the \cite[belfiorepleasure] uses this reference to typeset the number '1' at that spot. Because the argument to \cite is actually is a list of references, \cite (via \bibnumref) builds an internal commalist of references to resolve. If the citation compression is off, this is a direct list of refs, and the citation essentially expands into \def\processitem#1{\in[#1]} \processcommalist[belfiorepleasure]\processitem as said, that now works. But if cite compression is on (which it is by default) the to be typeset numbers need to be sorted, and this simple solution won't do. Instead, the citation is expanded into something more like this: \def\therefs{} \def\processitem#1% {\doifreferencefoundelse{#1} {\addtocommalist{\reftypet}\therefs } {}} \processcommalist[belfiorepleasure]\processitem This only works in mkii at the moment because in mkiv the \reftypet expands to nothing. It is defined (in strc-ref.tex) as: \def\reftypet{\currenttextreference} but it seems that the mkiv version of \doifreferencefoundelse does not set up the \currentxxxreference macros any more. That is where I got stuck, and I hope Hans can explain why that doesn't work, whether it is intentional, and if it is indeed on purpose, what the correct interface is to get at the 'text' field of a reference in mkiv. Best wishes, Taco ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________