Wolfgang Schuster <wolfgang.schus...@gmail.com> writes:

> Am 13.09.2012 um 12:14 schrieb John Devereux <j...@devereux.me.uk>:
>
>> 
>> Hi,
>> 
>> \setuphead seems to be broken for me in recent context (following
>> upgrade of a ~year-old system).
>> 
>> Problem happens when use the command= key.
>> 
>> An example from the wiki fails, as does my own code.
>> 
>> mtx-context     | ConTeXt Process Management 0.60
>> mtx-context     |
>> mtx-context     | main context file: 
>> /opt/context/tex/texmf-context/tex/context/base/context.mkiv
>> mtx-context     | current version: 2012.09.10 00:57
>> 
>> ======================================================================
>> 
>> 
>> \setuppapersize[A5]
>> \setupexternalfigures[location=default] % needed only for the wiki to the 
>> find the figure
>> 
>> \useexternalfigure[section-1][cow][width=5cm,height=1cm]
>> \useexternalfigure[section-2][mill.png][width=5cm,height=1cm]
>> 
>> \setuphead
>>   [section]
>>   [command=\MySectionCommand]
>> \setuphead
>>   [subsection]
>>   [command=]
>> 
>> \def\MySectionCommand#1#2%
>>   {\externalfigure[section-\currentheadnumber]}
>
> Use \define[2]\MySectionCommand{…} or \unexpanded\def\MySectionCommand#1#2{…}.
>
> To get the section number for the figure you have to replace 
> “\currentheadnumber” with “\namedheadnumber{section}”.
>
> Wolfgang

Wow that was fast, thanks Wolfgang.

I started to change the examples in the wiki
<http://wiki.contextgarden.net/Titles>. But I realised we need to
distinguish MKIV from MKII and I don't really know what I am doing...



-- 

John Devereux
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to