ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Problem Passing \starttabulate into Lua
Date: Thu, 1 Jan 2009 12:00:34 +0100	[thread overview]
Message-ID: <47F0E87B-7911-4549-9E86-A4DCB1463C3B@gmail.com> (raw)
In-Reply-To: <49560F83.3080706@cyberdude.com>


Am 27.12.2008 um 12:20 schrieb Tad Ashlock:

> I'm trying to create a ConTeXt macro (mkiv) that will manipulate the  
> macro argument's text with Lua and then feed it back into ConTeXt  
> with tex.print().  My approach worked correctly until I called the  
> macro with \starttabulate ... \stoptabulate in the macro's  
> argument.  So I started reducing the problem down to a minimum  
> example which surprisingly turned out to have nothing to do with the  
> manipulations I was performing.
>
> \long\def\testmacro#1{\directlua0{d='\luaescapestring{#1}'}}
> \starttext
> Hello, world!
> \testmacro{%
>   testing
>   \starttabulate
>     \NC 0 \NC testing tabulate. \NC \NR
>   \stoptabulate}
> \stoptext

\def\testmacro#1{\ctxlua{d='\luaescapestring{\normalunexpanded{#1}}'}}

\starttext

\testmacro{\starttabulate[|l|p|] \NC knuth \NC \input knuth \NC\NR  
\stoptabulate}

\ctxlua{tex.sprint(d)}

\stoptext

Wolfgang

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


      parent reply	other threads:[~2009-01-01 11:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-27 11:20 Tad Ashlock
2008-12-28 22:33 ` Wolfgang Schuster
2008-12-29 12:56   ` Ashlock, Tad A
2008-12-29 13:14     ` luigi scarso
2008-12-29 13:28     ` Wolfgang Schuster
2008-12-30  9:06       ` Wolfgang Schuster
2009-01-01 11:00 ` Wolfgang Schuster [this message]

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=47F0E87B-7911-4549-9E86-A4DCB1463C3B@gmail.com \
    --to=schuster.wolfgang@googlemail.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).