home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / tex / lametex_.z / lametex_ / lametex / page / page_demon.ps < prev    next >
Encoding:
Text File  |  1992-09-02  |  2.3 KB  |  83 lines

  1. %! This is a PostScript library meant to be included in other files %%%
  2. %% Postscript Code by Jon Monsarrat Copyright 1991
  3. %% permission given for anything except selling this or deleting the header.
  4. %% This is a page template for the SCRATCH formatter
  5. %% A normal page for the ASYLUM assassin game
  6.  
  7. % A margin path that goes around the picture of the BSD daemon. The daemon
  8. % itself is rather complex to be the margin path itself, but this is possible.
  9. /DemonBox
  10. {
  11.   3 in 3 in moveto
  12.   2.8 in 3.7 in lineto
  13.   4.1 in 3.7 in lineto
  14.   4.1 in 4.3 in lineto
  15.   2.7 in 5.2 in lineto
  16.   2.6 in 5.7 in lineto
  17.   3.4 in 5.9 in lineto
  18.   4.1 in 8 in lineto
  19.   5.8 in 8 in lineto
  20.   5.4 in 4 in lineto
  21.   7.3 in 3.5 in lineto
  22.   7.3 in 2.6 in lineto
  23.   5.1 in 2.6 in lineto
  24.   closepath
  25. } bind def
  26.  
  27. %%%%%%%%%%%  icon-name  LeftMarginIcon   - %%%%%%%%%%%%
  28. % Given the name of an icon, executes the icon in the left margin.
  29. /LeftMarginIcon
  30. {
  31.   gsave
  32.        20 ypos 72 sub translate cvx exec
  33.   grestore
  34. } bind def
  35.  
  36. %% REQUIRED DEFINITIONS START HERE %%
  37.  
  38. % Makes a path that desribes the page
  39. /PageShape
  40. {
  41. %  0 0 moveto 8.5 in 0 lineto 8.5 in 11 in lineto 0 11 in lineto closepath
  42.   DemonBox
  43.   currentflat 8 mul
  44. } bind def
  45.  
  46. % Anything to do when a new page is started
  47. /StartPage
  48. {
  49. } bind def
  50.  
  51. % Anything to do when a new page is ended
  52. /EndPage
  53. {
  54.    pagenumber 4 string cvs
  55.    dup stringwidth pop 8.5 in
  56.    formatdict /rightmargin get sub
  57.    formatdict /leftmargin get sub 
  58.    exch sub 2 div formatdict /leftmargin get add
  59.    formatdict /bottommargin get 2 div moveto show
  60.    /pagenumber pagenumber 1 add def
  61.    showpage  % A new page here really does mean start a new page.
  62. } bind def
  63.  
  64. %% INITIALIZATION TO DO WHEN FILE IS LOADED %%
  65. % Page-specific defaults that describe the page.
  66. /InitPage
  67. {
  68.   /evenodd true def   % if true use even-odd rule; false means winding rule
  69.   /fillout true def  % true means fill outside shape. false is inside.
  70.  
  71.   /in { 72 mul } def
  72.   /BM 0 in def    % Absolute Bottom Margin for page
  73.   /TM 11 in def   % Absolute Top Margin for page
  74.   /LM .5 in def    % Absolute Left Margin for page
  75.   /RM 8 in def  % Absolute Right Margin for page
  76.   
  77.   userdict /pagenumber known not
  78.   { /pagenumber 1 def } if    % Initialize pagenumber if not done already
  79. } bind def
  80.  
  81. InitPage        % Just loading this file initializes the page.
  82.  
  83.