ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* sorting  commalist?
@ 2006-07-23 18:55 Hans van der Meer
  2006-07-24  8:18 ` Taco Hoekwater
  0 siblings, 1 reply; 8+ messages in thread
From: Hans van der Meer @ 2006-07-23 18:55 UTC (permalink / raw)



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

In the article "Context System macros, part1: general macros" there  
are all sorts of interesting and useful macros. Among these I have  
set my eye on the processing of commalists.
Question: is there a context macro that takes a commalist (either in  
a token register or \the\tokenregister form) that returns a sorted  
commalist (ascending or descending doesnt matter to me for the moment).
If someone will be so kind to point one out to me. A scan through the  
sources didn't bring an obvious candidate to my attention although I  
feel there must be one, but I may overlooking it.

Hans van der Meer




[-- Attachment #1.2: Type: text/html, Size: 1323 bytes --]

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

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: sorting  commalist?
  2006-07-23 18:55 sorting commalist? Hans van der Meer
@ 2006-07-24  8:18 ` Taco Hoekwater
  2006-07-26 14:25   ` Jano Kula
  2006-07-28  6:08   ` Hans van der Meer
  0 siblings, 2 replies; 8+ messages in thread
From: Taco Hoekwater @ 2006-07-24  8:18 UTC (permalink / raw)



Hi Hans,

Hans van der Meer wrote:
> In the article "Context System macros, part1: general macros" there are 
> all sorts of interesting and useful macros. Among these I have set my 
> eye on the processing of commalists.

I should extend that document, but I've lost the source :-(

> Question: is there a context macro that takes a commalist (either in a 
> token register or \the\tokenregister form) that returns a sorted 
> commalist (ascending or descending doesnt matter to me for the moment).

There is \sortcommalist (syst-ext.tex), but it only works for lists
of numbers, TeX does not know how to sort words. That type of sorting
has to be done externally.

Cheers,
Taco

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

* Re: sorting  commalist?
  2006-07-24  8:18 ` Taco Hoekwater
@ 2006-07-26 14:25   ` Jano Kula
  2006-07-26 20:34     ` Taco Hoekwater
  2006-07-28  6:08   ` Hans van der Meer
  1 sibling, 1 reply; 8+ messages in thread
From: Jano Kula @ 2006-07-26 14:25 UTC (permalink / raw)


Taco Hoekwater wrote:
> Hi Hans,
> 
> Hans van der Meer wrote:
>> In the article "Context System macros, part1: general macros" there are 
>> all sorts of interesting and useful macros. Among these I have set my 
>> eye on the processing of commalists.
> 
> I should extend that document, but I've lost the source :-(

Considering this document very useful I had an idea of puting at least 
parts of it on garden. So shoud I extract the texts, make some formating 
and send it to you or put it on the wiki?

Jano

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

* Re: sorting  commalist?
  2006-07-26 14:25   ` Jano Kula
@ 2006-07-26 20:34     ` Taco Hoekwater
  2006-07-29 19:43       ` Jano Kula
  0 siblings, 1 reply; 8+ messages in thread
From: Taco Hoekwater @ 2006-07-26 20:34 UTC (permalink / raw)


Jano Kula wrote:
> Taco Hoekwater wrote:
> 
>>Hi Hans,
>>
>>Hans van der Meer wrote:
>>
>>>In the article "Context System macros, part1: general macros" there are 
>>>all sorts of interesting and useful macros. Among these I have set my 
>>>eye on the processing of commalists.
>>
>>I should extend that document, but I've lost the source :-(
> 
> 
> Considering this document very useful I had an idea of puting at least 
> parts of it on garden. So shoud I extract the texts, make some formating 
> and send it to you or put it on the wiki?

The wiki would be great. That way, if I do not get around to doing
work on it, someone else can.

TIA,
Taco

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

* Re: sorting  commalist?
  2006-07-24  8:18 ` Taco Hoekwater
  2006-07-26 14:25   ` Jano Kula
@ 2006-07-28  6:08   ` Hans van der Meer
  2006-07-28 21:13     ` Taco Hoekwater
  1 sibling, 1 reply; 8+ messages in thread
From: Hans van der Meer @ 2006-07-28  6:08 UTC (permalink / raw)



On Jul 24, 2006, at 10:18, Taco Hoekwater wrote:

>
> Hi Hans,
>
> Hans van der Meer wrote:
>> In the article "Context System macros, part1: general macros"  
>> there are
>> all sorts of interesting and useful macros. Among these I have set my
>> eye on the processing of commalists.
>
> I should extend that document, but I've lost the source :-(

Well, losing the source of the first article is not such a problem as  
finishing the second one, I guess :-)

>
>> Question: is there a context macro that takes a commalist (either  
>> in a
>> token register or \the\tokenregister form) that returns a sorted
>> commalist (ascending or descending doesnt matter to me for the  
>> moment).
>
> There is \sortcommalist (syst-ext.tex), but it only works for lists
> of numbers, TeX does not know how to sort words. That type of sorting
> has to be done externally.
>

Is there a simple manner to sort the list externally and get it back  
for further processing? Otherwise, how are the indexes sorted?

Hans van der Meer

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

* Re: sorting  commalist?
  2006-07-28  6:08   ` Hans van der Meer
