* Automatically setting the value of list key in annotation module
@ 2020-12-08 7:47 Aditya Mahajan
2020-12-08 9:17 ` Hans Hagen
0 siblings, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2020-12-08 7:47 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi,
In the annotation module, is it possible to automatically set the value of the `list` key to be the same as the value of `title` key (as is the case with \startsection, for example).
Here is a non-working example:
\usemodule[annotation]
\defineannotation[test][alternative=paragraph]
\starttext
\placelist[test][criterium=all]
\starttest[title={This is a title}]
\input ward
\stoptest
\starttest[title={This is another title}, list={This is in the 2nd list}]
\input ward
\stoptest
I want the first title to also be added to the list.
Thanks,
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Automatically setting the value of list key in annotation module
2020-12-08 7:47 Automatically setting the value of list key in annotation module Aditya Mahajan
@ 2020-12-08 9:17 ` Hans Hagen
2020-12-08 16:55 ` Aditya Mahajan
0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2020-12-08 9:17 UTC (permalink / raw)
To: Aditya Mahajan, mailing list for ConTeXt users
On 12/8/2020 8:47 AM, Aditya Mahajan wrote:
> \usemodule[annotation]
>
> \defineannotation[test][alternative=paragraph]
>
> \starttext
>
> \placelist[test][criterium=all]
>
> \starttest[title={This is a title}]
> \input ward
> \stoptest
>
> \starttest[title={This is another title}, list={This is in the 2nd list}]
> \input ward
> \stoptest
just cheat:
\starttest[title={This is another title}, list={This is in the 2nd
list},after={\writetolist[test]{1}{what a cheat}}]
\input ward
\stoptest
btw, maybe wolfgang should turn that module into a core mkxl one using
the new fancy macro magic
anyway, if this happens a lot we could think of some addition to the
list mechanism
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Automatically setting the value of list key in annotation module
2020-12-08 9:17 ` Hans Hagen
@ 2020-12-08 16:55 ` Aditya Mahajan
2020-12-08 17:33 ` Hans Hagen
2020-12-08 19:05 ` Aditya Mahajan
0 siblings, 2 replies; 7+ messages in thread
From: Aditya Mahajan @ 2020-12-08 16:55 UTC (permalink / raw)
To: Hans Hagen; +Cc: mailing list for ConTeXt users
Hi,
On Tue, 8 Dec 2020, Hans Hagen wrote:
> On 12/8/2020 8:47 AM, Aditya Mahajan wrote:
> > \usemodule[annotation]
> >
> > \defineannotation[test][alternative=paragraph]
> >
> > \starttext
> >
> > \placelist[test][criterium=all]
> >
> > \starttest[title={This is a title}]
> > \input ward
> > \stoptest
> >
> > \starttest[title={This is another title}, list={This is in the 2nd list}]
> > \input ward
> > \stoptest
>
> just cheat:
>
> \starttest[title={This is another title}, list={This is in the 2nd
> list},after={\writetolist[test]{1}{what a cheat}}]
> \input ward
> \stoptest
I actually wanted it the other way round ... make sure that \starttest[test][title={...}] gets added to the list. Looking at the comments of the annotation module, I get the impression that this should work.
I could do it manually by adding \writetolist as part of the renderingsetup, but there are already multiple \writetolist in the annotation module, so I think that I am missing a configuration option.
> btw, maybe wolfgang should turn that module into a core mkxl one using the new
> fancy macro magic
That will be nice. There is some overlap with strc-con, but that does not have any of the goodies which the annotation module provides.
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Automatically setting the value of list key in annotation module
2020-12-08 16:55 ` Aditya Mahajan
@ 2020-12-08 17:33 ` Hans Hagen
2020-12-08 19:05 ` Aditya Mahajan
1 sibling, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2020-12-08 17:33 UTC (permalink / raw)
To: Aditya Mahajan; +Cc: mailing list for ConTeXt users
On 12/8/2020 5:55 PM, Aditya Mahajan wrote:
> That will be nice. There is some overlap with strc-con, but that does not have any of the goodies which the annotation module provides.
If Wolfgang doesn't have time I can do a first adaption to lmtx ... I
leave the choice to him ...
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Automatically setting the value of list key in annotation module
2020-12-08 16:55 ` Aditya Mahajan
2020-12-08 17:33 ` Hans Hagen
@ 2020-12-08 19:05 ` Aditya Mahajan
2020-12-09 17:05 ` Wolfgang Schuster
1 sibling, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2020-12-08 19:05 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Tue, 8 Dec 2020, Aditya Mahajan wrote:
> Hi,
>
> On Tue, 8 Dec 2020, Hans Hagen wrote:
>
> > On 12/8/2020 8:47 AM, Aditya Mahajan wrote:
> > > \usemodule[annotation]
> > >
> > > \defineannotation[test][alternative=paragraph]
> > >
> > > \starttext
> > >
> > > \placelist[test][criterium=all]
> > >
> > > \starttest[title={This is a title}]
> > > \input ward
> > > \stoptest
> > >
> > > \starttest[title={This is another title}, list={This is in the 2nd list}]
> > > \input ward
> > > \stoptest
> >
> > just cheat:
> >
> > \starttest[title={This is another title}, list={This is in the 2nd
> > list},after={\writetolist[test]{1}{what a cheat}}]
> > \input ward
> > \stoptest
>
> I actually wanted it the other way round ... make sure that \starttest[test][title={...}] gets added to the list. Looking at the comments of the annotation module, I get the impression that this should work.
>
> I could do it manually by adding \writetolist as part of the renderingsetup, but there are already multiple \writetolist in the annotation module, so I think that I am missing a configuration option.
Actually, I cannot figure out how \writetolist works. According to https://wiki.contextgarden.net/Command/writetolist, the 2nd argument is the "number". But, for some reason, the list number doesn't show in placelist:
\definelist[test]
\starttext
\placelist[test][criterium=all, alternative=b]
\writetolist[test]{1}{One}
\writetolist[test]{2}{Two}
\stoptext
This gives
One 1
Two 1
while I was expecting
1 One 1
2 Two 1
What am I missing?
Thanks,
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Automatically setting the value of list key in annotation module
2020-12-08 19:05 ` Aditya Mahajan
@ 2020-12-09 17:05 ` Wolfgang Schuster
2020-12-09 20:39 ` Aditya Mahajan
0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2020-12-09 17:05 UTC (permalink / raw)
To: ntg-context
Aditya Mahajan schrieb am 08.12.2020 um 20:05:
> On Tue, 8 Dec 2020, Aditya Mahajan wrote:
>
>> Hi,
>>
>> On Tue, 8 Dec 2020, Hans Hagen wrote:
>>
>>> On 12/8/2020 8:47 AM, Aditya Mahajan wrote:
>>>> \usemodule[annotation]
>>>>
>>>> \defineannotation[test][alternative=paragraph]
>>>>
>>>> \starttext
>>>>
>>>> \placelist[test][criterium=all]
>>>>
>>>> \starttest[title={This is a title}]
>>>> \input ward
>>>> \stoptest
>>>>
>>>> \starttest[title={This is another title}, list={This is in the 2nd list}]
>>>> \input ward
>>>> \stoptest
>>> just cheat:
>>>
>>> \starttest[title={This is another title}, list={This is in the 2nd
>>> list},after={\writetolist[test]{1}{what a cheat}}]
>>> \input ward
>>> \stoptest
>> I actually wanted it the other way round ... make sure that \starttest[test][title={...}] gets added to the list. Looking at the comments of the annotation module, I get the impression that this should work.
>>
>> I could do it manually by adding \writetolist as part of the renderingsetup, but there are already multiple \writetolist in the annotation module, so I think that I am missing a configuration option.
> Actually, I cannot figure out how \writetolist works. According to https://wiki.contextgarden.net/Command/writetolist, the 2nd argument is the "number". But, for some reason, the list number doesn't show in placelist:
>
>
> \definelist[test]
>
> \starttext
>
> \placelist[test][criterium=all, alternative=b]
Add "headnumber=always".
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-12-09 20:39 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-08 7:47 Automatically setting the value of list key in annotation module Aditya Mahajan
2020-12-08 9:17 ` Hans Hagen
2020-12-08 16:55 ` Aditya Mahajan
2020-12-08 17:33 ` Hans Hagen
2020-12-08 19:05 ` Aditya Mahajan
2020-12-09 17:05 ` Wolfgang Schuster
2020-12-09 20:39 ` Aditya Mahajan
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).