Re: [NTG-context] Overriding the number on a float

2020-08-25 Thread Aditya Mahajan
On Mon, 24 Aug 2020, Taco Hoekwater wrote:

> 
> 
> > On 24 Aug 2020, at 19:59, Wolfgang Schuster 
> >  wrote:
> >> \setcounter[figure][5] % next figure is no.6
> 
> For this subfigure stuff, perhaps this is useful?
> 
> [...] 
> 
> I could not find a safe way to increment the subfigure number automatically, 
> unfortunately.

Another option is to define:

\startplacesubfigure ... \stopplacesubfigure

which could use the current value of figure counter as prefix and increment the 
subfigure counter. Something similar is there for subformulas in the math mode, 
but I'll have to go back and check the implementation details. 

Aditya
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Overriding the number on a float

2020-08-25 Thread Duncan Hothersall
Thanks all for useful tips. I ended up doing something similar as a short
term fix for my float number override issue, basically setting up a new
float type to use for the deviant ones and then resetting the numbering of
the existing ones. It would be great if there was a facility to just drop
in an override on an individual float using the equivalent of
ownnumber={27.1b}, but I appreciate this may be much more complex under the
hood than it seems to a mere mortal. Certainly my brief perusal of the
sources left me baffled, as usual!

Thanks again.

Duncan

On Mon, 24 Aug 2020 at 22:51, Taco Hoekwater  wrote:

>
>
> > On 24 Aug 2020, at 19:59, Wolfgang Schuster <
> wolfgang.schuster.li...@gmail.com> wrote:
> >
> >>
> >>
> >> \setcounter[figure][5] % next figure is no.6
>
> For this subfigure stuff, perhaps this is useful?
>
> % setup definitions
> \definecounter[subfigure][way=bytext,prefix=no]
> \setupcounter[subfigure][state=start,numberconversion=a]
> \setcounter[subfigure][1]
>
> \def\setsubfigures
>   {\setcounter[subfigure][1]
>\incrementcounter[figure]
>
>  
> \setupcaption[figure][state=stop,numberstopper={\convertedcounter[subfigure]}]}
>
> \def\unsetsubfigures
>   {\setupcaption[figure][state=start,numberstopper=]}
>
> %usage
> \setsubfigures
>
> \startplacefigure[title=Test figure]
> \externalfigure[dummy]
> \stopplacefigure
>
> \incrementnumber[subfigure]
>
> \startplacefigure[title=Test another figure]
> \externalfigure[dummy]
> \stopplacefigure
>
> \unsetsubfigures
>
>
> I could not find a safe way to increment the subfigure number
> automatically, unfortunately.
>
> Best wishes,
> Taco
>
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>


-- 
Duncan Hothersall, Operations Director
CAPDM Limited - Online Program Enablers
0131 677 2400  www.capdm.com
Registered in Scotland: SC168970   VAT: 682 846 983
Registered address: 20 Forth Street Edinburgh EH1 3LH UK


Capture, author, publish, deliver and manage your learning materials.


*Sign up to the CAPDM newsletter here *
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Overriding the number on a float

2020-08-24 Thread Taco Hoekwater


> On 24 Aug 2020, at 19:59, Wolfgang Schuster 
>  wrote:
> 
>> 
>> 
>> \setcounter[figure][5] % next figure is no.6

For this subfigure stuff, perhaps this is useful?

% setup definitions
\definecounter[subfigure][way=bytext,prefix=no]
\setupcounter[subfigure][state=start,numberconversion=a]
\setcounter[subfigure][1]

\def\setsubfigures
  {\setcounter[subfigure][1]
   \incrementcounter[figure]
   
\setupcaption[figure][state=stop,numberstopper={\convertedcounter[subfigure]}]}

\def\unsetsubfigures
  {\setupcaption[figure][state=start,numberstopper=]}

%usage
\setsubfigures

\startplacefigure[title=Test figure]
\externalfigure[dummy]
\stopplacefigure

\incrementnumber[subfigure]

\startplacefigure[title=Test another figure]
\externalfigure[dummy]
\stopplacefigure

\unsetsubfigures


I could not find a safe way to increment the subfigure number automatically, 
unfortunately.

Best wishes,
Taco
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Overriding the number on a float

2020-08-24 Thread Otared Kavian
Hi,

If there are a few special numberings of floats, and one wants floats numbered 
1.6a and 1.6b, the following seems to work:

Best regards: Otared

%%% begin ownnumber-in-floats.tex
\useMPlibrary[dum]

\starttext

\startsection[title=One]
\startplacefigure[title=Test]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\startsection[title=Two]
\startplacefigure[title=Test]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\setcounter[figure][5] % next figure is no.6

