From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/66636 Path: news.gmane.org!not-for-mail From: Cecil Westerhof Newsgroups: gmane.comp.tex.context Subject: Re: Fwd: Personalizing a PDF generated with ConTeXt Date: Sat, 5 Mar 2011 14:36:33 +0100 Message-ID: References: <4D6D0EB6.7040702@elvenkind.com> <4D6D22A8.8070406@elvenkind.com> <0FCD044E-4107-4487-9C86-46CC94800646@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0958428217==" X-Trace: dough.gmane.org 1299332219 31621 80.91.229.12 (5 Mar 2011 13:36:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 5 Mar 2011 13:36:59 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Mar 05 14:36:55 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 1PvrfB-0002LH-GH for gctc-ntg-context-518@m.gmane.org; Sat, 05 Mar 2011 14:36:53 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9CE87CAAA9; Sat, 5 Mar 2011 14:36:52 +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 x1bsFPxO4NKX; Sat, 5 Mar 2011 14:36:47 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E74F7CAA98; Sat, 5 Mar 2011 14:36:46 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4FF02CAA98 for ; Sat, 5 Mar 2011 14:36:45 +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 cVHOHNZUtCWh for ; Sat, 5 Mar 2011 14:36:34 +0100 (CET) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 3835BCAA78 for ; Sat, 5 Mar 2011 14:36:34 +0100 (CET) Original-Received: from mail-fx0-f41.google.com (mail-fx0-f41.google.com [209.85.161.41]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p25DaXoH006861 for ; Sat, 5 Mar 2011 14:36:33 +0100 Original-Received: by fxm5 with SMTP id 5so3943054fxm.14 for ; Sat, 05 Mar 2011 05:36:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=AXsi31B5g6jwv74HNTuUaNYbGJMp2+NPAUpHSBOLjgU=; b=vrcxhrKG8TO2t1mw7bRHn9If7w+mYlYz30CXBe+pD5uBDWg3W8AKydBLA/I2RiLVvX 8a2ckjhQcXA0qaPssCzStevuytuKnc7K1ClRyeIA7kpT5UBqyxqjdPEsqO6Kb8ktBpPV WLs4ticdJDghcv2d1ZMcVce/EQL9yBPiavfwc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=nyiFj5ANo7AdcIA1bU+Sc7KA+2k8D0ZuKk1yKpim8DO4rZAZgTyQRA7zN5pG9fb4YZ K6Yo1kkFytjAloKmA7bDRXGtE6EtCBuAEOVYBJJVwhRyQWDR7kC8TWh8gyFRfhJeAQz7 ZnadAyOyDhRkmhFPXhhp6SL7PKNVsNguOn5G0= Original-Received: by 10.223.63.212 with SMTP id c20mr2228630fai.63.1299332193160; Sat, 05 Mar 2011 05:36:33 -0800 (PST) Original-Received: by 10.223.10.4 with HTTP; Sat, 5 Mar 2011 05:36:33 -0800 (PST) In-Reply-To: <0FCD044E-4107-4487-9C86-46CC94800646@gmail.com> 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: 0rEfpAxQs - 21da51f8fcc8 - 20110305 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 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:66636 Archived-At: --===============0958428217== Content-Type: multipart/alternative; boundary=001517475828d18e31049dbc5936 --001517475828d18e31049dbc5936 Content-Type: text/plain; charset=ISO-8859-1 2011/3/5 Wolfgang Schuster > \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 > \doifelsevariable{test}{two}{2: \getvariable{test}{two}}{??} > \stoptext > Works. I use: \doifelsevariable{personalise}{completeName}{}{ \setvariables[personalise][ completeName=Cecil Westerhof, . . . ] } -- Cecil Westerhof --001517475828d18e31049dbc5936 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
2011/3/5 Wolfgang Schuster <= ;schuster.wolfgang@goog= lemail.com>
\setvariables and \getvariables sound= s 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=3D...
=A0
I tried it and= it works. Only one thing: when the variables are not set (forgot the envir= onment parameter, file not correctly set, ...) I would like to set default = values. How would I do that?

%\enablemode[variables]
<= div>
\startmode[variables]
\setvariables
= =A0=A0[test]
=A0=A0[one=3DOne,
=A0=A0 two=3DTwo]
<= div>\stopmode

\starttext
\doifelsevariable{test}{one}{1: \g= etvariable{test}{one}}{??}\par
\doifelsevariable{test}{two}{2: \g= etvariable{test}{two}}{??}
\stoptext

Works. I use:
\doifelsevariable{personalise}{completeName}{}{=A0 \setvariables[personalise][
=A0=A0=A0 completeName=3DCecil Westerh= of,
=A0=A0=A0 .
=A0=A0=A0 .
=A0=A0=A0 .
=A0 ]
}
=A0
= --
Cecil Westerhof
--001517475828d18e31049dbc5936-- --===============0958428217== 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 ___________________________________________________________________________________ --===============0958428217==--