From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/62055 Path: news.gmane.org!not-for-mail From: =?iso-8859-2?B?UHJvY2jhemthIEx1a+G5IEluZy4gLSBQb250ZXggcy4gci4gby4=?= Newsgroups: gmane.comp.tex.context Subject: Re: Custom lua script (updating and debugging) Date: Wed, 29 Sep 2010 08:50:57 +0200 Message-ID: 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"; DelSp="yes" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1285743107 27006 80.91.229.12 (29 Sep 2010 06:51:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 29 Sep 2010 06:51:47 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Wed Sep 29 08:51:45 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 1P0qW0-0001Ye-Tm for gctc-ntg-context-518@m.gmane.org; Wed, 29 Sep 2010 08:51:45 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E8EDECA6FB; Wed, 29 Sep 2010 08:51:42 +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 6Xsf45dj0ML5; Wed, 29 Sep 2010 08:51:40 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 32728CA6EF; Wed, 29 Sep 2010 08:51:40 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 16490CA6EF for ; Wed, 29 Sep 2010 08:51:38 +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 6wnDoRhJnFwf for ; Wed, 29 Sep 2010 08:51:26 +0200 (CEST) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by balder.ntg.nl (Postfix) with ESMTP id 7EA3ACA6E7 for ; Wed, 29 Sep 2010 08:51:26 +0200 (CEST) Original-Received: from mail.pontex.cz (mail.pontex.cz [89.233.168.98]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o8T6p0bK031562 for ; Wed, 29 Sep 2010 08:51:00 +0200 Original-Received: from localhost ([127.0.0.1]) by mail.pontex.cz (Kerio MailServer 6.6.2) for ntg-context@ntg.nl; Wed, 29 Sep 2010 08:50:58 +0200 In-Reply-To: User-Agent: Opera Mail/10.10 (Win32) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=89.233.168.98; country=CZ; region=52; city=Prague; latitude=50.0833; longitude=14.4667; http://maps.google.com/maps?q=50.0833,14.4667&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 05DcuP0lq - ca947f6d7370 - 20100929 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.216 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:62055 Archived-At: Hello, I have also the experience that when the Lua file is placed where the LUA_P= ATH 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. 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-co= ntext > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > _________________________________________________________________________= __________ > -- = Ing. Luk=E1=B9 Proch=E1zka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezov=E1 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038 ___________________________________________________________________________= ________ 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 ___________________________________________________________________________= ________