Re: \setupheadnumber question
Florent Michel <[email protected]>
| Newsgroups | gmane.comp.tex.context |
|---|---|
| Message-ID | <CALOhoeKwDPnvFSEJiicVwDU+kRmG7xdEF3Wt2zzSSOdcX_EwbQ@mail.gmail.com> |
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.)
Cheers,
Florent
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
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \starttext
> \section{First}
> \section{Second}
> \section{Third}
>
> \setupheadnumber[section][+10]
> \section{Plus 10}
>
> \setupheadnumber[section][-4]
> \section{Minus 4}
>
> \setupheadnumber[section][+3]
> \section{Plus 3}
>
> \setupheadnumber[section][+1]
> \section{Plus 1}
> \stoptext
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> The output is (blank lines removed, editorial comments added)
>
> 1 First
> 2 Second
> 3 Third <so far so good>
> 11 Plus 10 <huh, '+10' acted like '10'>
> 8 Minus 4 <that subtracted 4, then with +1 it is
> correct>
> 4 Plus 3 <nope, should have been 12 (or 11).>
> 2 Plus 1 <nope>
>
>
> Q: is the wiki wrong, or
> is there a bug in the code, or
> am I misinterpreting the wiki sentence?
>
> (I don't think I am misinterpreting the wiki, but I have to admit the
> possibility.)
>
> If the code is right and the wiki is wrong, then +N is the same as N, which
> seems like a lost opportunity and (arguably) a bit surprising.
>
> Would someone be so kind as to give me a definitive answer?
>
> Thanks.
> 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
>
> ___________________________________________________________________________________
>
___________________________________________________________________________________
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
___________________________________________________________________________________