ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Mojca Miklavec <mojca.miklavec.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Custom lua script (updating and debugging)
Date: Tue, 28 Sep 2010 21:30:32 +0200	[thread overview]
Message-ID: <AANLkTikgQpUcY7txRXFFBMmP+RPeUY5gJWn0TLeot9gb@mail.gmail.com> (raw)
In-Reply-To: <4CA1C659.5030502@gmx.de>

On Tue, Sep 28, 2010 at 12:41, Stefan Müller 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
___________________________________________________________________________________

  reply	other threads:[~2010-09-28 19:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1.1285668002.22946.ntg-context@ntg.nl>
2010-09-28 10:41 ` Stefan Müller
2010-09-28 19:30   ` Mojca Miklavec [this message]
2010-09-29  6:50     ` Procházka Lukáš Ing. - Pontex s. r. o.
2010-09-29  7:23       ` Hans Hagen
2010-09-28 14:08 metapost: unable to make mpx file error Alan BRASLAU
2010-09-28 21:18 ` Hans Hagen
2010-09-28 21:53   ` Custom lua script (updating and debugging) Stefan Müller
2010-09-29 17:47     ` Stefan Müller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTikgQpUcY7txRXFFBMmP+RPeUY5gJWn0TLeot9gb@mail.gmail.com \
    --to=mojca.miklavec.lists@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).