[NTG-context] Natural Table does not allow using defined typing in its cell

Hans Hagen pragma at wxs.nl
Wed Sep 22 23:14:23 CEST 2004


Eugene Toporov wrote:

>Hello,
>
>I found a strange (to me) bTABLE behaviour.
>
>I'm defining the "programlisting" typing and it works when used like below 
>
>\def\BeforeProgramListing{\startframedtext[background=screen,width=\hsize,style=\tttf\small]}
>\def\AfterProgramListing{\stopframedtext}
>\definetyping[programlisting][before=\BeforeProgramListing,after=\AfterProgramListing]
>
> \startprogramlisting
>    "Hello World! Hello" + txtName.text + "!"
> \stopprogramlisting
>
>When I'm trying to insert a programlisting into a table cell using the
>following code -- it fails to create PDF.
>
>\bTABLE
>   \bTR   
>     \bTD Set the value to \eTD   
>     \bTD 
>       \startprogramlisting 
>         "Hello World! Hello" + txtName.text + "!" 
>       \stopprogramlisting   
>     \eTD    
>   \eTR 
>\eTABLE
>
>When I replace \start\stopprogramlisting with in place
>\start\stopframedtext -- it works ok.
>     \bTD   
>       \startframedtext[background=screen,width=\hsize,style=\tttf\small]
>         "Hello World! Hello" + txtName.text + "!" 
>       \stopframedtext   
>     \eTD    
>
>
>Why is this so? Do I miss something important?
>  
>
indeed, passing verbatim as argument does not work due to catcode 
wizzardy; so, try to use buffers instead

\startbuffer
\startprogramlisting
"Hello World! Hello" + txtName.text + "!"
\stopprogramlisting
\stopbuffer

\bTABLE
   \bTR
     \bTD Set the value to \eTD
     \bTD \getbuffer \eTD
   \eTR
\eTABLE




More information about the ntg-context mailing list