From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/48060 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: \dorecurse and \recurselevel in Natural Tables Date: Fri, 6 Mar 2009 15:49:00 +0100 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1236353226 25817 80.91.229.12 (6 Mar 2009 15:27:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Mar 2009 15:27:06 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Mar 06 16:28:22 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 1Lfbxt-0004zO-PU for gctc-ntg-context-518@m.gmane.org; Fri, 06 Mar 2009 16:27:57 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2024F1FB4E; Fri, 6 Mar 2009 16:26:34 +0100 (CET) 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 24021-01; Fri, 6 Mar 2009 16:26:00 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 580A21FB7E; Fri, 6 Mar 2009 16:25:44 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B3A831FB4E for ; Fri, 6 Mar 2009 16:24:50 +0100 (CET) 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 17927-05-2 for ; Fri, 6 Mar 2009 16:22:35 +0100 (CET) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by ronja.ntg.nl (Postfix) with ESMTP id 92D5A1FB38 for ; Fri, 6 Mar 2009 16:21:46 +0100 (CET) Original-Received: from mail-fx0-f167.google.com (mail-fx0-f167.google.com [209.85.220.167]) by filter3-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n26FKFCP004704 for ; Fri, 6 Mar 2009 16:21:20 +0100 Original-Received: by fxm11 with SMTP id 11so441239fxm.2 for ; Fri, 06 Mar 2009 07:20:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=bBGhtY8v/NsAQmX9EcYRn6VMPDW7ZInKa9klQoZgYWc=; b=j9cfxshnmVP4CZRnBYbGmFAoOE0v5ysthOGaGDliIBtVFdFkwE5dajOwhjekKcgik7 4BW+zVrUY/w0M5aZlh1+5yn8rxKU93DU7suU5yatBy3xK7KMrwcyoPc83Lfy//rBr38/ 8K08J6n+hCoFTsBez8n2nU5XMRvtZsKD48IX8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=MDhslcKog4muw2yjmHXFemXxfYpu0oej9FTHrhlzO0EFCIgt9Qx2P2dD/5zdz7BMpM 5T12MCsWygm4ibEe25vUv8FLpaZTACTsVdHhfqlOXALE1RuG+Yza7bVbnfhwnHQx0yQC 8ybIzEUf94DpByVrGCIqOYMRtvbBpK8KCxBg0= Original-Received: by 10.86.76.20 with SMTP id y20mr1888265fga.75.1236350995927; Fri, 06 Mar 2009 06:49:55 -0800 (PST) Original-Received: from ?10.70.253.96? ([82.113.106.159]) by mx.google.com with ESMTPS id 4sm4179497fge.54.2009.03.06.06.49.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 06 Mar 2009 06:49:55 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.930.3) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.220.167; 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: 189746184 - 564c29608c56 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 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:48060 Archived-At: Am 06.03.2009 um 04:05 schrieb Aditya Mahajan: > My summary of this thread: > http://randomdeterminism.wordpress.com/2009/03/05/tex-programming-the-past-the-present-and-the-future/ Nice article but I have a few corrections for you. Table setup: To achieve horizontal and vertical centered content in the table cell you need 'align={middle,lohi}'. Pure table code: You forgot the \bTR and \eTR before and after each row. Expandafter solution: You don't need as many \expandafter as you did in your example, one before \bTD in each loop is enough. \bTABLE \bTR \bTD $(+)$ \eTD \dorecurse{6} {\expandafter \bTD \recurselevel \eTD} \eTR \dorecurse{6} {\bTR \edef\firstrecurselevel{\recurselevel} \expandafter\bTD \recurselevel \eTD \dorecurse{6} {\expandafter \bTD \the\numexpr\firstrecurselevel+\recurselevel\relax \eTD} \eTR} \eTABLE \for loop: If you really want to show this loop you also the correct commands to access the counters. #1 did also work but only because the command is wrapped around \dostepwiserecurse. \bTABLE \bTR \bTD $(+)$ \eTD \for \y=1 \to 6 \step 1 \do {\bTD \y \eTD} \eTR \for \x=1 \to 6 \step 1 \do {\bTR \bTD \x \eTD \for \y=1 \to 6 \step 1 \do {\bTD \the\numexpr\x+\y \eTD} \eTR} \eTABLE Thank you for the article and I'm looking forward for the next. Best regards, 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________