ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: Natural Table does not allow using defined typing in	its cell
Date: Wed, 22 Sep 2004 23:14:23 +0200	[thread overview]
Message-ID: <4151EB2F.5080808@wxs.nl> (raw)
In-Reply-To: <ecca0b27040922095424af4a9c@mail.gmail.com>

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

      reply	other threads:[~2004-09-22 21:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-22 16:54 Eugene Toporov
2004-09-22 21:14 ` Hans Hagen [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=4151EB2F.5080808@wxs.nl \
    --to=pragma@wxs.nl \
    --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).