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
___________________________________________________________________________________

Reply via email to