From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/27403 Path: news.gmane.org!not-for-mail From: "Mojca Miklavec" Newsgroups: gmane.comp.tex.context Subject: Re: Feature request: Creating tables from (tab-separated) values Date: Sun, 23 Apr 2006 13:13:05 +0200 Message-ID: <6faad9f00604230413v6e007ba8q93396b28bae5a271@mail.gmail.com> References: <6faad9f00604211902m5c88d10apcd5c208f1825f51c@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1145790801 16266 80.91.229.2 (23 Apr 2006 11:13:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 23 Apr 2006 11:13:21 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sun Apr 23 13:13:19 2006 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 ciao.gmane.org with esmtp (Exim 4.43) id 1FXcWh-0003VM-NS for gctc-ntg-context-518@m.gmane.org; Sun, 23 Apr 2006 13:13:15 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3E6D012788; Sun, 23 Apr 2006 13:13: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 29055-01-4; Sun, 23 Apr 2006 13:13:10 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6841B1279F; Sun, 23 Apr 2006 13:13:10 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id AE53B1279F for ; Sun, 23 Apr 2006 13:13:08 +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 29055-01-3 for ; Sun, 23 Apr 2006 13:13:05 +0200 (CEST) Original-Received: from nproxy.gmail.com (nproxy.gmail.com [64.233.182.190]) by ronja.ntg.nl (Postfix) with SMTP id 9EE0E12780 for ; Sun, 23 Apr 2006 13:13:05 +0200 (CEST) Original-Received: by nproxy.gmail.com with SMTP id x37so614917nfc for ; Sun, 23 Apr 2006 04:13:05 -0700 (PDT) Original-Received: by 10.49.64.16 with SMTP id r16mr2202166nfk; Sun, 23 Apr 2006 04:13:05 -0700 (PDT) Original-Received: by 10.48.223.20 with HTTP; Sun, 23 Apr 2006 04:13:05 -0700 (PDT) Original-To: ntg-context@ntg.nl In-Reply-To: Content-Disposition: inline X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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:27403 Archived-At: On 4/22/06, Peter M=FCnster wrote: > On Sat, 22 Apr 2006, Mojca Miklavec wrote: > > > - [with luaTeX in mind] calculating sums of rows & columns & other > > Excel-like calculations & references accross tables ;) - well, that > > one wasn't meant seriously. > > Hello Mojca, > should be possible even without luaTeX: > > \input realcalc % can be found on CTAN Thanks for the pointer! I've never used this one so far. > \def\SumFF{0} > \def\SumEUR{0} > > \def\AddEUR#1{\Radd\SumEUR\SumEUR{#1}% > \Rmul\R{#1}{6.55957}\Radd\R\R{0.005}\Rtrunc\R2\R > \Radd\SumFF\SumFF\R \bTR \bTD\eTD \bTD#1\eTD \expanded{\bTD\R\eTD} \eTR} > > \def\PrintSums{\bTR \bTD Sums: \eTD > \bTD\Rtrunc\SumEUR2\SumEUR \SumEUR\eTD > \bTD\Rtrunc\SumFF2\SumFF \SumFF \eTD \eTR} > > \starttext > \setupTABLE[r][each][align=3Dflushright] > \setupTABLE[r][1][align=3Dmiddle] > \bTABLE > \bTR \bTH\eTH \bTH Euro \eTH \bTH FF \eTH \eTR > \AddEUR{1.23} > \AddEUR{2.34} > \AddEUR{45.67} > \PrintSums > \eTABLE > \stoptext > > With LaTeX, you can even replace the . by a , : Stupid me! I forgot about the following trick \uccode`.=3D`, \WORD{3.14} (It can be surely done without using \WORD, but that was the easiest way to recall it from another evil example that Hans sent me some time ago.) Mojca