[texhax] \special{} and postscript

Tom Sgouros tomfool at as220.org
Wed Mar 15 04:07:26 CET 2006

Hello all:

I have a Postscript graphic that I would like to put into a \special.
It's a logo which will be integral to the page design of the book class
I'm preparing, and support and portability concerns make me want to
include it this way instead of attaching a separate EPS file to the
class.  I've managed to get it all to work by clumsily hacking around in
the postscript jungle, but there are some problems, one of which is
that, though the logo comes out the right size in the postscript and PDF
output, it is rendered very strangely in xdvi, large enough to obscure
most of the page.  I can turn off postscript in xdvi and live with this,
though it's a pain, but I suspect this is some symptom of my not
understanding this properly.

So my questions are these:

  When you're composing postscript to put into a \special, what units are
  you using?  Why would the postscript "scale" command seem to be
  different for dvips and xdvi (aside from the fact that PS
  interpretation in xdvi is just an add-on -- I know that.)

  Where is the origin?  That is, when used inside a \special, what point
  on the page does the PS currentpoint return, and to what origin do the
  coordinates it returns refer?

  The dvips documentation tells me not to use save/restore, because
  dvips puts it there, but on examination, I can't find this in the
  resulting PS file.  Am I misunderstanding something about that?

  Are any of the comments in my PS file useful as part of the \special
  (like the BoundingBox)?

  Can you do something like this in such a way that both pdflatex and
  dvips/ps2pdf can hack it?  I notice that pdflatex seems to blithely
  ignore my \specials, though dvips can deal with them ok.

And finally,

  Are there any decent writeups about how to write PS to be used in a
  \special?  That is, something that prescribes what is the best
  practice and what is to be avoided.  

Can anyone help me with these?

Many thanks,


 tomfool at as220 dot org

More information about the texhax mailing list