\startsection[ownnumber=10,title={A section}] 
\start
\setupcaptions[numberstopper={a}]
\startplacefigure[title=Test figure]
\externalfigure[dummy]
\stopplacefigure
\stop
\stopsection

\setcounter[figure][5]

\startsection[ownnumber=11,title={Another section}] % ownnumber doesn’t work
\start
\setupcaptions[numberstopper={b}]
\startplacefigure[title=Test another figure]
\externalfigure[dummy]
\stopplacefigure
\stop

\startplacefigure[title=Test another figure]
\externalfigure[dummy]
\stopplacefigure

\stopsection

\stoptext
%%% end ownnumber-in-floats.tex

> On 24 Aug 2020, at 19:37, Henning Hraban Ramm  wrote:
> 
> 
> 
>> Am 24.08.2020 um 17:36 schrieb Wolfgang Schuster 
>> :
>> 
>> Henning Hraban Ramm schrieb am 24.08.2020 um 15:29:
 Am 23.08.2020 um 11:25 schrieb Duncan Hothersall :
 
 I think there was a question on this very recently but I don;t think it 
 got an answer and I can't find it to reply to, so apologies for the extra 
 noise. I have a large text with floats numbered sequentially by chapter 
 and then figure/table number, but at the last minute I've had a request 
 for two figures in a particular chapter to become 27.1a and 27.1b instead 
 of 27.1 and 27.2. It's not a combination - they are separate figures on 
 different pages.
 
 I've experimented with the options I can see, but it's not obvious if 
 there is a facility to override the numbering of two figures in a stream 
 of normally numbered figures like this. I was thinking of the equivalent 
 of the old \sym{symbol} command that used to work as a way to override a 
 single item in an otherwise sequential list.
 
 I guess there's a brute force method of setting up a new type of figure 
 with the label "Figure 27.1" and having them numbered as lowercase alpha, 
 but if there's an easier way that would be great.
>>> I’m also interested in overriding automatical numbering, e.g. of chapters 
>>> or itemization items.
>>> E.g. in my songbook, I’d like to have the verses numbered but interrupted 
>>> by a chorus numbered as "C" (i.e. "R" in German).
>>> Similarly the paragraphs of some (by)laws that were changed a lot and use a 
>>> numbering like 1, 2, 3, 3a, 4, 7...
>>> Something like
>>> \startitem[number={R}]
>>> or
>>> \startsection[number={3a}]
>>> would be nice.
>>> If I set it to an integer, ConTeXt should set the counter accordingly, 
>>> otherwise continue counting from the previous calculated number. Would that 
>>> be possible?
>> 
>> 
>> You can set your own section numbers but the counter isn't stopped.
> 
> Thank you! I overlooked "ownnumber". It works for sections, but not for items 
> or floats.
> 
> \setnumber[section][10] doesn’t work, \setcounter the same (according to the 
> source they’re synonymous) – does section use a different counter name or is 
> it no counter at all?
> 
> \setnumber[figure][10] works (but only with integers, not some alphanumerical 
> stuff, sorry Duncan).
> 
> Hraban
> 
> 
> \useMPlibrary[dum]
> 
> \starttext
> 
> \startsection[title=One]
> \startplacefigure[title=Test]
> \externalfigure[dummy]
> \stopplacefigure
> \stopsection
> 
> \startsection[title=Two]
> \startplacefigure[title=Test]
> \externalfigure[dummy]
> \stopplacefigure
> \stopsection
> 
> \setcounter[figure][5] % next figure is no.6
> 
> \startsection[ownnumber=10,title=???] % ownnumber doesn’t work
> \startplacefigure[title=Test,ownnumber=10]
> \externalfigure[dummy]
> \stopplacefigure
> \stopsection
> 
> \setcounter[section][5] % doesn’t work
> 
> \startsection[title=Three]
> \startitemize[n]
>  \item one
>  \item two
>  \item three
>  \startitem[ownnumber=9] five\stopitem  % ownnumber doesn’t work
> \stopitemize
> \stopsection
> 
> \stoptext
> 
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 

Re: [NTG-context] Overriding the number on a float

2020-08-24 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 24.08.2020 um 19:37:

Am 24.08.2020 um 17:36 schrieb Wolfgang Schuster 
:

Henning Hraban Ramm schrieb am 24.08.2020 um 15:29:

Am 23.08.2020 um 11:25 schrieb Duncan Hothersall :

I think there was a question on this very recently but I don;t think it got an 
answer and I can't find it to reply to, so apologies for the extra noise. I 
have a large text with floats numbered sequentially by chapter and then 
figure/table number, but at the last minute I've had a request for two figures 
in a particular chapter to become 27.1a and 27.1b instead of 27.1 and 27.2. 
It's not a combination - they are separate figures on different pages.

