summaryrefslogtreecommitdiff
path: root/support/lametex/page/page_kludge.ps
blob: 19d45e083cf1e78aa51f5385b5e86520c2ba2b19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
%! page_kludge.ps    - A replica of the standard LaTeX page
%% This is a LameTeX Page Description File written in PostScript.
%% Postscript Code by Jon Monsarrat Copyright 1992
%% permission given for anything except selling this or deleting the header.
%% This is a page template for the LameTeX formatter
%% A normal page for LameTeX output to look like LaTeX output

% Makes a path that desribes the page
/PageShape
{
  8.5 in 8.5 in moveto 6 in 6.2 in 2.4 in 90 270 arc 8.5 in 4 in lineto
  currentflat 8 mul
} bind def

%%%%%%%%%%%  icon-name  LeftMarginIcon   - %%%%%%%%%%%%
% Given the name of an icon, executes the icon in the left margin.
/LeftMarginIcon
{
  gsave
    20 ypos 72 sub translate cvx exec
  grestore
} bind def

%% REQUIRED DEFINITIONS START HERE %%

% Anything to do when a new page is started
/StartPage
{
  /Roach pagenumber startpage
  sub dup mul 3 mul SprinkleIcon
  5 dict begin
  /bp 1 in def /lp 3.5 in def /hp 10.3 in def /wp 5 in def
  lp wp 2 div add bp hp 2 div add moveto
  45 rotate
  /Helvetica-Bold findfont 45 scalefont setfont
  [ (NO KLUDGES) (NO BUGS) (MOSTLY NONE) (OK, A FEW) (NO BUGS!)
    (NO BIG BUGS) (READ) (MY LIPS) (NO NEW BUGS) (HELP!) 
    (HELP!) (HELP!) (HELP!) (HELP!) ]
  pagenumber startpage sub get
  dup stringwidth pop 2 div -1 mul -16 rmoveto
  show -45 rotate newpath
  lp wp 2 div add bp hp 2 div add 2 copy moveto wp .45 mul 0 rmoveto
  wp .45 mul 360 0 arcn closepath
  lp wp 2 div add bp hp 2 div add 2 copy moveto
  wp .37 mul dup 53 cos mul exch 53 sin mul rmoveto
  wp .37 mul 53 217 arc closepath
  lp wp 2 div add bp hp 2 div add 2 copy moveto
  wp .37 mul dup 233 cos mul exch 233 sin mul rmoveto
  wp .37 mul 233 37 arc closepath
  closepath stroke
  end
} bind def

% Anything to do when a new page is ended
/EndPage
{
   pagenumber 4 string cvs
   dup stringwidth pop 8.5 in
   formatdict /rightmargin get sub
   formatdict /leftmargin get sub 
   exch sub 2 div formatdict /leftmargin get add
   formatdict /bottommargin get 2 div moveto show
   /pagenumber pagenumber 1 add def
   showpage  % A new page here really does mean start a new page.
} bind def

%% INITIALIZATION TO DO WHEN FILE IS LOADED %%
% Page-specific defaults that describe the page.
/InitPage
{
  /evenodd true def   % if true use even-odd rule; false means winding rule
  /fillout true def  % true means fill outside shape. false is inside.

  /in { 72 mul } def
  /BM 0 in def    % Absolute Bottom Margin for page
  /TM 11 in def   % Absolute Top Margin for page
  /LM 1 in def    % Absolute Left Margin for page
  /RM 7.5 in def  % Absolute Right Margin for page
  
  userdict /pagenumber known not
  { /pagenumber 1 def } if    % Initialize pagenumber if not done already
  /startpage pagenumber def
} bind def

InitPage        % Just loading this file initializes the page.