[NTG-context] defining a frame with embedded typing

Brooks Moses bmoses at stanford.edu
Tue Aug 17 21:47:17 CEST 2004


On Tue, Aug 17, 2004 at 06:18:31PM +0200, Floris van Manen wrote:
> how would i define a frame with the typing environment embedded.
> 
> the way i thought to solve it does *not* work (of course)
> 
> \def\startTTinput%
> {\startframedtext[width=\makeupwidth,background=screen,backgroundscreen=.8]
> \starttyping
> }
> 
> \def\stopTTinput%
> {\stoptyping\stopframedtext}

Taco already showed the solution to this (use before= and after=
commands in a \definetyping or \setuptyping command), but it might be
useful to also explain why the above doesn't work.

It doesn't work, because \starttyping, like most verbatim environments,
scans through the following text until it gets to the appropriate end
text.  It doesn't expand tokens while doing this; in particular,
\stopTTinput never gets expanded, and so the sequence "\stoptyping"
never shows up to end the input.

Incidentally, there's also a bit more answer to how to do framed typing
environments in some answers to one of my questions a couple of weeks
ago; you might find it useful to look in the archives for that.

- Brooks



More information about the ntg-context mailing list