summaryrefslogtreecommitdiff
path: root/support/lametex/page/page_check.ps
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/lametex/page/page_check.ps
Initial commit
Diffstat (limited to 'support/lametex/page/page_check.ps')
-rw-r--r--support/lametex/page/page_check.ps118
1 files changed, 118 insertions, 0 deletions
diff --git a/support/lametex/page/page_check.ps b/support/lametex/page/page_check.ps
new file mode 100644
index 0000000000..b6afc88062
--- /dev/null
+++ b/support/lametex/page/page_check.ps
@@ -0,0 +1,118 @@
+%! page_check.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 checkerboard page for LameTeX output to look like LaTeX output
+
+%%%%%%%%%%% 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
+
+%%%%%%%%%%%%%%%%% Box %%%%%%%%%%%%%%%%%%%%%%
+% One of many generic Box algorithms I have written in my life. Deal.
+/Box
+{
+ wp 4 div 0 rlineto 0 hp 4 div rlineto wp -4 div 0 rlineto
+ 0 hp -4 div rlineto
+} bind def
+
+%%%%%%%%%%%%%%%% width height left bot Check-Page %%%%%%%%%%%%%%%%%%%%%%
+% Check-Page draws a checkerboard page, given margins and size
+/Check-Page
+{
+ /bp exch def /lp exch def /hp exch def /wp exch def
+ lp bp moveto Box
+ lp bp hp 2 div add moveto Box
+ lp wp 2 div add bp moveto Box
+ lp wp 2 div add bp hp 2 div add moveto Box
+ lp wp 4 div add bp hp 4 div add moveto Box
+ lp wp .75 mul add bp hp 4 div add moveto Box
+ lp wp 4 div add bp hp .75 mul add moveto Box
+ lp wp .75 mul add bp hp .75 mul add moveto Box
+ closepath
+} bind def
+
+%%%%%%%%%%%%%%%% width height left bot Check-Page2 %%%%%%%%%%%%%%%%%%%%%%
+% Check-Page2 draws a checkerboard page, given margins and size
+/Check-Page2
+{
+ /bp exch def /lp exch def /hp exch def /wp exch def
+ lp wp 4 div add bp moveto Box
+ lp wp .75 mul add bp moveto Box
+ lp bp hp 4 div add moveto Box
+ lp wp 2 div add bp hp 4 div add moveto Box
+ lp wp 4 div add bp hp 2 div add moveto Box
+ lp wp .75 mul add bp hp 2 div add moveto Box
+ lp bp hp .75 mul add moveto Box
+ lp wp 2 div add bp hp .75 mul add moveto Box
+ closepath
+} bind def
+
+%% REQUIRED DEFINITIONS START HERE %%
+
+% Makes a path that desribes the page
+/PageShape
+{
+ flip 1 eq
+ {
+ 6.75 in 9.2 in 1.25 in .5 in Check-Page
+ }
+ {
+ 6.75 in 9.2 in 1.25 in .5 in Check-Page2
+ } ifelse
+ currentflat 8 mul
+} bind def
+
+% Anything to do when a new page is started
+/StartPage
+{
+ grestoreall
+ flip 1 eq
+ {
+ 180 rotate
+ -9.1 in -10.2 in translate
+ } if
+} bind def
+
+% Anything to do when a new page is ended
+/EndPage
+{
+ flip 1 eq
+ {
+ 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
+ } if
+ /flip 1 flip sub def
+} 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 false 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 0 in def % Absolute Left Margin for page
+ /RM 8.5 in def % Absolute Right Margin for page
+
+ /flip 0 def
+ userdict /pagenumber known not
+ { /pagenumber 1 def } if % Initialize pagenumber if not done already
+} bind def
+
+InitPage % Just loading this file initializes the page.