[comp.unix.wizards] Control Characters in nroff

artp@motbos.UUCP (03/04/87)

Does anyone out there have experience in embedding non-printing ASCII characters
in an nroff file ?  For example, the NEC Laser Printers use an ASCII FS (Form
Separator) character to control various font / print modes.  I have had no
problems embedding an ASCII ESC (Escape), but the FS is stripped out.

I have tried using translations (.tr), escape character redefinition (.ec),
multiple backslashes, \&, etc. All result in the FS being stripped out of
the output stream.
-- 

Regards,
Art
-------------------------------- 

<< Unusual Disclaimer >>

Art Parmet - AEM @ Motorola Semiconductor, Woburn, Ma.
UUCP: {hplabs!motsj1, mot!motsj1} {cdx39, motsj1, mottom,
oakhill, mnetor, motatl, motdc1, motrhr, motwdc, mcsbos,
mothup, motham, honcsp, motcso}....motbos!artp

Voice:      +1 617-932-9700
UUCP:       +1 617-932-9191
Fax:        +1 617-932-9100

henry@utzoo.UUCP (Henry Spencer) (03/17/87)

> Does anyone out there have experience in embedding non-printing ASCII
> characters in an nroff file ?  For example, the NEC Laser Printers use an
> ASCII FS (Form Separator) character to control various font / print modes.
> I have had no problems embedding an ASCII ESC (Escape)...

I'm rather surprised that you got away with ESC.  Nroff/troff converts its
input entirely into its own internal alphabet while processing, and if the
character you want isn't in the internal alphabet, you're up the creek.
There is no way, short of getting something else through and then translating
that into the character you want.
-- 
"We must choose: the stars or	Henry Spencer @ U of Toronto Zoology
the dust.  Which shall it be?"	{allegra,ihnp4,decvax,pyramid}!utzoo!henry

john@basser.UUCP (03/19/87)

In article <7786@utzoo.UUCP> henry@utzoo.UUCP (Henry Spencer) writes:

  [ here he quotes an anonymous person: ]
> > Does anyone out there have experience in embedding non-printing ASCII
> > characters in an nroff file ?  For example, the NEC Laser Printers use an
> > ASCII FS (Form Separator) character to control various font / print modes.
> > I have had no problems embedding an ASCII ESC (Escape)...
> 
> I'm rather surprised that you got away with ESC.  Nroff/troff converts its
> input entirely into its own internal alphabet while processing, and if the
> character you want isn't in the internal alphabet, you're up the creek.

That's correct.  I just thought I'd supply the full story.  From
the ``NROFF/TROFF User's Manual'', by Joseph Osanna, section 10.1:

    _Input character translations._  Ways of inputting the
    graphic character set were discussed in sec. 2.1.  The
    ASCII control characters horizontal tab (sec. 9.3), SOH
    (sec 9.1), and backspace (sec. 10.3) are discussed elsewhere.
    The newline delimits input lines.  In addition, STX, ETX,
    ENQ, ACK and BEL are accepted, and may be used as delimiters
    or translated into a graphic with _tr_ (sec. 10.5).  _All_
    others are ignored.

I too am surprised, in view of this, that the original poster ``had no
problems embedding an ESC.''  Certainly it is ignored by both nroff
and troff on our machine.  I suggest that one should certainly not
rely on that behavior; any nroff exhibiting it is, by the User's
Manual, broken.

John Mackin, Basser Department of Computer Science,
	     University of Sydney, Sydney, Australia

john@basser.oz.AU (john%basser.oz@SEISMO.CSS.GOV)
{seismo,hplabs,mcvax,ukc,nttlab}!munnari!basser.oz!john

Copyright 1987 John J. Mackin.  Restricted redistribution prohibited.

fred@applix.UUCP (03/25/87)

The ADDENDUM to the NROFF/TROFF User's Manual that was released as part of
the UNIX System III product states: the "Escape and BEL characters are valid
characters in nroff and are accepted and passed to the output of the formatter.
Troff continues to absorb these characters."  This change was made to nroff
to support those users that wanted (any) access to special printer features
not directly supported by the nroff/troff language.  Use of ESC is
clearly not portable across (some) printers, and across (some) versions of
nroff.

Fred