aboutsummaryrefslogtreecommitdiffstats
path: root/system/doc/Books/src/frame_crop.header.src
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2009-11-20 14:54:40 +0000
committerErlang/OTP <[email protected]>2009-11-20 14:54:40 +0000
commit84adefa331c4159d432d22840663c38f155cd4c1 (patch)
treebff9a9c66adda4df2106dfd0e5c053ab182a12bd /system/doc/Books/src/frame_crop.header.src
downloadotp-84adefa331c4159d432d22840663c38f155cd4c1.tar.gz
otp-84adefa331c4159d432d22840663c38f155cd4c1.tar.bz2
otp-84adefa331c4159d432d22840663c38f155cd4c1.zip
The R13B03 release.OTP_R13B03
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
+
+
+