🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text
Article #4628

Re: Using Postscript in TeX

#4628
From: peter c halverson
Date: Sun, 17 Apr 1988 19:25
66 lines
3740 bytes
In article <18600001@symcom> wheeler@symcom.math.uiuc.EDU writes:
>
>How exactly do I place a postcript document in a plain TeX file?
>
>I have a postcript file of a small contour that I made from a
>demo version of Framemaker.  I would like to place this figure
>centered in a plain TeX file.  I naively tried to put the
>postcript in a \special but this alone didn't seem to work.
>

We've got a number of semi-kludges that provide for just this kind of
capability, since we've got people who want to include FrameMaker,
Interleaf WPS, Macintosh, and several other sources of graphic images into
(in our case) LaTeX documents --- I'm sure the equivalent plain TeX
solution is similar.  The exact solution depends a great deal on how the
PostScript is structured, and to a lesser degree on how your particular
device driver implements the \special command.  In general, however, you
usually need to hack the PostScript file to change the following:

  o remove any "showpage" operators, so TeX can finish the page properly.
  o add a "currentpoint translate" command, to properly position the
    output on the page.  You can also add a scaling command here as well.
  o save the VM before including your file, and restore it when done, to
    minimize interference with the TeX/LaTeX environment
  o Seek and eliminate anything else that your PostScript's doing that
    would screw up the TeX page :-(

We have a number of awk(1) scripts that do this.  Obviously, this is
extremely dependent on the source and version of your graphic --- i.e.,
between the three versions of FrameMaker that I've seen around here, the
PostScript they generate is in totally different formats.

Once you've "normalized" your PostScript, you can include it into your text
with the \special command.  The exact syntax for including a file is
dependent on the device driver you use.  You'll need to explicitly specify the
amount of vertical space the figure will use --- whether the vspace should
come before or after your \special command depends, again, on the source of
your graphic: for FrameMaker or Macintosh stuff, the space must be added
before the figure is included; for Interleaf, it must come after the
figure. 

As an example, we use the following setup to include a "normalized"
FrameMaker file in a LaTeX document, using ArborText's DVIPS PostScript
driver: 

   \begin{figure}
      \vspace{3.0in}
      \special{ps: plotfile myfile.ps global}
      \caption{Sample Figure}
   \end{figure}

In general this seems to work fairly well, but whether the process of
creating the graphic, normalizing it to work with TeX, and setting up the
right TeX commands isn't more trouble than manual cut 'n' paste is still up
for debate.  The PostScript that some of these systems generate gets pretty
hairy sometimes, and tends to interact with the TeX PostScript in nastily
mysterious ways.


~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Pete Halverson                       ARPA: halverson@ge-crd.ARPA
GE Corporate R&D Center	             UUCP: uunet!steinmetz!iraq!halvers
Schenectady, NY				   halvers@iraq.steinmetz.UUCP

"Inconceivable!"
"You use that word a lot.  I don't think it means what you think it does."
Technical Details
Message-ID: <10465@steinmetz.ge.com>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!steinmetz!iraq!halvers
References: <18600001@symcom>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!steinmetz!iraq!halvers
From: halvers@iraq.steinmetz (peter c halverson)
Newsgroups: comp.text
Subject: Re: Using Postscript in TeX
Message-ID: <10465@steinmetz.ge.com>
Date: 17 Apr 88 19:25:01 GMT
References: <18600001@symcom>
Sender: news@steinmetz.ge.com
Reply-To: iraq!halvers@steinmetz.UUCP (peter c halverson)
Organization: General Electric CRD, Schenectady, NY
Lines: 66
Summary: An Overview