neil@teleos.com (Neil Hunt) (03/21/89)
I have developed some software to simplify incorporating PostScript figures into LaTeX documents. The problem I addressed is that of using the design size of an illustration from the PostScript, and causing LaTeX to leave the correct amount of space on the page. The LaTeX document includes figures using a `\psbox{figure}' macro, which generates a `box' which is just like a large letter, and can be included in centered environments, picture environments, tables, or simple text, for example. The program `pstex' is a BiBTeX-like system which scans the .aux file after the first pass of LaTeX, to determine the names of PS files to be included. The PS files are then scanned by pstex, to obtain the `%%BoundingBox:' meta comment, from which the design size of the illustration is found. (A fix for FrameMaker users is also incorporated in which the bounding box is taken to be the extent of a `frame' in which the illustration should be drawn.) The design size is then potentially modified by arguments to the \psbox macro, which can scale the size be a specified amount, or override it while maintaining the design aspect ratio, or override it altogether. The sizes are listed in a new file with extension `.psz', which is read for subsequent passes of LaTeX, in which the figures are incorporated using the \special mechanism at the appropriate size. Use of `pstex' requires a modified version of `dvips', which understands the \special forms used by the \psbox macros. This dvips program is based upon the MIT 1988 dvips program, with the font reading code adapted from that in dvipage 3.0, reading either PXL or GF fonts. It would be easy to incorporate the \special handling code into an alternative dvips program if required. If there is enough interest, I will find an appropriate forum for public distribution. Otherwise, I will email copies to those who wish. Comments to: Internet: Neil@Teleos.com Better internet: Neil%Teleos.com@AI.SRI.com UUCP: ...!decwrl!argosy!teleos!Neil