aboutsummaryrefslogtreecommitdiffstats
path: root/system/doc/Books/src/frame_crop.header.src
diff options
context:
space:
mode:
Diffstat (limited to 'system/doc/Books/src/frame_crop.header.src')
-rw-r--r--system/doc/Books/src/frame_crop.header.src101
1 files changed, 101 insertions, 0 deletions
diff --git a/system/doc/Books/src/frame_crop.header.src b/system/doc/Books/src/frame_crop.header.src
new file mode 100644
index 0000000000..131045ef8d
--- /dev/null
+++ b/system/doc/Books/src/frame_crop.header.src
@@ -0,0 +1,101 @@
+%% This PostScript file centers the page on an A4 paper and draws a
+%% crop marks. dvips is assumed.
+
+%% DEBUG
+%% /mydict 20 dict def mydict begin
+
+%% Millimeter to postscript points:
+
+/mm{ 25.4 div 72 mul }def
+
+
+%% The size of the retangle is:
+
+/papw 172 mm def
+/paph 232 mm def
+
+%% The text area size is:
+
+%%/txtw{131 mm}def
+%%/txth{285 mm}def
+
+
+%% A4 size is:
+
+/A4w 209 mm def
+/A4h 296 mm def
+
+%% Draw crop marks
+
+/mkcrop{
+ 0.3 setlinewidth
+ 0 0 mkonecrop
+ papw 0 mkonecrop
+ 0 paph mkonecrop
+ papw paph mkonecrop
+} def
+
+/mkonecrop{gsave
+ translate
+ newpath
+ 0 18 moveto
+ 0 -18 lineto
+ stroke
+ newpath
+ -18 0 moveto
+ 18 0 lineto
+ stroke
+ grestore } def
+
+%% Draw a frame
+
+/mkframe{
+ gsave
+ 0 A4h paph sub moveto
+ papw 0 rlineto
+ 0 paph rlineto
+ papw neg 0 rlineto
+ 0 paph neg rlineto
+ stroke
+ grestore
+} def
+
+/mkmarks{mk@MARKS@} def
+
+/mkinfo{ gsave
+ 72 68 moveto (Book: @BOOK@) show
+ 72 60 moveto (Generated by dvips: @DATE@) show
+ 72 52 moveto (Config spec: @CSFILE@) show
+ 72 44 moveto (View: @VIEW@) show
+ 72 36 moveto (User: @USER@) show
+ 72 28 moveto (Latex: @LATEX@) show
+ 72 20 moveto (@DOCBVSN@ @DOCB@) show
+ 72 12 moveto (@DVIPSVSN@ @DVIPS@) show
+ 288 68 moveto (Book build: @BOOKBUILD@) show
+ 288 60 moveto (Build script: @BUILDSCRIPT@) show
+ grestore
+} def
+
+
+%% Beginning-of-page hook (the thing called by dvips):
+
+/bop-hook{
+ gsave
+ /Helvetica findfont 7 scalefont setfont
+ gsave
+ A4w papw sub 2 div
+ A4h paph sub 2 div neg
+ translate
+ mkmarks
+ grestore
+ mkinfo
+ grestore
+} def
+
+%% DEBUG
+%%/bop-hook
+%%showpage
+%%end
+
+
+