Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!munnari!otc!metro!basser!john From: john@basser.oz (John Mackin) Newsgroups: comp.text Subject: Re: Inserting text directly in ditroff output Message-ID: <1113@basser.oz> Date: Tue, 3-Nov-87 06:20:57 EST Article-I.D.: basser.1113 Posted: Tue Nov 3 06:20:57 1987 Date-Received: Sat, 7-Nov-87 09:18:24 EST References: <3457@trwrb.UUCP> <3696@ptsfa.UUCP> <52@blipyramid.BLI.COM> Reply-To: john@basser.oz (John Mackin) Organization: Dept of Comp Sci, Uni of Sydney, Australia Lines: 29 Summary: a more general method In article <52@blipyramid.BLI.COM>, mao@blipyramid.BLI.COM (Mike Olson) writes: > In article <3696@ptsfa.UUCP>, Ken Keirnan writes: > > Ditroff [has] an escape sequence that allows passing source lines > > transparently to ditroff's output. This is the transparent line escape > > "\!". > > this works very well, so long as you don't try to use it in a diversion. > [...] > in cases like this, escape the [exclamation mark] (\\!). Mike's suggestion is correct. Unfortunately, the number of backslashes you need to use depends on the number of times the text is going to be scanned -- something which is by no means obvious in advance, and varies with different macro packages, keep types, etc. A general method is to use the following macro, by Mark Shand (now shand@cad.unsw.oz.AU): .de !! .ie '\\n(.z'' \!\\$1 .el \!.!! "\\$1 .. Then just .!! "anything at all". John Mackin, Basser Department of Computer Science, University of Sydney, Sydney, Australia john@basser.oz.AU (john%basser.oz.AU@UUNET.UU.NET) {uunet,hplabs,mcvax,ukc,nttlab}!munnari!basser.oz!john