From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/68169 Path: news.gmane.org!not-for-mail From: Paul Menzel Newsgroups: gmane.comp.tex.context Subject: Re: Multiplication table (with lines) in ConTeXt? Date: Wed, 04 May 2011 12:43:14 +0200 Message-ID: <1304505794.4127.73.camel@mattotaupa> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1279223832==" X-Trace: dough.gmane.org 1304505817 26166 80.91.229.12 (4 May 2011 10:43:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 4 May 2011 10:43:37 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Wed May 04 12:43:33 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QHZYK-0002tH-R3 for gctc-ntg-context-518@m.gmane.org; Wed, 04 May 2011 12:43:32 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3FD80CAC8B; Wed, 4 May 2011 12:43:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id A7u8BmZtaFLP; Wed, 4 May 2011 12:43:29 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CF142CAC88; Wed, 4 May 2011 12:43:29 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5E4FACAC88 for ; Wed, 4 May 2011 12:43:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id orKfHWyBzi0C for ; Wed, 4 May 2011 12:43:17 +0200 (CEST) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by balder.ntg.nl (Postfix) with ESMTP id 7AD7ACAC85 for ; Wed, 4 May 2011 12:43:17 +0200 (CEST) Original-Received: from mail.gw90.de (mail.gw90.de [188.40.100.199]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p44AhG6U012315 for ; Wed, 4 May 2011 12:43:16 +0200 Original-Received: from f053033156.adsl.alicedsl.de ([78.53.33.156] helo=[192.168.178.21]) by mail.gw90.de with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1QHZZ5-00040X-IC for ntg-context@ntg.nl; Wed, 04 May 2011 10:44:19 +0000 In-Reply-To: X-Mailer: Evolution 2.32.2 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=188.40.100.199; country=DE; latitude=51.0000; longitude=9.0000; http://maps.google.com/maps?q=51.0000,9.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 05EDmHgK9 - f7091d1b44dc - 20110504 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.216 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:68169 Archived-At: --===============1279223832== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-nJgk5C7pF+9rmuqWDsAL" --=-nJgk5C7pF+9rmuqWDsAL Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Am Mittwoch, den 04.05.2011, 09:05 +0200 schrieb Wolfgang Schuster: > Am 04.05.2011 um 06:45 schrieb Aditya Mahajan: >=20 > > \startsetups table:frame > > \setupTABLE[each][each][frame=3Doff, align=3Dmiddle] > > \setupTABLE[row][first][bottomframe=3Don] > > \setupTABLE[column][first][rightframe=3Don] > > \stopsetups > >=20 > > \startTABLE[setups=3Dtable:frame] > > \NC $\times$ \NC 1 \NC 2 \NC ... \NC \NR > > .... > > \stopTABLE >=20 > and for the lazy people: >=20 > \starttext >=20 > \startsetups table:multiplication > \setupTABLE[each][each][frame=3Doff,align=3Dmiddle,width=3D2em,height= =3D2em] > \setupTABLE[row][first][bottomframe=3Don] > \setupTABLE[column][first][rightframe=3Don] > \stopsetups >=20 > \startluacode > context.bTABLE{setups=3D"table:multiplication"} > for i=3D0,6 do > context.bTR() > for j=3D0,6 do > context.bTD() > if i=3D=3D0 and j=3D=3D0 then > context("=C3=97") > elseif i=3D=3D0 or j=3D=3D0 then > context(i+j) > else > context(i*j) Alasdair takes modula 7 if I understood correctly. So it can be if i*j < 7 then context(i*j) else context((i*j) % 7) end (Nice symmetry in the resulting table.) > end > context.eTD() > end > context.eTR() > end > context.eTABLE() > \stopluacode >=20 > \stoptext Thank you Wolfang, I just wanted to reply and recommend using Lua. As always you were too fast. ;-) Thanks, Paul --=-nJgk5C7pF+9rmuqWDsAL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEABECAAYFAk3BLcIACgkQPX1aK2wOHVjL5QCgiNVNEAtHXAceqEbEW9W8Ii2H exwAn081RUtc5lqxmITD5DPh/sNs/ebF =GMQ9 -----END PGP SIGNATURE----- --=-nJgk5C7pF+9rmuqWDsAL-- --===============1279223832== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============1279223832==--