From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/62057 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Custom lua script (updating and debugging) Date: Wed, 29 Sep 2010 09:23:16 +0200 Message-ID: <4CA2E964.5000805@wxs.nl> References: <4CA1C659.5030502@gmx.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2"; Format="flowed" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1285745040 2250 80.91.229.12 (29 Sep 2010 07:24:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 29 Sep 2010 07:24:00 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Sep 29 09:23:58 2010 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 1P0r17-0001zD-7D for gctc-ntg-context-518@m.gmane.org; Wed, 29 Sep 2010 09:23:53 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id F24D5CA736; Wed, 29 Sep 2010 09:23:52 +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 tB7BDK3pcbLg; Wed, 29 Sep 2010 09:23:52 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id EA7A0CA6FB; Wed, 29 Sep 2010 09:23:49 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1BA91CA6FB for ; Wed, 29 Sep 2010 09:23:49 +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 eVjzwPEW5Ymz for ; Wed, 29 Sep 2010 09:23:46 +0200 (CEST) Original-Received: from filter2-nij.mf.surf.net (filter2-nij.mf.surf.net [195.169.124.153]) by balder.ntg.nl (Postfix) with ESMTP id 8AE7ECA6E7 for ; Wed, 29 Sep 2010 09:23:46 +0200 (CEST) Original-Received: from smtp.ziggozakelijk.nl (D57D1DA2.static.ziggozakelijk.nl [213.125.29.162]) by filter2-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o8T7E8Fa006150 for ; Wed, 29 Sep 2010 09:14:08 +0200 X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.170; Original-Received: from [10.100.1.170] (unverified [10.100.1.170]) by pragma-net.nl (SurgeMail 4.3g4) with ESMTP id 6033-1713362 for multiple; Wed, 29 Sep 2010 09:21:45 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.9) Gecko/20100915 Lightning/1.0b2 Thunderbird/3.1.4 ThunderBrowse/3.3.2 In-Reply-To: X-Authenticated-User: hagen@controller-9 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.125.29.162; country=NL; region=11; city=Den Haag; latitude=52.0833; longitude=4.3000; http://maps.google.com/maps?q=52.0833,4.3000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0aDcve8jB - 377012ac20a7 - 20100929 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.153 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:62057 Archived-At: On 29-9-2010 8:50, Proch=E1zka Luk=E1=B9 Ing. - Pontex s. r. o. wrote: > Hello, > > I have also the experience that when the Lua file is placed where the > LUA_PATH system variable points (or: see the documentation how exactly > LUA_PATH works), than I can use the 'require' command and the Lua file > will be found. > > E.g.: > > LUA_PATH =3D (...);C:\MyDir\?.lua > > C:\MyDir\MyFile.lua: > > print("This is MyFile.lua") > > And a ctx file: > > \startluacode > require("MyFile") > \stopluacode > > - Will print "This is MyFile.lua" to the output stream when converting > .tex to (e.g.) .pdf. texmf-[local|project]/scripts/context/lua should work out ok with require, given that you also have regenerated = the file database > Lukas > > > On Tue, 28 Sep 2010 21:30:32 +0200, Mojca Miklavec > wrote: > >> On Tue, Sep 28, 2010 at 12:41, Stefan M=FCller wrote: >>> Hi list, >>> >>> I'm currently messing around with a custom lua script (a pretty >>> printer) and >>> I have some beginner trouble. >>> >>> First: I put the file in "MyContexDir\tex\texmf\tex\context\base\". >> >> Put them into >> MyContexDir\tex\texmf-local\tex\context\user\ >> because: >> - You need to use texmf-local instead of texmf, else your file might >> be deleted when you update the distribution. >> - It doesn't really matter where the file is as long as it is under >> [TEXMF]\tex\context, but using "user" is somehow more sensible than >> "base". >> >>> What do >>> I have to do to let ConTeXt work with the script and to let ConTeXt know >>> that something has changed in the script? Is "context --generate" enough >>> (after initializing with "setuptex.bat")? >> >> You need to use context --generate only when you add the script for >> the first time. After you modify it, you don't need to do anything >> unless you are changing ConTeXt source. If you change ConTeXt source, >> you need to also run "context --make" (but that would be dangerous >> anyway). >> >>> Second: How can I debug errors in my *.lua file? Just put >>> print("debug message") >>> in the function that is (supposed to be) called? >> >> Yes, or tex.print (depending on how you want to debug). >> >> Mojca >> ________________________________________________________________________= ___________ >> >> 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 >> ________________________________________________________________________= ___________ >> >> > > -- = ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________= ________ 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 ___________________________________________________________________________= ________