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