From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/66634 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Fwd: Personalizing a PDF generated with ConTeXt Date: Sat, 5 Mar 2011 13:23:29 +0100 Message-ID: <0FCD044E-4107-4487-9C86-46CC94800646@gmail.com> References: <4D6D0EB6.7040702@elvenkind.com> <4D6D22A8.8070406@elvenkind.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: multipart/mixed; boundary="===============1182219627==" X-Trace: dough.gmane.org 1299327852 12291 80.91.229.12 (5 Mar 2011 12:24:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 5 Mar 2011 12:24:12 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Mar 05 13:24:08 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 1PvqWl-0005jg-A7 for gctc-ntg-context-518@m.gmane.org; Sat, 05 Mar 2011 13:24:07 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7C229CAA9B; Sat, 5 Mar 2011 13:24:06 +0100 (CET) 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 MsCiL9R7ZEod; Sat, 5 Mar 2011 13:24:00 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 797E3CAA97; Sat, 5 Mar 2011 13:24:00 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 80E31CAA97 for ; Sat, 5 Mar 2011 13:23:59 +0100 (CET) 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 ijRx56VhvQJf for ; Sat, 5 Mar 2011 13:23:48 +0100 (CET) Original-Received: from filter7-ams.mf.surf.net (filter7-ams.mf.surf.net [192.87.102.75]) by balder.ntg.nl (Postfix) with ESMTP id 1AEACCAA78 for ; Sat, 5 Mar 2011 13:23:48 +0100 (CET) Original-Received: from mail-fx0-f41.google.com (mail-fx0-f41.google.com [209.85.161.41]) by filter7-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p25CNjA9023968 for ; Sat, 5 Mar 2011 13:23:46 +0100 Original-Received: by fxm5 with SMTP id 5so3901269fxm.14 for ; Sat, 05 Mar 2011 04:23:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:from:mime-version:content-type:subject:date :in-reply-to:to:references:message-id:x-mailer; bh=q1mZ9mAQOY6Yq54D4W9admGFe1XLZKhznghDBbepcEQ=; b=rHUPpiI9/WS2VVM8vGXqqm9B/0vnx/BM4CoJ1ar45dbXpXKkNQjvVO4C1PAm4dHKdT 07EraPn5oGAbRwFscid2tqTxkpwvTMu4via/j/SRzP2LdVaJYl33qCjr4TAjb7+w0Zeh L4l0x9m9xJghhU1g1soXjNt/9FQadFWDJDroc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:mime-version:content-type:subject:date:in-reply-to:to :references:message-id:x-mailer; b=Zx4yLFIdi2F4/U5lr7fATqtcZlUZjdBOjevtJvn+tUr8qV3jYzkyl9IW0ddnfNokmV 4fnoHdRvq4rOJ1YVeIGxBXKq7PNNoc2CSqfgbb209ghICPTgZL22hlRitWNc5ZVZgIDv QmJEFPuI3deZc6rJVfvVPv1ZmcpLAnBwtXDYI= Original-Received: by 10.223.85.196 with SMTP id p4mr345645fal.5.1299327823902; Sat, 05 Mar 2011 04:23:43 -0800 (PST) Original-Received: from [192.168.2.23] (p5B295A9B.dip.t-dialin.net [91.41.90.155]) by mx.google.com with ESMTPS id n3sm150982fax.7.2011.03.05.04.23.32 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 05 Mar 2011 04:23:42 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.1082) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.161.41; 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: 0DEfonJJw - 19753a2a044b - 20110305 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.75 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:66634 Archived-At: --===============1182219627== Content-Type: multipart/alternative; boundary=Apple-Mail-12-1045546480 --Apple-Mail-12-1045546480 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Am 05.03.2011 um 12:25 schrieb Cecil Westerhof: > 2011/3/1 Taco Hoekwater > \setvariables and \getvariables sounds like the most general solution >=20 > in that case. >=20 > For example, you could put the various \setvariables statements in = various separate files and load a specific one from the context command = line with --environment=3D... > =20 > I tried it and it works. Only one thing: when the variables are not = set (forgot the environment parameter, file not correctly set, ...) I = would like to set default values. How would I do that? %\enablemode[variables] \startmode[variables] \setvariables [test] [one=3DOne, two=3DTwo] \stopmode \starttext \doifelsevariable{test}{one}{1: \getvariable{test}{one}}{??}\par \doifelsevariable{test}{two}{2: \getvariable{test}{two}}{??} \stoptext Wolfgang --Apple-Mail-12-1045546480 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii
Am 05.03.2011 um 12:25 schrieb Cecil Westerhof:

2011/3/1 Taco Hoekwater <taco@elvenkind.com>
\setvariables and \getvariables sounds like the most general solution

in that case.

For example, you could put the various \setvariables statements in various separate files and load a specific one from the context command line with --environment=...
 
I tried it and it works. Only one thing: when the variables are not set (forgot the environment parameter, file not correctly set, ...) I would like to set default values. How would I do that?

%\enablemode[variables]

\startmode[variables]
\setvariables
  [test]
  [one=One,
   two=Two]
\stopmode

\starttext
\doifelsevariable{test}{one}{1: \getvariable{test}{one}}{??}\par
\doifelsevar iable{test}{two}{2: \getvariable{test}{two}}{??}
\stoptext

Wolfgang

--Apple-Mail-12-1045546480-- --===============1182219627== 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 ___________________________________________________________________________________ --===============1182219627==--