ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Itemize Prefixes
@ 2012-03-05  3:52 Kip Warner
  2012-03-05  4:26 ` Aditya Mahajan
  0 siblings, 1 reply; 10+ messages in thread
From: Kip Warner @ 2012-03-05  3:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 726 bytes --]

Hey list,

I'd like an itemized list using the following format...

Article I ...
Article II ...
Article III ...

...and so on. I've tried defining the behaviour with...

\defineenumeration[article]
    [location=top,
    text=Article,
    between=\blank,
    before=\blank,
    after=\blank]
\setupenumerations[article][R]

...but the problem is that after a list of items provided with matching
\startarticle \stoparticle pairs, the last count persists to the next
list of items which should start at 'I' again. I am assuming I am not
doing this correctly and would appreciate any suggestions.

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Itemize Prefixes
  2012-03-05  3:52 Itemize Prefixes Kip Warner
@ 2012-03-05  4:26 ` Aditya Mahajan
  2012-03-06  2:16   ` Kip Warner
  0 siblings, 1 reply; 10+ messages in thread
From: Aditya Mahajan @ 2012-03-05  4:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, 4 Mar 2012, Kip Warner wrote:

> Hey list,
>
> I'd like an itemized list using the following format...
>
> Article I ...
> Article II ...
> Article III ...
>
> ...and so on. I've tried defining the behaviour with...
>
> \defineenumeration[article]
>    [location=top,
>    text=Article,
>    between=\blank,
>    before=\blank,
>    after=\blank]
> \setupenumerations[article][R]
>
> ...but the problem is that after a list of items provided with matching
> \startarticle \stoparticle pairs, the last count persists to the next
> list of items which should start at 'I' again. I am assuming I am not
> doing this correctly and would appreciate any suggestions.

Use itemgroup rather than enumerations.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Itemize Prefixes
  2012-03-05  4:26 ` Aditya Mahajan
@ 2012-03-06  2:16   ` Kip Warner
  2012-03-06  3:10     ` Aditya Mahajan
  0 siblings, 1 reply; 10+ messages in thread
From: Kip Warner @ 2012-03-06  2:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1097 bytes --]

On Sun, 2012-03-04 at 23:26 -0500, Aditya Mahajan wrote:
> On Sun, 4 Mar 2012, Kip Warner wrote:
> 
> > Hey list,
> >
> > I'd like an itemized list using the following format...
> >
> > Article I ...
> > Article II ...
> > Article III ...
> >
> > ...and so on. I've tried defining the behaviour with...
> >
> > \defineenumeration[article]
> >    [location=top,
> >    text=Article,
> >    between=\blank,
> >    before=\blank,
> >    after=\blank]
> > \setupenumerations[article][R]
> >
> > ...but the problem is that after a list of items provided with matching
> > \startarticle \stoparticle pairs, the last count persists to the next
> > list of items which should start at 'I' again. I am assuming I am not
> > doing this correctly and would appreciate any suggestions.
> 
> Use itemgroup rather than enumerations.

Thanks Aditya, but could you give me an example of how to do this? As
usual, I am not able to take much away from the ConTeXt wiki. Sorry.

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Itemize Prefixes
  2012-03-06  2:16   ` Kip Warner
@ 2012-03-06  3:10     ` Aditya Mahajan
  2012-03-06  3:33       ` Kip Warner
  2012-03-06  3:39       ` Kip Warner
  0 siblings, 2 replies; 10+ messages in thread
From: Aditya Mahajan @ 2012-03-06  3:10 UTC (permalink / raw)
  To: Kip Warner; +Cc: mailing list for ConTeXt users

On Mon, 5 Mar 2012, Kip Warner wrote:

> On Sun, 2012-03-04 at 23:26 -0500, Aditya Mahajan wrote:
>> On Sun, 4 Mar 2012, Kip Warner wrote:
>>
>>> Hey list,
>>>
>>> I'd like an itemized list using the following format...
>>>
>>> Article I ...
>>> Article II ...
>>> Article III ...
>>>
>>> ...and so on. I've tried defining the behaviour with...
>>>
>>> \defineenumeration[article]
>>>    [location=top,
>>>    text=Article,
>>>    between=\blank,
>>>    before=\blank,
>>>    after=\blank]
>>> \setupenumerations[article][R]
>>>
>>> ...but the problem is that after a list of items provided with matching
>>> \startarticle \stoparticle pairs, the last count persists to the next
>>> list of items which should start at 'I' again. I am assuming I am not
>>> doing this correctly and would appreciate any suggestions.
>>
>> Use itemgroup rather than enumerations.
>
> Thanks Aditya, but could you give me an example of how to do this? As
> usual, I am not able to take much away from the ConTeXt wiki. Sorry.

\defineitemgroup[article]

\setupitemgroup
   [article]
   [
     left={Article },
     stopper=,
     symbol=R,
     before=\blank,
     after=\blank,
     distance=0.5em,
   ]

\setupitemgroup
   [article]
   [broad,fit]


\starttext

\startarticle
   \item First article
   \item Second article
\stoparticle

Again

\startarticle
   \item First article
   \item Second article
