From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/77589 Path: news.gmane.org!not-for-mail From: "Rogers, Michael K" Newsgroups: gmane.comp.tex.context Subject: Re: Variables how-to needed Date: Wed, 25 Jul 2012 15:08:59 +0000 Message-ID: <234470BD-4135-48CB-9E8C-5CF905FF3E83@emory.edu> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1343228961 27045 80.91.229.3 (25 Jul 2012 15:09:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 25 Jul 2012 15:09:21 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jul 25 17:09:21 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 1Su3DE-0002lJ-RN for gctc-ntg-context-518@m.gmane.org; Wed, 25 Jul 2012 17:09:20 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DB4F4102B5; Wed, 25 Jul 2012 17:09:19 +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 6ObaUFnJ++xX; Wed, 25 Jul 2012 17:09:17 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id A39EE10203; Wed, 25 Jul 2012 17:09:17 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id F0EE510203 for ; Wed, 25 Jul 2012 17:09:16 +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 w7vZNRieqCAq for ; Wed, 25 Jul 2012 17:09:15 +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 8D97D101E9 for ; Wed, 25 Jul 2012 17:09:15 +0200 (CEST) Original-Received: from ws-mr1.cc.emory.edu (ws-mr1.cc.emory.edu [170.140.50.231]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q6PF97cV029860 for ; Wed, 25 Jul 2012 17:09:14 +0200 Original-Received: from e14edge1n.Emory.Edu (emoryfloatdmz.cc.emory.edu [170.140.52.254]) by ws-mr1.cc.emory.edu (8.13.8/8.13.8) with ESMTP id q6PF91pB020036 for ; Wed, 25 Jul 2012 11:09:01 -0400 Original-Received: from E14CH2W.Enterprise.emory.net (10.240.10.114) by e14edge1n.Emory.Edu (170.140.52.18) with Microsoft SMTP Server (TLS) id 14.2.283.3; Wed, 25 Jul 2012 11:09:01 -0400 Original-Received: from E14MBX23N.Enterprise.emory.net ([fe80::b473:ef05:b37f:5ccd]) by e14ch2w.Enterprise.emory.net ([::1]) with mapi id 14.02.0283.003; Wed, 25 Jul 2012 11:09:01 -0400 Thread-Topic: [NTG-context] Variables how-to needed Thread-Index: AQHNaiEFs2qm+BbSA0yMoOauJFpV9Jc6XaGA In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [170.140.30.131] Content-ID: <0F6D635559EB854A98B50F461126DB3D@Enterprise.emory.net> X-Emory-MailScanner-Information: Please contact the ISP for more information X-Emory-MailScanner-ID: q6PF91pB020036 X-Emory-MailScanner: Found to be clean X-Emory-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-0.01, required 8, autolearn=disabled, T_RP_MATCHES_RCVD -0.01) X-Emory-MailScanner-From: mroge02@emory.edu X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=170.140.50.231; country=US; region=GA; city=Atlanta; postalcode=30322; latitude=33.7952; longitude=-84.3248; metrocode=524; areacode=404; http://maps.google.com/maps?q=33.7952,-84.3248&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0VHCD98iX - ff32eb87f8df - 20120725 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.220 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:77589 Archived-At: On Jul 25, 2012, at 12:50 AM, Mari Voipio wrote: > Hello All, > > I'm looking for some "for dummies" information about using variables. > I tried looking for it in the wiki, but only found this "Internals" > page that's a bit too advantaged to me: > http://wiki.contextgarden.net/Inside_ConTeXt#Using_variables > I'm obviously missing something important, so I'd love to see a few > more examples of variables and variable input files... > > > What I want is price tags with the item name in Finnish and > English/Swedish and then the price. These are placed on a small page > and those small pages are then fit onto one A4 by imposition. > > Like this: > > Pieni ny=F6rihaarukka, koivua %variable 1,v-descr-fi > {\em Small lucet, beech} %variable 2, v-descr-en > > 6 eur %variable 3, v-price1 > > Made in xxx %variable 4, v-origin > > > I can do the imposition, that is not a problem - and it works a lot > better than a table, so no tables this way... > . > My data is in a list that can be converted to csv (although it'll then > have a bunch of quotes to be removed), the list format is just like > above: > Item in Finnish, Item in English, price, country of origin. > > So the main problem is database/mailmerge/variablerelated: How do I > (or should I) use variables to fetch this information from a separate > spreadsheet type file, i.e. my price list? > > (IF this was MS Word or OpenOffice, it would be called Mail Merge, but > in OO it sucks a bit; and I think the operation itself should be easy > if I just figure out how to do it... Does this give you the sort of thing you want? Sorry it's so kludgy (hey, = \relax ;-). There is an example of an address label in Mojca's http://dl.c= ontextgarden.net/myway/csv.pdf but it threw an error in the current beta (I= will write about that on a separate thread). So I made the following (stu= pid) workaround: \usemodule[database] %\defineseparatedlist % [PriceTag] % [separator=3D{:},command=3D\MyTag] \defineseparatedlist [PriceTag] [separator=3D{:}, first=3D\MyTag, last=3D\blank, left=3D, right=3D\relax] % a hack, because command=3D\MyTag wasn't working in MKIV \unexpanded\def\MyTag#1\relax#2\relax#3\relax#4\relax{ % ditto \framed [align=3D{flushleft,lohi}, width=3D6cm, height=3D3.2cm]{#1\crlf#2\crlf\crlf#3\crlf\crlf Made in #4}} \starttext \startPriceTag Finnish thing:English name:2.15 eur:Finland Pieni ny=F6rihaarukka, koivua:Small lucet, beech:6 eur:xxx \stopPriceTag % or process the file %\processdatabasefile[PriceTag][prices.txt] \stoptext ________________________________ This e-mail message (including any attachments) is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message (including any attachments) is strictly prohibited. If you have received this message in error, please contact the sender by reply e-mail message and destroy all copies of the original message (including attachments). ___________________________________________________________________________= ________ 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 ___________________________________________________________________________= ________