From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/50649 Path: news.gmane.org!not-for-mail From: Johan Sandblom Newsgroups: gmane.comp.tex.context Subject: sorted data in mkiv Date: Thu, 21 May 2009 11:19:29 +0200 Message-ID: <97a06f070905210219x61d4e17fpd2572b99df84fc4f@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1242897627 30403 80.91.229.12 (21 May 2009 09:20:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 May 2009 09:20:27 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu May 21 11:20:20 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1M74Rl-0004VW-5q for gctc-ntg-context-518@m.gmane.org; Thu, 21 May 2009 11:20:17 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2ADBE1FCD3; Thu, 21 May 2009 11:20:15 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13957-03; Thu, 21 May 2009 11:19:41 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id F0F131FCB1; Thu, 21 May 2009 11:19:40 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 4ABBA1FCB1 for ; Thu, 21 May 2009 11:19:39 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 14477-02 for ; Thu, 21 May 2009 11:19:30 +0200 (CEST) Original-Received: from filter2-nij.mf.surf.net (filter2-nij.mf.surf.net [195.169.124.153]) by ronja.ntg.nl (Postfix) with ESMTP id DDA601FCA3 for ; Thu, 21 May 2009 11:19:30 +0200 (CEST) Original-Received: from mail-bw0-f178.google.com (mail-bw0-f178.google.com [209.85.218.178]) by filter2-nij.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n4L9JTYj030496 for ; Thu, 21 May 2009 11:19:30 +0200 Original-Received: by bwz26 with SMTP id 26so952259bwz.2 for ; Thu, 21 May 2009 02:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=PLPZdtxY4mUuVV/ghFFigILL0wg+w/YgPNtzO2wnfoc=; b=OYk2FKuBnNzn5BPundjTVvmGFXIjtdk9VgULu7+e9wLpwIYLgGZEGVimOjO2I17tTO TYtpfegxVyeZnbgmz+Jy8PzMNlqQ32tJ+4rHEzUiiFebY1euY2/T9AOjxAKSMrHMGyZa 0S824VLmDRLvTtW8BM6CzaTVX4OQa1ipjwNzk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=ZorfmVC1anNZloC4YX/Y38TMMshNQX1jC9qyoNFzvTmvr2gnqXEq5n1FCWUrmtcJus Do5x4BevB3Bito9VcCXdwhCTJxnBQt8jOuSM7R46s4k4lC8j/Rwbp67yZevSQWYAJt5q n8I9WLJMhC2CWKi/nsjDOIlZTJHFa9MeolTIg= Original-Received: by 10.223.109.199 with SMTP id k7mr1517535fap.45.1242897569215; Thu, 21 May 2009 02:19:29 -0700 (PDT) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.218.178; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 229552450 - 62f09f21ec12 - 20090521 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.153 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:50649 Archived-At: I am writing a booklet for use by junior doctors at the hospital where I work. It will contain random bits of data that is available from various online sources such as phone numbers, dosages of exotic drugs, referral routes and assorted things better written down than remembered. Much of it is in tabular form, and I have so far used natural tables. It is intended to be extremely compact so I make many adjustments to save space, such as using multiple columns where appropriate. Some of the things listed would benefit from being sorted such as phone numbers, but I would still like it to be presented in a table (with the added complication that the table will have two columns of names}. Using pseudocode I would like it to work like this: \phone{person c}{54321, 12345} \phone{clinic a}{12345, 54321} \phone{clinic c}{54321, 12345} \phone{person b}{12345} \phone{clinic b}{12345} \phone{person a}{12345} This should automatically be converted to \bTABLE \bTR\bTD person a\eTD\bTD 12345\eTD\bTD clinic a\eTD\bTD 12345, 54321\eTD\eTR \bTR\bTD person b\eTD\bTD 12345\eTD\bTD clinic b\eTD\bTD 12345\eTD\eTR \bTR\bTD person c\eTD\bTD 54321, 12345\eTD\bTD clinic c\eTD\bTD 54321, 12345\eTD\eTR \eTABLE presumably using something like 1. name and number added to a register 2. register is sorted on first field 3. t = total number of entries in register 4. l = number of lines in table, calculated as l=t\2 + t mod 2 3. create a table with l lines where each line has \bTR\bTD name(i) \eTD\bTD phone(i)\eTD\bTD name(i+l)\eTD\bTD phone(i+l)\eTR It would not surprise me if this is implemented somewhere in ConTeXt but I have been unable to find it. I would be very happy to see a solution using lua, but I lack the knowledge to implement it myself. Regards, Johan -- 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 ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________