From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/58508 Path: news.gmane.org!not-for-mail From: Peter =?utf-8?Q?M=C3=BCnster?= Newsgroups: gmane.comp.tex.context Subject: get tex-value in lua Date: Tue, 4 May 2010 12:12:17 +0200 Message-ID: <20100504101217.GA9443@gaston.couberia.bzh> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1272967955 8061 80.91.229.12 (4 May 2010 10:12:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 4 May 2010 10:12:35 +0000 (UTC) To: ConTeXt list Original-X-From: ntg-context-bounces@ntg.nl Tue May 04 12:12:34 2010 connect(): No such file or directory 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 1O9F7C-0007NJ-Cc for gctc-ntg-context-518@m.gmane.org; Tue, 04 May 2010 12:12:34 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3BF4CC9AE3; Tue, 4 May 2010 12:12:33 +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 4EcvoReLI4Zj; Tue, 4 May 2010 12:12:30 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id BBB98C9AF5; Tue, 4 May 2010 12:12:30 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A832DC9AF5 for ; Tue, 4 May 2010 12:12:29 +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 fPCGts7olR1t for ; Tue, 4 May 2010 12:12:18 +0200 (CEST) Original-Received: from smtp2e.orange.fr (smtp2e.orange.fr [80.12.242.111]) by balder.ntg.nl (Postfix) with ESMTP id 8D530C9AE3 for ; Tue, 4 May 2010 12:12:18 +0200 (CEST) Original-Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2e03.orange.fr (SMTP Server) with ESMTP id 540CD800102F for ; Tue, 4 May 2010 12:12:18 +0200 (CEST) Original-Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2e03.orange.fr (SMTP Server) with ESMTP id 455FF8000755 for ; Tue, 4 May 2010 12:12:18 +0200 (CEST) Original-Received: from gaston.couberia.bzh (ARennes-551-1-126-243.w92-139.abo.wanadoo.fr [92.139.237.243]) by mwinf2e03.orange.fr (SMTP Server) with ESMTP id 21F45800102F for ; Tue, 4 May 2010 12:12:18 +0200 (CEST) X-ME-UUID: 20100504101218139.21F45800102F@mwinf2e03.orange.fr Original-Received: by gaston.couberia.bzh (Postfix, from userid 1000) id 8E4DB301C8; Tue, 4 May 2010 12:12:17 +0200 (CEST) Mail-Followup-To: ConTeXt list Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) 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:58508 Archived-At: Hello, How can I get the value of a variable or a mode in the lua part? Example: context --arguments=MyVar=true test And in test.tex: \starttext \startluacode local my_var = loadstring("return " .. get_value_of("MyVar")) if my_var then tex.print("TRUE") else tex.print("FALSE") end \stopluacode \stoptext TIA for any help! Cheers, Peter -- Contact information: http://pmrb.free.fr/contact/ ___________________________________________________________________________________ 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 ___________________________________________________________________________________