@ 2006-07-28 21:13     ` Taco Hoekwater
  0 siblings, 0 replies; 8+ messages in thread
From: Taco Hoekwater @ 2006-07-28 21:13 UTC (permalink / raw)


Hans van der Meer wrote:
> 
> Is there a simple manner to sort the list externally and get it back  
> for further processing? Otherwise, how are the indexes sorted?

Externally, using texexec functionality. Something like this
works well enough, I guess (but I normally sort my stuff by
piping it through the unix sort command):


% This sorts the list contained in it's argument
\def\sortalphacommacommand#1%
   {\definesorting[listsort][listsorts]%
    \processcommacommand[#1]\listsort
    \def\sortedcommalist{}%
    \def\makesortedlist##1%
        {\doglobal\appendtocommalist{##1}\sortedcommalist}%
    \setupsorting[listsort][criterium=all,command=\makesortedlist]%
    \placelistoflistsorts
    \let#1\sortedcommalist}


\def\citylist{Londen,Berlijn,New York,Parijs,Amstelveen}

\sortalphacommacommand\citylist


Cheers, taco

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

* Re: sorting  commalist?
  2006-07-26 20:34     ` Taco Hoekwater
@ 2006-07-29 19:43       ` Jano Kula
  2006-07-30  7:45         ` Taco Hoekwater
  0 siblings, 1 reply; 8+ messages in thread
From: Jano Kula @ 2006-07-29 19:43 UTC (permalink / raw)



>>> I should extend that document, but I've lost the source :-(
>>
>> Considering this document very useful I had an idea of puting at least 
>> parts of it on garden. So shoud I extract the texts, make some formating 
>> and send it to you or put it on the wiki?
> 
> The wiki would be great. That way, if I do not get around to doing
> work on it, someone else can.
> 
> TIA,

Done. http://wiki.contextgarden.net/System_Macros

The page is rather long. I leave to experienced users who are going to 
extend the article to rearrange it, if needed. Hopefully it still 
remains Taco's article, who will write part II soon ;)



Few notes for Patrick et al. regarding wiki.

1. I've found strange writing

<code>\contextversion</code> (with backslash)
<cmd>contextversion</cmd>    (without backslash)

this may lead to errors, in my opinion, syntax should be the same (with 
backslash). I'm not sure, if there is any chance to change it on the fly 
everywhere nor if it is possible at all.

2. <cmd> elements should point only to context user macros (not to TeX 
primitives nor ConText internals), right?

3. I didn't notice before that even in-line element <code> is 
highlighted in backround as the block element <texcode> is. On my 
display it is almost invisible as a part of line. If we want to 
highlight I suggest to use a bit darker or different color. Now it is 
somewhere in the middle: highlighted as well as not highlighted (dust on 
the screen).

Jano

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

* Re: sorting  commalist?
  2006-07-29 19:43       ` Jano Kula
@ 2006-07-30  7:45         ` Taco Hoekwater
  0 siblings, 0 replies; 8+ messages in thread
From: Taco Hoekwater @ 2006-07-30  7:45 UTC (permalink / raw)


Jano Kula wrote:
>>>>I should extend that document, but I've lost the source :-(
>>>
>>>Considering this document very useful I had an idea of puting at least 
>>>parts of it on garden. So shoud I extract the texts, make some formating 
>>>and send it to you or put it on the wiki?
>>
>>The wiki would be great. That way, if I do not get around to doing
>>work on it, someone else can.
>>
>>TIA,
> 
> 
> Done. http://wiki.contextgarden.net/System_Macros
> 
> The page is rather long. I leave to experienced users who are going to 
> extend the article to rearrange it, if needed. Hopefully it still 
> remains Taco's article, who will write part II soon ;)

Great, thanks for that work!

Taco

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

end of thread, other threads:[~2006-07-30  7:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-23 18:55 sorting commalist? Hans van der Meer
2006-07-24  8:18 ` Taco Hoekwater
2006-07-26 14:25   ` Jano Kula
2006-07-26 20:34     ` Taco Hoekwater
2006-07-29 19:43       ` Jano Kula
2006-07-30  7:45         ` Taco Hoekwater
2006-07-28  6:08   ` Hans van der Meer
2006-07-28 21:13     ` Taco Hoekwater

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