[comp.text.tex] Question on PostScript overlays in LaTeX using dvips

stan@dnlunx.pttrnl.nl (Stan van de Burgt) (04/22/91)

Hello, 
I've found some postscript tricks on the net some time ago.
Now I am trying to get it working in my LaTeX document.
The Postscript commands should create a grey overlay of the 
word "DRAFT" over the normal LaTeX page. Here are the programs I
have:

% this one can be used in Word 4.0

.page.
/Times-Bold findfont 100 scalefont setfont
wp$x 2.8 div wp$y 3.5 div translate
0 setlinewidth
52.3 rotate 0 0 moveto (D R A F T) true charpath
gsave .95 setgray fill grestore stroke


Including this file with \special{psfile=draft.ps} on each page (e.g.
by placing it into the header with \markboth) should work after the
wp$x and wp$y are replaced by proper values and .page. is removed.
I tried this script:

%!
gsave
0 0 moveto
/Times-Bold findfont 100 scalefont setfont
% wp$x 2.8 div wp$y 3.5 div translate
180 210 translate
0 setlinewidth
52.3 rotate 0 0 moveto (D R A F T) true charpath
gsave .95 setgray fill grestore stroke
grestore
% showpage

Which works fine on its own. No effect in the LaTeX file however, although
dvips tells me that the draft.ps file is included for each page...

Another try:

%!
%%BoundingBox: 0 0 460 37
gsave
70 dict
begin
  % Text, font and size:
  /font /Helvetica-Bold def
  /pointsize 72 def
  /text (DRAFT) def
  % 
  /center {dup stringwidth pop
  2 div neg 0 rmoveto} def
  306 396 moveto
  .4 setgray
  font findfont pointsize scalefont setfont
  45 rotate
  24 0 text center ashow
end
grestore
%showpage

But no, it doesn't work. 

The LaTeX file has the following outline:

\documentstyle{article}
\title{\bf Title}
\date{April, 1991}
\pagestyle{myheadings}
\markboth{}{\sf Header text%
\special{psfile=draft.ps}%
}
\begin{document}
\maketitle
\begin{abstract}
Draft text
\end{abstract}
\newpage
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text text text text text text text
text text text text text text text text
\end{document}

Anyone any ideas on this subject?

			Thanks,

			Stan
-- 
   S.P. van de Burgt                       PTT Research, Neher Labs
                                           PO Box 421, Leidschendam
   E-mail: SP_vdBurgt@pttrnl.nl            the Netherlands

russell@ccu1.aukuni.ac.nz (Russell J Fulton;ccc032u) (04/29/91)

stan@dnlunx.pttrnl.nl (Stan van de Burgt) writes:

>Hello, 
>I've found some postscript tricks on the net some time ago.
>Now I am trying to get it working in my LaTeX document.
>The Postscript commands should create a grey overlay of the 
>word "DRAFT" over the normal LaTeX page. Here are the programs I
>have:

Dvips will execute a routine called bop_hook at the start of each page if it 
is present. (Oops that might be BOP_hook, check the docoumentation.)

I think the documentation actually includes an example of how to do this.

Russell.
-- 
Russell Fulton, Computer Center, University of Auckland, New Zealand.
<rj_fulton@aukuni.ac.nz>