\stoparticle
\stoptext

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Itemize Prefixes
  2012-03-06  3:10     ` Aditya Mahajan
@ 2012-03-06  3:33       ` Kip Warner
  2012-03-06  3:44         ` Aditya Mahajan
  2012-03-06  3:39       ` Kip Warner
  1 sibling, 1 reply; 10+ messages in thread
From: Kip Warner @ 2012-03-06  3:33 UTC (permalink / raw)
  To: Aditya Mahajan; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1179 bytes --]

On Mon, 2012-03-05 at 22:10 -0500, Aditya Mahajan wrote:

Thanks Aditya. A couple questions for you.

> \defineitemgroup[article]
> 
> \setupitemgroup
>    [article]
>    [
>      left={Article },
>      stopper=,
>      symbol=R,
>      before=\blank,
>      after=\blank,
>      distance=0.5em,
>    ]
> 
> \setupitemgroup
>    [article]
>    [broad,fit]

Why is another \setupitemgroup being used here when broad,fit could have
been merged with its previous one that both affected the article
itemgroup?

> 
> \starttext
> 
> \startarticle
>    \item First article
>    \item Second article
> \stoparticle
> 
> Again

How do I add an extra line after the header? I tried adding another
\blank to the after parameter of \setupitemgroup, but it didn't seem to
use it.

> \startarticle
>    \item First article
>    \item Second article
> \stoparticle
> \stoptext
> 
> Aditya

Lastly, how do I change the text colour of the item header? I tried the
following to no avail,

\setuphead
  [article]
  [color=colour_head]

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Itemize Prefixes
  2012-03-06  3:10     ` Aditya Mahajan
  2012-03-06  3:33       ` Kip Warner
@ 2012-03-06  3:39       ` Kip Warner
  1 sibling, 0 replies; 10+ messages in thread
From: Kip Warner @ 2012-03-06  3:39 UTC (permalink / raw)
  To: Aditya Mahajan; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 641 bytes --]

On Mon, 2012-03-05 at 22:10 -0500, Aditya Mahajan wrote:
> \starttext
> 
> \startarticle
>    \item First article
>    \item Second article
> \stoparticle
> 
> Again

Another thing I just noticed is that using \startarticle[start=20]
before an item block doesn't always begin counting at that. On some
blocks it starts where it should at 'start', and other times it ignores
it and starts from 1 again.

> \startarticle
>    \item First article
>    \item Second article
> \stoparticle
> \stoptext
> 
> Aditya

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Itemize Prefixes
  2012-03-06  3:33       ` Kip Warner
@ 2012-03-06  3:44         ` Aditya Mahajan
  2012-03-06  4:02           ` Kip Warner
  0 siblings, 1 reply; 10+ messages in thread
From: Aditya Mahajan @ 2012-03-06  3:44 UTC (permalink / raw)
  To: Kip Warner; +Cc: mailing list for ConTeXt users

On Mon, 5 Mar 2012, Kip Warner wrote:

> On Mon, 2012-03-05 at 22:10 -0500, Aditya Mahajan wrote:
>
> Thanks Aditya. A couple questions for you.
>
>> \defineitemgroup[article]
>>
>> \setupitemgroup
>>    [article]
>>    [
>>      left={Article },
>>      stopper=,
>>      symbol=R,
>>      before=\blank,
>>      after=\blank,
>>      distance=0.5em,
>>    ]
>>
>> \setupitemgroup
>>    [article]
>>    [broad,fit]
>
> Why is another \setupitemgroup being used here when broad,fit could have
> been merged with its previous one that both affected the article
> itemgroup?

Thats how itemgroup are configured. You cannot mix assignments (key=value) 
with options.

>> \starttext
>>
>> \startarticle
>>    \item First article
>>    \item Second article
>> \stoparticle
>>
>> Again
>
> How do I add an extra line after the header?

You can use

\setupitemgroup
     [article]
     [command=\blank]

(in this case you can remove the second configuration (the one with broad, 
fit) or explicitly set width=0).

> I tried adding another
> \blank to the after parameter of \setupitemgroup, but it didn't seem to
> use it.
>
>> \startarticle
>>    \item First article
>>    \item Second article
>> \stoparticle
>> \stoptext
>>
>> Aditya
>
> Lastly, how do I change the text colour of the item header? I tried the
> following to no avail,
>
> \setuphead
>  [article]
>  [color=colour_head]

Why do you expect \setuphead to change the way itemgroups behave? Use


