[comp.sys.mac] Including Mac

ian@mva.cs.liv.ac.uk (10/11/89)

I'm trying to include Superpaint 2 documents in a LaTeX document, by
generating postscript output (using Command-K) and then using a
`\special{...}' to include it in the LaTeX document. I'm using a new(ish)
LaserWriter (prep) with System 6 on the Mac, and I'm running LaTeX on a
MicroVax. If I print the postscript file from the Vax, it prints perfectly but
when I include it in the LaTeX document and print everything, it messes up
completely. I assume that smething in the postscript prologue is interfering
with the postscript generated by dvi2ps. I have successfully managed to
include postscript screen dumps from a Xerox 1186 in LaTeX documents, so the
principle is sound.

Has anyone achieved what I am attempting to do? Can anyone tell me what to
alter to do this successfully? I am not a postscript programmer (I can just
about hack scaling and trnslation!) so simple answers would be appreciated.

Thanx in advance,

Ian Finch              Janet: ian@uk.ac.liv.cs.mva
---------              Internet: ian%mva.cs.liv.ac.uk@cunyvm.cuny.edu
                       UUCP: ...mcvax!ukc!ian@uk.ac.liv.cs.mva
===============================================================================
What's a text processor? Well, you know what a food processor does to food ...

jbw@unix.cis.pitt.edu (Jingbai Wang) (10/13/89)

In article <2454@mva.cs.liv.ac.uk> ian@mva.cs.liv.ac.uk writes:
>I'm trying to include Superpaint 2 documents in a LaTeX document, by
>generating postscript output (using Command-K) and then using a
>`\special{...}' to include it in the LaTeX document. I'm using a new(ish)
>LaserWriter (prep) with System 6 on the Mac, and I'm running LaTeX on a
>MicroVax. If I print the postscript file from the Vax, it prints perfectly but
>when I include it in the LaTeX document and print everything, it messes up
>completely. I assume that smething in the postscript prologue is interfering
>with the postscript generated by dvi2ps. I have successfully managed to
>include postscript screen dumps from a Xerox 1186 in LaTeX documents, so the
>principle is sound.

It depends on which dvi2ps you are using. I dare say that NONE of the existing
dvi->ps programs in the world offers perfect PostScript transparency, and
hence can be called a good PostScript binder. As you know I am one of the 
dvi2ps hackers, and there is a version of dvi2ps from UNIX distribution that
carries my name. However, that w_dvi2ps also suffers from poor PostScript
transparency. Thus, there is a newer version obtainable from ~/tmp
june.cs.washington.edu through ftp (don't ask me to mail, I have great
difficulties in sending a big file that far).

The reasons? Most of the PostScript codes obtained through dumping or
some subroutines that come with some systems (like LPS40 Tektronics->
PS support routines) can be called poor or non-standard PostScript codes.
If the dumped is a bitmap image, it is fine, because it is very simple. 
However, if the dumped is an object or stroking type, i.e., you see
a loop that tries to pull numbers from the PS stack to draw lines (it
is actually demonstrated in Adobe Illustrator), it will cause problems. The
reason is that when you shell into user's sub-page (coordinate system),
the stack might have something in there already. To draw something, you need
at least two numbers, i.e., x and y (for rlineto). Most of the
drawing procedures in such PostScript codes only checks if the stack is empty,
and not how many quantities are there. In the last draw, if there is only
one number left, then the procedure will overdraw the stack and causes
wrong type of argument to "restore" at the end.

Anyway, I have been doing a lot of PostScript programming and text formatter
development (the most recent ones are Chinese->PS formatter and driver
including Chinese TeX, Scribe and troff). For the little time I could spare,
I upgraded dvi2ps a little bit in \special and \psfig parts, and this version
is the one I mentioned above.


JB Wang