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

  1. %! page_check.ps    - A replica of the standard LaTeX page
  2. %% This is a LameTeX Page Description File written in PostScript.
  3. %% Postscript Code by Jon Monsarrat Copyright 1992
  4. %% permission given for anything except selling this or deleting the header.
  5. %% This is a page template for the LameTeX formatter
  6. %% A checkerboard page for LameTeX output to look like LaTeX output
  7.  
  8. %%%%%%%%%%%  icon-name  LeftMarginIcon   - %%%%%%%%%%%%
  9. % Given the name of an icon, executes the icon in the left margin.
  10. /LeftMarginIcon
  11. {
  12.   gsave
  13.        20 ypos 72 sub translate cvx exec
  14.   grestore
  15. } bind def
  16.  
  17. %%%%%%%%%%%%%%%%%  Box %%%%%%%%%%%%%%%%%%%%%%
  18. % One of many generic Box algorithms I have written in my life. Deal.
  19. /Box
  20. {
  21.   wp 4 div 0 rlineto 0 hp 4 div rlineto wp -4 div 0 rlineto
  22.   0 hp -4 div rlineto
  23. } bind def
  24.  
  25. %%%%%%%%%%%%%%%% width height left bot Check-Page %%%%%%%%%%%%%%%%%%%%%%
  26. % Check-Page draws a checkerboard page, given margins and size
  27. /Check-Page
  28. {
  29.   /bp exch def /lp exch def /hp exch def /wp exch def
  30.   lp bp moveto Box
  31.   lp bp hp 2 div add moveto Box
  32.   lp wp 2 div add bp moveto Box
  33.   lp wp 2 div add bp hp 2 div add moveto Box
  34.   lp wp 4 div add bp hp 4 div add moveto Box
  35.   lp wp .75 mul add bp hp 4 div add moveto Box
  36.   lp wp 4 div add bp hp .75 mul add moveto Box
  37.   lp wp .75 mul add bp hp .75 mul add moveto Box
  38.   closepath
  39. } bind def
  40.  
  41. %%%%%%%%%%%%%%%% width height left bot Check-Page2 %%%%%%%%%%%%%%%%%%%%%%
  42. % Check-Page2 draws a checkerboard page, given margins and size
  43. /Check-Page2
  44. {
  45.   /bp exch def /lp exch def /hp exch def /wp exch def
  46.   lp wp 4 div add bp moveto Box
  47.   lp wp .75 mul add bp moveto Box
  48.   lp bp hp 4 div add moveto Box
  49.   lp wp 2 div add bp hp 4 div add moveto Box
  50.   lp wp 4 div add bp hp 2 div add moveto Box
  51.   lp wp .75 mul add bp hp 2 div add moveto Box
  52.   lp bp hp .75 mul add moveto Box
  53.   lp wp 2 div add bp hp .75 mul add moveto Box
  54.   closepath
  55. } bind def
  56.  
  57. %% REQUIRED DEFINITIONS START HERE %%
  58.  
  59. % Makes a path that desribes the page
  60. /PageShape
  61. {
  62.   flip 1 eq
  63.   {
  64.     6.75 in 9.2 in 1.25 in .5 in Check-Page
  65.   }
  66.   {
  67.     6.75 in 9.2 in 1.25 in .5 in Check-Page2
  68.   } ifelse
  69.   currentflat 8 mul
  70. } bind def
  71.  
  72. % Anything to do when a new page is started
  73. /StartPage
  74. {
  75.    grestoreall
  76.    flip 1 eq
  77.    {
  78.      180 rotate
  79.      -9.1 in -10.2 in translate
  80.    } if
  81. } bind def
  82.  
  83. % Anything to do when a new page is ended
  84. /EndPage
  85. {
  86.    flip 1 eq
  87.    {
  88.      pagenumber 4 string cvs
  89.      dup stringwidth pop 8.5 in
  90.      formatdict /rightmargin get sub
  91.      formatdict /leftmargin get sub 
  92.      exch sub 2 div formatdict /leftmargin get add
  93.      formatdict /bottommargin get 2 div moveto show
  94.      /pagenumber pagenumber 1 add def
  95.      showpage
  96.    } if
  97.    /flip 1 flip sub def
  98. } bind def
  99.  
  100. %% INITIALIZATION TO DO WHEN FILE IS LOADED %%
  101. % Page-specific defaults that describe the page.
  102. /InitPage
  103. {
  104.   /evenodd true def   % if true use even-odd rule; false means winding rule
  105.   /fillout false def  % true means fill outside shape. false is inside.
  106.  
  107.   /in { 72 mul } def
  108.   /BM 0 in def    % Absolute Bottom Margin for page
  109.   /TM 11 in def   % Absolute Top Margin for page
  110.   /LM 0 in def    % Absolute Left Margin for page
  111.   /RM 8.5 in def  % Absolute Right Margin for page
  112.  
  113.   /flip 0 def  
  114.   userdict /pagenumber known not
  115.   { /pagenumber 1 def } if    % Initialize pagenumber if not done already
  116. } bind def
  117.  
  118. InitPage        % Just loading this file initializes the page.
  119.