[NTG-context] using headnumber

Hans Hagen pragma at wxs.nl
Thu Apr 20 22:44:51 CEST 2006


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 at 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
-----------------------------------------------------------------



More information about the ntg-context mailing list