Am 29.12.2008 um 14:28 schrieb Wolfgang Schuster:

When I changed '\starttabulate' to '\starttabulate[|l|p|]' in your solution above, it broke.

Try to escape the |, it's a active character in ConTeXt but this
could work (untested):

\def\testmacro
 {\bgroup
  \catcode`\\=12
  \catcode`\|=12
  \dotestmacro}

And now with a catcode table.

% redefined version of \startcatcodetable

\long\def\startcatcodetable#1#2\stopcatcodetable
  {\bgroup
   %\catcodetable\scratchcatcodetable
   \the\setdefaultcatcodes
   #2%
   \savecatcodetable#1\relax
   \egroup}

% the new catcode table

\newcatcodetable \testcatcodes

\startcatcodetable \testcatcodes
    \catcode`\\ = 12
    \catcode`\| = 12
\stopcatcodetable

\def\testmacro
  {\bgroup
   \setcatcodetable\testcatcodes
   \dotestmacro}

\def\dotestmacro#1%
  {\ctxlua{d='\luaescapestring{#1}'}
   \egroup}

\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