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
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
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
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
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
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
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
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
participants (3)
-
Hans van der Meer
-
Jano Kula
-
Taco Hoekwater