From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/27321 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: using headnumber Date: Thu, 20 Apr 2006 22:44:51 +0200 Message-ID: <4447F2C3.9030409@wxs.nl> References: <4447A561.1020102@gmx.net> <0520A565-5054-429D-9779-4DB26DB380FC@uni-bonn.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1145566105 1709 80.91.229.2 (20 Apr 2006 20:48:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 20 Apr 2006 20:48:25 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Thu Apr 20 22:48:24 2006 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 ciao.gmane.org with esmtp (Exim 4.43) id 1FWg4Y-0006Qs-LX for gctc-ntg-context-518@m.gmane.org; Thu, 20 Apr 2006 22:48:18 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DD7C4127B7; Thu, 20 Apr 2006 22:48:17 +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 01891-08-2; Thu, 20 Apr 2006 22:48:13 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D171E127B4; Thu, 20 Apr 2006 22:48:13 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 43881127B4 for ; Thu, 20 Apr 2006 22:48:13 +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 01891-08 for ; Thu, 20 Apr 2006 22:48:12 +0200 (CEST) Original-Received: from mail.pragma-ade.net (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by ronja.ntg.nl (Postfix) with SMTP id 712A91279A for ; Thu, 20 Apr 2006 22:44:56 +0200 (CEST) Original-Received: from [10.100.1.102] (unverified [10.100.1.102]) by controller-1 (SurgeMail 3.5b3) with ESMTP id 13334 for ; Fri, 21 Apr 2006 00:44:56 +0400 User-Agent: Thunderbird 1.5 (Windows/20051201) Original-To: mailing list for ConTeXt users In-Reply-To: <0520A565-5054-429D-9779-4DB26DB380FC@uni-bonn.de> X-Server: High Performance Mail Server - http://surgemail.com r=-274017400 X-Authenticated-User: hagen@controller-1 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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:27321 Archived-At: Thomas A. Schmitz wrote: > Hi Peter, > > thanks for the help! The additional { must have been a fluke with > copy/paste; wasn't in my file. By sheer stubbornness, I tried until I > found something that works: > command={{\determineheadnumber[section]}\ifodd\currentheadnumber > \resetSlideNumber\incrementSlideNumber \else\incrementSlideNumber \fi}] > why not directly use the slidenumber \def\SlideNumber{1} command={\ifodd\SlideNumber\gdef\SlideNumber{1}\else\doglobal\increment\SlideNumber\fi}} command={\ifodd\SlideNumber\gdef\SlideNumber{1}\else\gdef\SlideNumber{2}\fi}} command={\xdef\SlideNumber{\ifodd\SlideNumber\space1\else2\fi}} \def\SlideNumber{\ifconditional\OddSlide1\else2\fi} command=\ifodd\settrue\OddSlide\else\setfalse\OddSlide\fi etc etc > So after \determineheadnumber[something], \currentheadnumber appears > to have that value and doesn't take an argument. > > Thanks, and best > > Thomas > > On Apr 20, 2006, at 5:14 PM, Peter Rolf wrote: > > >> Hi Thomas, >> >> Thomas A. Schmitz wrote: >> >>> Hi, >>> >>> I have a counter which I want to be incremented after every \section >>> command and reset after every odd \section (don't ask why...). So I >>> tried this approach: >>> >>> \setuphead[section] >>> [command={{{\determineheadnumber[section]} >>> >> ^^^^ >> one opening brace too much >> >> If you problem remains, try to add a \expandafter in front of \ifodd. >> Sometimes it is also helpful to enclose the number expression by >> \numexpr ... \relax (for conversion). >> >> Greets, Peter >> > > _______________________________________________ > ntg-context mailing list > ntg-context@ntg.nl > http://www.ntg.nl/mailman/listinfo/ntg-context > -- ----------------------------------------------------------------- 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 -----------------------------------------------------------------