[NTG-context] Same counter for figures as theorems
Taco Hoekwater
taco at elvenkind.com
Fri Aug 14 23:11:42 CEST 2020
Hi Tim,
I misunderstood your goal, sorry. Proposed setup below.
But first, what I think is a bug in ConTeXt:
Neither
\setupcaptions
[counter=object]
nor
\setupcaption
[figure]
[counter=object]
work. the caption always falls back to the ‘current float counter’; figure or table or …
For the singular explicit \setupcaption[figure], I think this is a bug.
The solution I found is to blatantly redefine the ‘figure’ counter, that works!
Second, it seems that \setupenumerations does not modify the counter of an explicit defined enumeration, so you need to use the explicit \setupenumeration[enumeration] form. This may be intentional, I do not know for sure.
Here is what I believe is the required code for your desired effect (re-indented for Hans' style):
\setupcaptions
[way=bysection,
prefixsegments=chapter:section]
\setupenumerations
[prefix=yes,
prefixsegments=chapter:section]
\defineenumeration
[enumeration]
[text=Enumeration]
\definecounter
[object]
[way=bysection]
\setupenumeration
[enumeration]
[counter=object]
\definecounter
[figure]
[object]
Best wishes,
Taco
> On 14 Aug 2020, at 09:49, Tim Steenvoorden <tim.steenvoorden at gmail.com> wrote:
>
> Hi Taco,
>
> Thanks for your example and the pointer to make a MWE.
>
> Sadly, it doesn’t work for me. It numbers the first enumeration 1.1.1 and the first figure _also_ 1.1.1, which I’d like to be 1.1.2.
>
> This time, you’ll find the code and the output pdf in the attachment!
>
> Cheers,
> Tim
>
>
> P.S. I’m on Context MacTeX/TeXLive 2020:
>
> mtx-context | ConTeXt Process Management 1.03
> mtx-context |
> mtx-context | main context file: /usr/local/texlive/2020basic/texmf-dist/tex/context/base/mkiv/context.mkiv
> mtx-context | current version: 2020.03.10 14:44
> mtx-context | main context file: /usr/local/texlive/2020basic/texmf-dist/tex/context/base/mkiv/context.mkxl
> mtx-context | current version: 2020.03.10 14:44
> On 13 Aug 2020, 13:12 +0200, Taco Hoekwater <taco at elvenkind.com>, wrote:
>>
>>
>>> On 13 Aug 2020, at 10:06, Tim Steenvoorden <tim.steenvoorden at gmail.com> wrote:
>>>
>>> Hi all,
>>>
>>> Anybody some pointers?
>>
>> Next time, prepare a minimal (non)working example. Because the attachment works for me.
>>
>> Best wishes,
>> Taco
>>
>>
>>
>>
>>
>> ___________________________________________________________________________________
>> If your question is of interest to others as well, please add an entry to the Wiki!
>>
>> maillist : ntg-context at 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
>> ___________________________________________________________________________________
> <test-counters.tex><test-counters.pdf>___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context at 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
> ___________________________________________________________________________________
Taco Hoekwater
Elvenkind BV
More information about the ntg-context
mailing list