Thank you for your suggestions!
Jaroslav, having the numbers in a separate file and sorting there,
while possible, would increase overhead in managing the document and
make it impossible to enter phone numbers at other places in the text.
Pontus, splitting the table over pages would interact poorly with
columns since the first entry on the second page would be the one
after the last in the first column on the first page:
1 6 11
2 7 12
3 8 13
4 9 14
5 10 15
Wolfgang, this is what I was hoping for, but there are some problems:
- the numbers should be flush right
- in the real file entries are longer than in my example file, but
none so long as to require a line break. Here many entries require a
line break and the next entry runs over the second line of the broken
entry. See a slightly more realistic example below.
Gratefully, Johan
\mainlanguage[swedish]
\definedescription
[TelefonEntry]
[width=2em]
\unexpanded\def\TelefonCommand#1#2#3%
{\startTelefonEntry{#2}#3\stopTelefonEntry}
\definesorting[Telefon][Telefone]
\starttext
\Telefon[Eldallah Awdawebi]{78423}
\Telefon[Nada Pipidepaulou]{78264}
\Telefon[Aölaksd aölksd]{044578264}
\Telefon[Ö]{320399}
\Telefon[å]{23402394}
\Telefon[åå]{23042}
\Telefon[ååå]{098234}
\startcolumns[n=3]
\placelistofsorts[Telefon][criterium=all,command=\TelefonCommand]
\stopcolumns
\stoptext
2011/8/2 Wolfgang Schuster
Am 02.08.2011 um 11:08 schrieb Johan Sandblom:
I am maintaining a small vademecum for my workplace. One of the things it contains is a list of handy phone numbers, which should be sorted. Until now I have used the attached hack. It has worked reasonably well until the directory outgrew the one page. Before I start to modify my hack it occurred to me that ConTeXt most likely has a machinery for this already. It is a sort of register, after all. I have looked in the manual at registers and sorted lists but have not been able to find what I want. The desired specifications are:
1. columns (to save space) 2. sorted (in a correct Swedish order) 3. spans several pages
Alternative solution with ConTeXt’s sorting mechanism:
\mainlanguage[swedish]
\definedescription [TelefonEntry] [width=2em]
\unexpanded\def\TelefonCommand#1#2#3% {\startTelefonEntry{#2}#3\stopTelefonEntry}
\definesorting[Telefon][Telefone]
\starttext
\Telefon[a]{78423} \Telefon[b]{78264} \Telefon[ö]{78264} \Telefon[Ö]{23423} \Telefon[å]{23402394} \Telefon[åå]{23042} \Telefon[ååå]{098234}
\startcolumns[n=3] \placelistofsorts[Telefon][criterium=all,command=\TelefonCommand] \stopcolumns
\stoptext
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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
-- Johan Sandblom, MD PhD m +46735521477 Sweden "What is wanted is not the will to believe, but the will to find out, which is the exact opposite" - Bertrand Russell