Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!think.com!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!jay From: jay@ctr.columbia.edu (Jay Hyman) Newsgroups: comp.text.tex Subject: Re: Using a PostScript File from FrameMaker in LaTeX Message-ID: <1991Jan31.203231.11006@ctr.columbia.edu> Date: 31 Jan 91 20:32:31 GMT Organization: Columbia University Center for Telecommunications Research Lines: 194 Enclosed is a shell script which can create EPSF files out of standard single-page FrameMaker 2.0 documents in either portrait or landscape mode. (It also accepts two other types of input files.) It inserts (precomputed) bounding boxes corresponding to these two page sizes. The output files can then be included in a LaTex document using the psfig macro. Here at Columbia, we have found it relatively painless to include Frame Maker figures in our LaTeX documents. [BTW, we are using an old (1987) version of (Rokicki's ?) dvips, and it works just fine ... I hope newer versions work just as well...] Three caveats: 1) For this filter to be effective, your figure needs to fill the entire page of the Frame maker document, because the figure will be shrunk till the whole page fits in the space you allocate for the figure. 2) The full Frame Maker PostScript prolog is included in each .ps file, and hence in each .eps file in this simple approach. This makes for very slow printing if a paper contains a significant number of figures. I looked briefly at the possibility of preloading the FM Dictionary and deleting the full prolog from all but the first such figure included in a paper, but I gave up fairly briefly because I don't understand too much about how PostScript works and don't have the time to learn. (If anyone out there who is more knowledgable wants to give it a shot...) 3) As mentioned, this stuff is for the PostScript output from FrameMaker Version 2.0. I don`t believe it works with 1.x, and I don't know about anything later. Example usage: (Frame maker figure in landscape mode saved as fig.ps) (command to shell...) > psfilt fmland fig.ps fig.eps # to create the eps file (in LaTeX document:) \begin{figure}[thb] \centerline{\psfig{figure=fig.eps,height=4.5in}} \caption{\label{fig:maker} \protect{This figure was made by Frame Maker.}} \end{figure} And finally, here is the script, which was hacked together by Giovanni Pacifici, with some help from me, Jay Hyman jay@ctr.columbia.edu Center for Telecommunications Research Columbia University ---------------------- cut here ----------------------- #!/bin/sh # # psfilt: filter to translate various PostScript files to EPSF # # Copyright (c) 1991, Giovanni Pacifici # # Permission is granted to copy and distribute this file in modified # or unmodified form, for noncommercial use, provided (a) this copyright # notice is preserved, (b) no attempt is made to restrict redistribution # of this file, and (c) this file is not distributed as part of any # collection whose redistribution is restricted by a compilation copyright. # trap 'echo interrupt; exit' 1 2 3 9 15 if test $# -ne 3 then echo "This Program Translates Frame Maker, Mathematica and Splus" echo "PostScript Files into Encapsulated PostScript Files." echo "You can include these files directly into Latex Documents." echo "To Run The Filter use:" echo " " echo $0 "filetype InputFile OutputFile" echo " " echo "filetype can be one of the following:" echo " fmland: Specifies that the input file is a Frame Maker" echo " PostScript in Landscape Format" echo " fmport: Specifies that the input file is a Frame Maker" echo " PostScript in Portrait Format" echo " Splus: Specifies that the input file is a Splus" echo " PostScript in Landscape Format" echo " Math: Specifies that the input file is Mathematica" echo " PostScript" echo " " exit fi case $1 in fml*) echo "PostScript To EPSF Filter" echo "Converting Landscape Frame Maker File:" $2 echo "Output to File:" $3 cat $2 | \ nawk ' BEGIN { } { if ($0 ~ "^%%BoundingBox") { print $1 " 180 180 612 792" } if ($0 ~ " FMDOCUMENT") { print $1, $2 " 2 2 " $5, $6, $7, $8 } if ($0 ~ " 1 FMBEGINPAGE") { print $1, $2 " 0 " $4 } if ($0 !~ " 1 FMBEGINPAGE" && $0 !~ " FMDOCUMENT" && $0 !~ "^%%BoundingBox") { print $0 } } END { } ' > $3 ;; fmp*) echo "PostScript To EPSF Filter" echo "Converting Portrait Frame Maker File:" $2 echo "Output to File:" $3 cat $2 | \ nawk ' BEGIN { } { if ($0 ~ "^%%BoundingBox") { print $1 " 0 0 612 792" } if ($0 ~ " FMDOCUMENT") { print $1, $2 " 2 2 " $5, $6, $7, $8 } if ($0 !~ " FMDOCUMENT" && $0 !~ "^%%BoundingBox") { print $0 } } END { } ' > $3 ;; Sp*) echo "PostScript To EPSF Filter" echo "Converting Landscape Splus File:" $2 echo "Output to File:" $3 cat $2 | \ nawk ' BEGIN { } { if ($0 ~ "^%%BoundingBox") { print $1 " 20 150 792 792" } if ($0 ~ "Landscape true def") { print $1, "false", $3 } if ($0 ~ "^/Region ") { print "/Region [20 150 792 792] def" } if ($0 !~ "Landscape true def"&& $0 !~ "^/Region " && $0 !~ "^%%BoundingBox") { print $0 } } END { } ' > $3 ;; ma*) echo "PostScript To EPSF Filter" echo "Converting Mathematica File:" $2 echo "Output to File:" $3 cat $2 | \ nawk ' BEGIN { } { if ($0 ~ "^%!") { print $0 print "%%BoundingBox: 0 100 612 632" } else { print $0 } } END { } ' > $3 ;; *) echo 'unexpected name:' $1 ;; esac -- Jay Hyman jay@ctr.columbia.edu Center for Telecommunications Research Columbia University