I've experimented with the options I can see, but it's not obvious if there is 
a facility to override the numbering of two figures in a stream of normally 
numbered figures like this. I was thinking of the equivalent of the old 
\sym{symbol} command that used to work as a way to override a single item in an 
otherwise sequential list.

I guess there's a brute force method of setting up a new type of figure with the label 
"Figure 27.1" and having them numbered as lowercase alpha, but if there's an 
easier way that would be great.

I’m also interested in overriding automatical numbering, e.g. of chapters or 
itemization items.
E.g. in my songbook, I’d like to have the verses numbered but interrupted by a chorus numbered as 
"C" (i.e. "R" in German).
Similarly the paragraphs of some (by)laws that were changed a lot and use a 
numbering like 1, 2, 3, 3a, 4, 7...
Something like
\startitem[number={R}]
or
\startsection[number={3a}]
would be nice.
If I set it to an integer, ConTeXt should set the counter accordingly, 
otherwise continue counting from the previous calculated number. Would that be 
possible?


You can set your own section numbers but the counter isn't stopped.

Thank you! I overlooked "ownnumber". It works for sections, but not for items 
or floats.

\setnumber[section][10] doesn’t work, \setcounter the same (according to the 
source they’re synonymous) – does section use a different counter name or is it 
no counter at all?

\setnumber[figure][10] works (but only with integers, not some alphanumerical 
stuff, sorry Duncan).


\setupnumber is a synonym of \setupcounter and exists for backwards 
compatibility.



Hraban


\useMPlibrary[dum]

\starttext

\startsection[title=One]
\startplacefigure[title=Test]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\startsection[title=Two]
\startplacefigure[title=Test]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\setcounter[figure][5] % next figure is no.6

\startsection[ownnumber=10,title=???] % ownnumber doesn’t work
\startplacefigure[title=Test,ownnumber=10]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\setcounter[section][5] % doesn’t work


\setupheadnumber[section][5]


\startsection[title=Three]
\startitemize[n]
   \item one
   \item two
   \item three
   \startitem[ownnumber=9] five\stopitem  % ownnumber doesn’t work



\starttext
\startitemize
\txt{I.} \unknown
\sym{7.} \unknown
\stopitemize
\stoptext

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Overriding the number on a float

2020-08-24 Thread Henning Hraban Ramm


> Am 24.08.2020 um 17:36 schrieb Wolfgang Schuster 
> :
> 
> Henning Hraban Ramm schrieb am 24.08.2020 um 15:29:
>>> Am 23.08.2020 um 11:25 schrieb Duncan Hothersall :
>>> 
>>> I think there was a question on this very recently but I don;t think it got 
>>> an answer and I can't find it to reply to, so apologies for the extra 
>>> noise. I have a large text with floats numbered sequentially by chapter and 
>>> then figure/table number, but at the last minute I've had a request for two 
>>> figures in a particular chapter to become 27.1a and 27.1b instead of 27.1 
>>> and 27.2. It's not a combination - they are separate figures on different 
>>> pages.
>>> 
>>> I've experimented with the options I can see, but it's not obvious if there 
>>> is a facility to override the numbering of two figures in a stream of 
>>> normally numbered figures like this. I was thinking of the equivalent of 
>>> the old \sym{symbol} command that used to work as a way to override a 
>>> single item in an otherwise sequential list.
>>> 
>>> I guess there's a brute force method of setting up a new type of figure 
>>> with the label "Figure 27.1" and having them numbered as lowercase alpha, 
>>> but if there's an easier way that would be great.
>> I’m also interested in overriding automatical numbering, e.g. of chapters or 
>> itemization items.
>> E.g. in my songbook, I’d like to have the verses numbered but interrupted by 
>> a chorus numbered as "C" (i.e. "R" in German).
>> Similarly the paragraphs of some (by)laws that were changed a lot and use a 
>> numbering like 1, 2, 3, 3a, 4, 7...
>> Something like
>> \startitem[number={R}]
>> or
>> \startsection[number={3a}]
>> would be nice.
>> If I set it to an integer, ConTeXt should set the counter accordingly, 
>> otherwise continue counting from the previous calculated number. Would that 
>> be possible?
> 
> 
> You can set your own section numbers but the counter isn't stopped.

Thank you! I overlooked "ownnumber". It works for sections, but not for items 
or floats.

\setnumber[section][10] doesn’t work, \setcounter the same (according to the 
source they’re synonymous) – does section use a different counter name or is it 
no counter at all?

\setnumber[figure][10] works (but only with integers, not some alphanumerical 
stuff, sorry Duncan).

Hraban


\useMPlibrary[dum]

\starttext

\startsection[title=One]
\startplacefigure[title=Test]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\startsection[title=Two]
\startplacefigure[title=Test]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\setcounter[figure][5] % next figure is no.6

