From: John Devereux <john@devereux.me.uk>
To: ntg-context@ntg.nl
Subject: Re: setuphead broken?
Date: Thu, 13 Sep 2012 12:49:50 +0100 [thread overview]
Message-ID: <87ipbirvkx.fsf@devereux.me.uk> (raw)
In-Reply-To: <37F9EC06-013D-45A6-8DF5-0CC09F24C755@gmail.com> (Wolfgang Schuster's message of "Thu, 13 Sep 2012 12:27:44 +0200")
Wolfgang Schuster <wolfgang.schuster@gmail.com> writes:
> Am 13.09.2012 um 12:14 schrieb John Devereux <john@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
___________________________________________________________________________________
prev parent reply other threads:[~2012-09-13 11:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-13 10:14 John Devereux
2012-09-13 10:27 ` Wolfgang Schuster
2012-09-13 11:49 ` John Devereux [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ipbirvkx.fsf@devereux.me.uk \
--to=john@devereux.me.uk \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).