From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/38607 Path: news.gmane.org!not-for-mail From: Carsten Fechtmann Newsgroups: gmane.comp.tex.context Subject: Re: Bug or feature? Strange counter behaviour in macro Date: Sun, 13 Jan 2008 00:52:21 +0100 Message-ID: References: <4B09D1CE-D07B-416E-80AC-5E366FCED60A@zarm-technik.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v915) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1200184454 16296 80.91.229.12 (13 Jan 2008 00:34:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 13 Jan 2008 00:34:14 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Jan 13 01:34:36 2008 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 1JDqo3-0000xk-JZ for gctc-ntg-context-518@m.gmane.org; Sun, 13 Jan 2008 01:34:31 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1A1BC1FAE5; Sun, 13 Jan 2008 01:11:59 +0100 (CET) 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 10823-03; Sun, 13 Jan 2008 01:10:06 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id EAB151FB8C; Sun, 13 Jan 2008 01:01:03 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D60371FB5E for ; Sun, 13 Jan 2008 00:58:05 +0100 (CET) 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 14132-01-3 for ; Sun, 13 Jan 2008 00:55:23 +0100 (CET) Original-Received: from www.zarm-technik.de (zarm5.zarm.uni-bremen.de [134.102.236.5]) by ronja.ntg.nl (Postfix) with ESMTP id 573891FB77 for ; Sun, 13 Jan 2008 00:52:29 +0100 (CET) Original-Received: from localhost (unknown [127.0.0.1]) by www.zarm-technik.de (Postfix) with ESMTP id 499351D12C for ; Sat, 12 Jan 2008 23:52:39 +0000 (UTC) X-Virus-Scanned: amavisd-new 2.5.2 (20070627) at zarm-technik.de Original-Received: from www.zarm-technik.de ([127.0.0.1]) by localhost (www.zarm-technik.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iVOMNHPeVK3k for ; Sun, 13 Jan 2008 00:52:35 +0100 (CET) Original-Received: from [10.0.1.2] (pD955EDE6.dip.t-dialin.net [217.85.237.230]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by www.zarm-technik.de (Postfix) with ESMTP id 74E56D50F for ; Sun, 13 Jan 2008 00:52:34 +0100 (CET) In-Reply-To: X-Mailer: Apple Mail (2.915) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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:38607 Archived-At: Hi Aditya, yes, looking at the .tuo did the trick. :-D I had tried things with expanded already, but at that time I still had > {\expanded{\Issue[\IssueCounter]{Issue~\IssueCounter:}{\currentdate}}} as command. Which does NOT work (due to the tilde ~ resulting in an error message then) The rest was actually fine. Now, without it (i.e. "~") it works! ... {\expanded{\Issue[\IssueCounter]{Issue: \IssueCounter:}{\currentdate}}} ... Thanks a lot, that had me seriously baffled ;-) Carsten On 12.01.2008 at 23:29 wrote Aditya Mahajan: > Hi Carsten, > > On Sat, 12 Jan 2008, Carsten Fechtmann wrote: > >> What this all burns down is, that I /really/ would like to >> understand, >> how I can pass a value from a counter as (constant) argument to a >> self- >> defined function. As that seems to be the core of the matter/problem >> here. > > You need to understand how synonyms work. It writes enteries to the > tuo > file, and then uses that in the second pass to sort things. One way to > make sure that you have the correct entry in the tuo file is to use > expanded: > > \definesynonyms[Issue][issues][\IssueText][\IssueDate] > \setupsynonyms[Issue][criterium=all] > > \newcounter\IssueCounter > > \def\NewIssue{\dosingleargument\doNewIssue} > > \def\doNewIssue[#1]% > {\increment\IssueCounter > %Debug: \IssueCounter / \getnumber[IssueNumber]% > \doifelsenothing{#1} > {\expanded{\Issue[\IssueCounter]{\IssueCounter}{\currentdate}}} > {\expanded{\Issue[\IssueCounter]{\IssueCounter}{#1}}}} > > % Compare the tuo file with and without expanded and you will know > what is > % happening. > > \starttext > \NewIssue[January 9, 2008] > \NewIssue[January 10, 2008] > \NewIssue % January 11, 2008 > > List of issue \# and dates: > > \placelistofissues \blank > > \IssueDate{\IssueCounter} % produces correct result in either case > > \stoptext > > Aditya > ___________________________________________________________________________________ > 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 > ___________________________________________________________________________________ ___________________________________________________________________________________ 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 ___________________________________________________________________________________