\setupitemgroup
    [article]
    [color=...]

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Itemize Prefixes
  2012-03-06  3:44         ` Aditya Mahajan
@ 2012-03-06  4:02           ` Kip Warner
  2012-03-06  5:22             ` Aditya Mahajan
  0 siblings, 1 reply; 10+ messages in thread
From: Kip Warner @ 2012-03-06  4:02 UTC (permalink / raw)
  To: Aditya Mahajan; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1369 bytes --]

On Mon, 2012-03-05 at 22:44 -0500, Aditya Mahajan wrote:
> Thats how itemgroup are configured. You cannot mix assignments (key=value) 
> with options.

I don't follow. What is the difference between this,

\setupitemgroup
   [article]
   [
     left={Article },
     stopper=,
     symbol=R,
     before=\blank,
     after=\blank,
     distance=0.5em,
   ]
\setupitemgroup
   [article]
   [broad,fit]

, and this?

\setupitemgroup
   [article]
   [
     left={Article },
     stopper=,
     symbol=R,
     before=\blank,
     after=\blank,
     distance=0.5em,
     broad,
     fit
   ]

> You can use
> 
> \setupitemgroup
>      [article]
>      [command=\blank]

That worked. Thanks.

> Why do you expect \setuphead to change the way itemgroups behave? 

Because I can't make any sense of the thousands of pages of ConTeXt
documentation scattered everywhere with little apparent rhyme or reason
to its usage and with everything other than whatever it is that I seem
to need present in them.

> Use
> 
> 
> \setupitemgroup
>     [article]
>     [color=...]

I tried that and it did nothing.

\definecolor[colour_text][r=0.754,g=0.516,b=0.324]
\setupitemgroup
    [article]
    [color=colour_text]

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Itemize Prefixes
  2012-03-06  4:02           ` Kip Warner
@ 2012-03-06  5:22             ` Aditya Mahajan
  2012-03-06  6:28               ` Kip Warner
  0 siblings, 1 reply; 10+ messages in thread
From: Aditya Mahajan @ 2012-03-06  5:22 UTC (permalink / raw)
  To: Kip Warner; +Cc: mailing list for ConTeXt users

On Mon, 5 Mar 2012, Kip Warner wrote:

> On Mon, 2012-03-05 at 22:44 -0500, Aditya Mahajan wrote:
>> Thats how itemgroup are configured. You cannot mix assignments (key=value)
>> with options.
>
> I don't follow. What is the difference between this,
>
> \setupitemgroup
>   [article]
>   [
>     left={Article },
>     stopper=,
>     symbol=R,
>     before=\blank,
>     after=\blank,
>     distance=0.5em,
>   ]
> \setupitemgroup
>   [article]
>   [broad,fit]
>
> , and this?
>
> \setupitemgroup
>   [article]
>   [
>     left={Article },
>     stopper=,
>     symbol=R,
>     before=\blank,
>     after=\blank,
>     distance=0.5em,
>     broad,
>     fit
>   ]


ConTeXt checks if the argument of \setupitemgroup has an assignment 
(key=value), then it calls a version of \setparameters; otherwise it calls 
a version of \processcommalist. So, if you use assignments and options in 
the same command, the options get ignored.

All ConTeXt commands behave like this.

>> You can use
>>
>> \setupitemgroup
>>      [article]
>>      [command=\blank]
>
> That worked. Thanks.
>
>> Why do you expect \setuphead to change the way itemgroups behave?
>
> Because I can't make any sense of the thousands of pages of ConTeXt
> documentation scattered everywhere with little apparent rhyme or reason
> to its usage and with everything other than whatever it is that I seem
> to need present in them.

If you define a command using \define<...>, then you configure it using 
\setup<....>. Other than a few exceptions, that's how it is.

>> Use
>>
>>
>> \setupitemgroup
>>     [article]
>>     [color=...]
>
> I tried that and it did nothing.
>
> \definecolor[colour_text][r=0.754,g=0.516,b=0.324]
> \setupitemgroup
>    [article]
>    [color=colour_text]

Minimal example?

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Itemize Prefixes
  2012-03-06  5:22             ` Aditya Mahajan
@ 2012-03-06  6:28               ` Kip Warner
  0 siblings, 0 replies; 10+ messages in thread
From: Kip Warner @ 2012-03-06  6:28 UTC (permalink / raw)
  To: Aditya Mahajan; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 944 bytes --]

On Tue, 2012-03-06 at 00:22 -0500, Aditya Mahajan wrote:
> ConTeXt checks if the argument of \setupitemgroup has an assignment 
> (key=value), then it calls a version of \setparameters; otherwise it calls 
> a version of \processcommalist. So, if you use assignments and options in 
> the same command, the options get ignored.
> 
> All ConTeXt commands behave like this.

That's probably buried deep in the documentation somewhere and in that
sense it's my fault. But at the same time, that's got to be the most
counterintuitive syntax of any language I've ever used.

> > \definecolor[colour_text][r=0.754,g=0.516,b=0.324]
> > \setupitemgroup
> >    [article]
> >    [color=colour_text]
> 
> Minimal example?
> 
> Aditya

It's ok, I found the problem. The code works, but I was setting the
wrong color value ;)

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-03-06  6:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-05  3:52 Itemize Prefixes Kip Warner
2012-03-05  4:26 ` Aditya Mahajan
2012-03-06  2:16   ` Kip Warner
2012-03-06  3:10     ` Aditya Mahajan
2012-03-06  3:33       ` Kip Warner
2012-03-06  3:44         ` Aditya Mahajan
2012-03-06  4:02           ` Kip Warner
2012-03-06  5:22             ` Aditya Mahajan
2012-03-06  6:28               ` Kip Warner
2012-03-06  3:39       ` Kip Warner

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).