[comp.text] Help with eroff and postscript

mark@gizzmo.UUCP (mark hilliard) (07/23/89)

Well, I like eroff, and have found the man set very good untill now, but
I am stumped.  Can anyone shed some light on this?

Ok,  I have a standard text file written with the mm macros, pic, and tbl
sections.  Now, I would like to include a postscript segment at the TOP
of my file, and then send the entire thing through eroff to a postscript
printer.  Although this is not important, my command line will look
something like this:

tbl file | pic -D | eroff -mm -dps

The man on page 2-13 says that I have to append 
the \X'code="postscriptline"' stuff to EACH line in my postscript file
that I want to include in my troff file (up to 80 chars per line max).
This is NOT acceptable, as I do not wish to have to modify EACH and 
EVERY line of my postscript include file. 

IS THERE ANY EASIER WAY TO DO THIS????

Can I add my postscript file into header file (must be there for eroff
somewhere) that eroff (must?) send to the postscript printer with
the -dps command?  And if this is possible, is there someway to 
specify via command line option which header file to use?




-- 
Mark Hilliard                            {ethos,fthood,u1100a}-----\
   N2HHR                                rutgers!rochester!kodak!pcid!gizzmo!mark
                                                                \-->gizzmo!mark

kg@elan.elan.com (Ken Greer) (07/23/89)

From article <375@gizzmo.UUCP>, by mark@gizzmo.UUCP (mark hilliard):
> 
> Well, I like eroff, and have found the man set very good untill now, but
> I am stumped.  Can anyone shed some light on this?
> 
> Ok,  I have a standard text file written with the mm macros, pic, and tbl
> sections.  Now, I would like to include a postscript segment at the TOP
> of my file, and then send the entire thing through eroff to a postscript
> printer.

It sounds like you want to use:

	\X'code@postscriptfile'
or
	\X'prologcode@postscriptfile'

Ken Greer  Elan Computer Group, Inc. 888 Villa St. 3rd Floor Mt View CA 94041
Phone:     415-964-2200
Internet:  kg@elan.com
UUCP:      {ames,hplabs,uunet}!elan!kg

jlo@elan.elan.com (Jeff Lo) (07/27/89)

In article <1032@esatst.yc.estec.nl> arne@esatst.UUCP (Arne Lundberg) writes:
>In article <1893@infmx.UUCP> cortesi@infmx.UUCP (David Cortesi) writes:
>>Chapter 2 of the eroff manual a while I called Elan tech support and was
>>given this undocumented gimmick:
>>
>>      \!!prologcode@pathname...
>>
>>By the way, since this IS undocumented, don't blame me if they drop
>>it next release - but for now it works pretty well.
>
>They have not dropped it, they changed the syntax to
>
>	\X'prologcode@pathname'
>
>and DOCUMENTED it. This is based on EROFF Release 2.2 for Unix.

As it turns out, the \!!prologcode ... should be used, rather than
\X'prologcode ...' for PostScript, because by the time troff outputs
the pass-through to the driver with \X it has already started emitting
positioning commands.  When the PostScript driver sees any positioning
or text commands it closes out the prolog and starts working within a
save/restore context for the first page, and any additions to the
prolog are disallowed.  The \!! pass-through is totally transparent,
and no formatting commands are output before it *if* the \!! commands
are at the beginning of the source file.  This way the driver will
see the prologcode command before it has closed out the prolog and
the PostScript code will be added to the prolog.  Unfortunately, the
Eroff release 2.2 manuals had been printed before all of the code had
been finalized, and for this reason we are leaving the (currently
undocumented) \!! command in Eroff, and it will be re-documented in
later revisions of the manual.  The \!!prologcode usage has been
documented in the Eroff 2.2 READ.ME file for the last year or so.
Further questions should be directed to the Elan support staff or
to me (support@elan.com or jlo@elan.com).  Thanks.
-- 
Jeff Lo, Elan Computer Group, Inc.
jlo@elan.com, ..!{ames,uunet}!elan!jlo
888 Villa Street, Third Floor, Mountain View, CA 94041, 415-964-2200