Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!dptg!att!laidbak!obdient!yclept!root From: root@yclept.chi.il.us (Root) Newsgroups: comp.lang.postscript Subject: Re: Help with eroff and postscript Summary: I suggest a different solution to Postscript(tm-Adobe) inclusion. Message-ID: <442@yclept.chi.il.us> Date: 24 Jul 89 14:10:18 GMT References: <374@gizzmo.UUCP> Organization: Leptons and Quarks, Winfield, IL 60190-1412 Lines: 77 In article <374@gizzmo.UUCP>, mark@gizzmo.UUCP (mark hilliard) writes (I extracted the material I wanted to respond to): > 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). > > 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 I do not know what version of Eroff you are talking about. I am talking about Eroff version 2.2 for UNIX. The machine is an AT&T UNIXpc. Use the .cL, .cR, .cC, or .cS graphics inclusion macros as documented on page 2-1. To get the graphic (Postscript code) at the beginning of your material, note the sentence just before the "A.3 GRAPHICS/CODE INCLUDE RESTRICTIONS" header on page 2-4. "If no text has been output yet, you may force the image to be output before any text by calling the .fI macro. This will cause the image to be output without a text line above it." I have discovered that the following works: .P! postscriptfile .fI The purpose of \X'code="postscriptline"' is to be imbedded in your Eroff code to emit the "postscriptline" code into the generated Postscript. It is not a 'wrapper' for each line of your Postscript code. The Postscript code inserted by either method is enclosed in a 'save' and 'restore' pair. This is easy enough to escape; start your code with a 'restore' and end it with a 'save'. Or you can include your custom prologue code with either of the following lines before any text (not macros) in Eroff input: \X'prologcode="short piece of Postscript code"' or \X'prologcode@file' You should replace "file" with your own file name. As both of these methods are documented (chapter 2: pages 12 to 14), I do not expect them to go away in the 'next release.' This last comment is in response to message id <1893@infmx.UUCP>. This is material I learned last night by reading the manual and experimenting with my new printer. I was wanting to put logos first on letters. Randolph J. Herber, @ home: {att|amdahl|clout|mcdchg|laidbak|obdient|wheaton}!yclept!rjh, rjh@yclept.chi.il.us UNIX is a registered trademark of AT&T Corporation. Postscript is a registered trademark of Adobe Corporation.