From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/78722 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Fwd: Need help with \definetabulate Date: Tue, 16 Oct 2012 13:39:13 +0200 Message-ID: <507D4761.9080302@wxs.nl> References: <976656BD-A09C-4FE4-92E0-C863BDC98DD0@stien.de> <507D401B.1050506@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; Format="flowed" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1350387572 25098 80.91.229.3 (16 Oct 2012 11:39:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Oct 2012 11:39:32 +0000 (UTC) Cc: Wolfgang Schuster To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Oct 16 13:39:39 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TO5Uk-0003TD-6r for gctc-ntg-context-518@m.gmane.org; Tue, 16 Oct 2012 13:39:34 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2505310262; Tue, 16 Oct 2012 13:39:27 +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 j0Gn-DvOVsN8; Tue, 16 Oct 2012 13:39:24 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 08689101F9; Tue, 16 Oct 2012 13:39:24 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 53C58101F9 for ; Tue, 16 Oct 2012 13:39:22 +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 OEIlYDKApLPv for ; Tue, 16 Oct 2012 13:39:19 +0200 (CEST) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id E169E101F4 for ; Tue, 16 Oct 2012 13:39:19 +0200 (CEST) Original-Received: from smtp.ziggozakelijk.nl (D57D1DA2.static.ziggozakelijk.nl [213.125.29.162]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q9GBdIxm016832 for ; Tue, 16 Oct 2012 13:39:18 +0200 X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.100; Original-Received: from [10.100.1.100] (unverified [10.100.1.100]) by pragma-net.nl (SurgeMail 6.1c) with ESMTP (TLS) id 4024-1713362 for multiple; Tue, 16 Oct 2012 13:39:15 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 In-Reply-To: X-Authenticated-User: hagen@controller-9 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.125.29.162; country=NL; region=16; city=Zeewolde; latitude=52.3302; longitude=5.5364; http://maps.google.com/maps?q=52.3302,5.5364&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 06IbLDiEo - c0ce460c6cf7 - 20121016 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:78722 Archived-At: On 16-10-2012 13:23, Wolfgang Schuster wrote: > > Am 16.10.2012 um 13:08 schrieb Hans Hagen : > >> On 16-10-2012 12:52, Sietse Brouwer wrote: >>> The problem is that \starttabulate does not accept a format parameter. >>> >>> Cheap solution (only figured it out now, or I'd have replied before): u= se >>> >>> \setuptabulate[alpha][format=3D{....}] >>> >>> before every \startalpha call. >>> It's not very contexty syntax, but on the other hand it requires no >>> new definitions at all. >>> >>> Full example below. >>> Cheers, >>> Sietse >>> >>> \definetabulate[alpha][|l|] % dummy format >>> \setuptabulate[alpha][style=3Dbold] >>> >>> \setuptabulate[alpha][format=3D{|r|r|r|}] >>> \startalpha >>> \NC r \NC r \NC r \NC \NR >>> \NC test \NC test \NC test \NC \NR >>> \stopalpha >>> >>> \setuptabulate[alpha][format=3D{|c|c|}] >>> \startalpha >>> \NC c \NC c \NC \NR >>> \NC test \NC test \NC \NR >>> \stopalpha >> >> There's also: >> >> \starttext >> >> \definetabulate >> [whatever] >> [|l|r|] >> >> \definetabulate >> [whatever][else] >> [|l|c|r|] >> >> \startwhatever >> \NC l \NC r \NC \NR >> \NC left \NC right \NC \NR >> \stopwhatever >> >> \startwhatever[else] >> \NC l \NC m \NC r \NC \NR >> \NC left \NC middle \NC right \NC \NR >> \stopwhatever >> >> \stoptext > > Can you add a second argument to custom tabulation which would allow one = to write > > \startwhatever[format=3D{=85}] > > or > > \startwhatever[else][format=3D{=85}] > > to change the number of columns and format for a certain table. I wonder is someone can remember this ... \unprotect \unexpanded\def\tabl_start_defined[#1]% {\bgroup \edef\currenttabulationparent{#1}% \let\currenttabulation\currenttabulationparent \dodoubleargument\tabl_start_defined_indeed} \def\tabl_start_defined_indeed {\iffirstargument \ifsecondargument \doubleexpandafter\tabl_start_defined_two \else \doubleexpandafter\tabl_start_defined_one \fi \else \singleexpandafter\tabl_start_defined_zero \fi} \def\tabl_start_defined_one[#1][#2]% {\doifassignmentelse{#1} {\setuptabulation[\currenttabulation][#1]}% {\edef\currenttabulation{\currenttabulation:#1}}% \tabl_tabulate_start_building} \def\tabl_start_defined_two[#1][#2]% {\edef\currenttabulation{\currenttabulation:#1}% \setuptabulation[\currenttabulation][#2]% \tabl_tabulate_start_building} \def\tabl_start_defined_zero[#1][#2]% {\tabl_tabulate_start_building} \protect \starttext \definetabulate [whatever] [|l|r|] \definetabulate [whatever][else] [|l|c|r|] \startwhatever \NC l \NC r \NC \NR \NC left \NC right \NC \NR \stopwhatever \startwhatever[else] \NC l \NC m \NC r \NC \NR \NC left \NC middle \NC right \NC \NR \stopwhatever \startwhatever[else][format=3D{|c|c|c|c|}] \NC l \NC m \NC m \NC r \NC \NR \NC left \NC middle \NC middle \NC right \NC \NR \stopwhatever \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________