\startsection[ownnumber=10,title=???] % ownnumber doesn’t work
\startplacefigure[title=Test,ownnumber=10]
\externalfigure[dummy]
\stopplacefigure
\stopsection

\setcounter[section][5] % doesn’t work

\startsection[title=Three]
\startitemize[n]
  \item one
  \item two
  \item three
  \startitem[ownnumber=9] five\stopitem  % ownnumber doesn’t work
\stopitemize
\stopsection

\stoptext

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Overriding the number on a float

2020-08-24 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 24.08.2020 um 15:29:




Am 23.08.2020 um 11:25 schrieb Duncan Hothersall :

I think there was a question on this very recently but I don;t think it got an 
answer and I can't find it to reply to, so apologies for the extra noise. I 
have a large text with floats numbered sequentially by chapter and then 
figure/table number, but at the last minute I've had a request for two figures 
in a particular chapter to become 27.1a and 27.1b instead of 27.1 and 27.2. 
It's not a combination - they are separate figures on different pages.

I've experimented with the options I can see, but it's not obvious if there is 
a facility to override the numbering of two figures in a stream of normally 
numbered figures like this. I was thinking of the equivalent of the old 
\sym{symbol} command that used to work as a way to override a single item in an 
otherwise sequential list.

I guess there's a brute force method of setting up a new type of figure with the label 
"Figure 27.1" and having them numbered as lowercase alpha, but if there's an 
easier way that would be great.


I’m also interested in overriding automatical numbering, e.g. of chapters or 
itemization items.

E.g. in my songbook, I’d like to have the verses numbered but interrupted by a chorus numbered as 
"C" (i.e. "R" in German).
Similarly the paragraphs of some (by)laws that were changed a lot and use a 
numbering like 1, 2, 3, 3a, 4, 7...

Something like
\startitem[number={R}]
or
\startsection[number={3a}]
would be nice.
If I set it to an integer, ConTeXt should set the counter accordingly, 
otherwise continue counting from the previous calculated number. Would that be 
possible?



You can set your own section numbers but the counter isn't stopped.

\starttext

\startsection[title=One]
\stopsection

\startsection[title=Two]
\stopsection

\startsection[ownnumber=X,title=???]
\stopsection

\startsection[title=Three]
\stopsection

\stoptext

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Overriding the number on a float

2020-08-24 Thread Henning Hraban Ramm


> Am 23.08.2020 um 11:25 schrieb Duncan Hothersall :
> 
> I think there was a question on this very recently but I don;t think it got 
> an answer and I can't find it to reply to, so apologies for the extra noise. 
> I have a large text with floats numbered sequentially by chapter and then 
> figure/table number, but at the last minute I've had a request for two 
> figures in a particular chapter to become 27.1a and 27.1b instead of 27.1 and 
> 27.2. It's not a combination - they are separate figures on different pages.
> 
> I've experimented with the options I can see, but it's not obvious if there 
> is a facility to override the numbering of two figures in a stream of 
> normally numbered figures like this. I was thinking of the equivalent of the 
> old \sym{symbol} command that used to work as a way to override a single item 
> in an otherwise sequential list.
> 
> I guess there's a brute force method of setting up a new type of figure with 
> the label "Figure 27.1" and having them numbered as lowercase alpha, but if 
> there's an easier way that would be great.

I’m also interested in overriding automatical numbering, e.g. of chapters or 
itemization items.

E.g. in my songbook, I’d like to have the verses numbered but interrupted by a 
chorus numbered as "C" (i.e. "R" in German).
Similarly the paragraphs of some (by)laws that were changed a lot and use a 
numbering like 1, 2, 3, 3a, 4, 7...

Something like
\startitem[number={R}]
or
\startsection[number={3a}]
would be nice.
If I set it to an integer, ConTeXt should set the counter accordingly, 
otherwise continue counting from the previous calculated number. Would that be 
possible?

BTW do sections, items and floats all use counters (\setnumber/\getnumber) or 
other mechanisms?


Hraban
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Overriding the number on a float

2020-08-23 Thread Duncan Hothersall
I think there was a question on this very recently but I don;t think it got
an answer and I can't find it to reply to, so apologies for the extra
noise. I have a large text with floats numbered sequentially by chapter and
then figure/table number, but at the last minute I've had a request for two
figures in a particular chapter to become 27.1a and 27.1b instead of 27.1
and 27.2. It's not a combination - they are separate figures on different
pages.

I've experimented with the options I can see, but it's not obvious if there
is a facility to override the numbering of two figures in a stream of
normally numbered figures like this. I was thinking of the equivalent of
the old \sym{symbol} command that used to work as a way to override a
single item in an otherwise sequential list.

I guess there's a brute force method of setting up a new type of figure
with the label "Figure 27.1" and having them numbered as lowercase alpha,
but if there's an easier way that would be great.

Thanks.

Duncan
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___