From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/64933 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Passing and retrieveing a variable Date: Wed, 5 Jan 2011 21:41:13 +0100 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1294260115 17947 80.91.229.12 (5 Jan 2011 20:41:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 Jan 2011 20:41:55 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 05 21:41:49 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 1PaaAy-00035p-O6 for gctc-ntg-context-518@m.gmane.org; Wed, 05 Jan 2011 21:41:44 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 18E49CA994; Wed, 5 Jan 2011 21:41:44 +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 hh5ZJ5uKC5LP; Wed, 5 Jan 2011 21:41:40 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 97C62CA961; Wed, 5 Jan 2011 21:41:40 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 70CAFCA961 for ; Wed, 5 Jan 2011 21:41:39 +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 WwwKXXdv4TSi for ; Wed, 5 Jan 2011 21:41:27 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id DC280CA95A for ; Wed, 5 Jan 2011 21:41:27 +0100 (CET) Original-Received: from mail-fx0-f41.google.com (mail-fx0-f41.google.com [209.85.161.41]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p05KfQlB001040 for ; Wed, 5 Jan 2011 21:41:27 +0100 Original-Received: by fxm12 with SMTP id 12so9258128fxm.14 for ; Wed, 05 Jan 2011 12:41:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :subject:from:in-reply-to:date:content-transfer-encoding:message-id :references:to:x-mailer; bh=I1K1BhpJ9Ya4aW5qYk6USg8n5hNBGF/abD+jZlYDc0U=; b=nT9CFF+6WXowJTHb0nTR07anJa3C1XG7voY/LODbNB7SQDyWa/Kjwf6lLomoh+wKyF E0hqRP+D0Njh4a+3J0bsyDxtLi5XbQrpl/qkOuIMt0gVlvGGeFvnpQLBXE6+Ks0aHhgT OeLzJawmv7TfbukVVTIpZpBr5cHhgKNrO3bGc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=vyp55IWF+wIyfHEExE7IftcXO8M3B/t6q6D2XgjXRyGQdQRdtzdn9LnSAUURfXuEu2 4N+dR57wA357bFfdNXeUKzbj55lBvfS1uyJEeHRgO1rrak6AF0b3JYUmfJoJRtV9Bw6P U3QR3ZMLx3HWQ2DxwNmRkTH7LwLJf3FXu1970= Original-Received: by 10.223.122.146 with SMTP id l18mr969539far.67.1294260084910; Wed, 05 Jan 2011 12:41:24 -0800 (PST) Original-Received: from [192.168.2.23] (p5B297311.dip.t-dialin.net [91.41.115.17]) by mx.google.com with ESMTPS id n2sm5637451fam.4.2011.01.05.12.41.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 05 Jan 2011 12:41:23 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.1082) X-Bayes-Prob: 0.5 (Score 0, tokens from: ) 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: 0bDPUFqEo - 88b6c7475b11 - 20110105 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 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:64933 Archived-At: Am 05.01.2011 um 20:22 schrieb Proch=E1zka Luk=E1=9A: > Hello, > = > I'd need to pass a variable to Ctx and to retrieve it inside a compiled d= ocument - via Ctx itself and also by Lua. Something like modes; but modes a= llow just to check whether they are on or off. I'd need something like this: You can check modes in Lua: context --arguments=3D"size=3Dsmall" --mode=3Dprint test.tex \starttext Print mode: \doifmodeelse{print}{yes}{no} \startluacode if tex.modes['print'] then context("Print mode is enabled") else context("Print mode is disabled") end \stopluacode \doifenvelse{size} {\processaction [\env{size}] [ small=3D>Small size, medium=3D>Medium size, big=3D>Big size, unknown=3D>Other size: \env{size}]} {No value =93size=94} \stoptext Wolfgang ___________________________________________________________________________= ________ 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 ___________________________________________________________________________= ________