Re: \setupheadnumber question
Jim <[email protected]>
| Newsgroups | gmane.comp.tex.context |
|---|---|
| Message-ID | <[email protected]> |
Florent and Pablo,
thanks very much for getting back. In particular, thanks to both of you
for pointing out the code in strc-sec.mkxl.
Comments below...
On Sat, Mar 21, 2026 at 16:53 (+0000), Florent Michel wrote:
> Hi,
> In case it helps, the output looks consistent with the wiki with the
> following change in strc-sec.mkxl (line 1322):
> \permanent\tolerant\protected\def\setupheadnumber[#1]#*[#2]% todo: reset
> if at other level
> - {\setstructurenumber{\thenamedheadlevel{#1}}{\number#2}}
> + {\setstructurenumber{\thenamedheadlevel{#1}}{#2}}
> (But I am, by far, not familiar enough with the code to know if this
> change would have negative effects.)
I suppose there is also concern about this change being
non-backward-compatible.
Although given the difference between the wiki and this, I wonder how many
people have ever used it.
> Le sam. 21 mars 2026 à 14:23, Jim <[email protected]> a écrit :
>> Hi,
>> the wiki says
>> If the second argument is signed, the heading’s number will be
>> increased or decreased by the specified amount instead.
>> However, that is not what happens for numbers with a leading '+'.
>> For example, in
<snip>
On Sat, Mar 21, 2026 at 17:57 (+0100), Pablo Rodriguez via ntg-context wrote:
> On 3/21/26 15:21, Jim wrote:
>> Hi,
>> the wiki says
>> If the second argument is signed, the heading’s number will be
>> increased or decreased by the specified amount instead.
>> […]
>> Q: is the wiki wrong, or
> Hi Jim,
> according to lines 1313-L1316 from `strc-sec.mkxl`, the wiki may be wrong:
> % We do support negative numbers but it can have side effects that we
> won't catch:
> %
> % \chapter{some} \setupheadnumber[chapter][3] \chapter{more}
> % \setupheadnumber[section][8] \section{b} \section{c}
> \setupheadnumber[section][-1] \section{d}
This is a sort of interesting comment, because it seems to indicate an
issue, but it looks OK if you don't mind the fact that the section numbers
are not unique and increasing. Which seems to be the whole point of
allowing a '-N' type of argument.
> It seems that positive numbers are considered absolute (so they don’t
> increment anything).
They currently are. But as Florent points out, a very small change fixes
this. But should the change be made?
Thanks to all.
Jim
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : [email protected] / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________