Path: utzoo!attcan!uunet!mcsun!unido!fauern!tumuc!lan!weiske From: weiske@lan.informatik.tu-muenchen.dbp.de (Thomas Weiske) Newsgroups: comp.text.tex Subject: Do something special in verbatim Keywords: LaTeX, verbatim Message-ID: <2852@tuminfo1.lan.informatik.tu-muenchen.dbp.de> Date: 13 Jun 90 13:59:20 GMT Sender: news@lan.informatik.tu-muenchen.dbp.de Reply-To: weiske@lan.informatik.tu-muenchen.dbp.de (Thomas Weiske) Organization: Technische Universitaet Muenchen Lines: 18 Here is a macro, that allows you to escape verbatim mode and to call macros. The idea is to define a new command char, for example '@', that is not used in the verbatim environment. % \beginspecial\begin{verbatim} ... verb @macro... \end{verbatim}\endspecial \def\beginspecial{\catcode`@=0} \def\endspecial{\catcode`@=12} Grammar with bold tokens \def\bebecoms{$\rightarrow$} \beginspecial\begin{verbatim} while_stat @bebecoms @bf while @tt cond @bf do @tt stat_list @bf od @tt stat_list @bebecoms stat ; stat_list | \end{verbatim}\endspecial I think the idea is old but not too bad.