1
2
3
4
5
6
7
8
9
10
11
12
13
14\unprotect
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\newdimension\d_pack_cutmarks_width
54\newdimension\d_pack_cutmarks_height
55\newdimension\d_pack_cutmarks_depth
56
57\newinteger \horizontalcutmarks \horizontalcutmarks \plustwo
58\newinteger \verticalcutmarks \verticalcutmarks \plustwo
59\newinteger \cutmarkoffset \cutmarkoffset \plusone
60
61\mutable\let\cutmarksymbol \relax
62\mutable\def\cutmarklength {2\bodyfontsize}
63\mutable\def\cutmarkrulethickness{\onepoint}
64
65\mutable\lettonothing\cutmarktoptext
66\mutable\lettonothing\cutmarkbottomtext
67\mutable\lettonothing\cutmarkhoffset
68\mutable\lettonothing\cutmarkvoffset
69
70\permanent\protected\def\horizontalcuts
71 {\hpack to \d_pack_cutmarks_width
72 {\localcontrolledrepeat\horizontalcutmarks{\vrule\s!width\cutmarkrulethickness\s!height\cutmarklength\hfill}
73 \unskip}}
74
75\permanent\protected\def\verticalcuts
76 {\vpack to {\d_pack_cutmarks_height\d_pack_cutmarks_depth}
77 {\hsize\cutmarklength
78 \localcontrolledrepeat\verticalcutmarks{\vrule\s!height\cutmarkrulethickness\s!width\hsize\vfill}
79 \unskip}}
80
81\permanent\protected\def\baselinecuts
82 {\ifdim\d_pack_cutmarks_depth>\zeropoint
83 \vpack to {\d_pack_cutmarks_height\d_pack_cutmarks_depth}
84 {\hsize{\cutmarklength2}
85 \vskip\zeropoint\s!plus\d_pack_cutmarks_height
86 \vrule\s!height\cutmarkrulethickness\s!width\hsize
87 \vskip\zeropoint\s!plus\d_pack_cutmarks_depth}
88 \fi}
89
90\permanent\protected\def\cutmarksymbols#1
91 {\hpack to \d_pack_cutmarks_width
92 {\setbox\scratchbox\hbox to \cutmarklength
93 {\hss\infofont\cutmarksymbol\hss}
94 \hss
95 \vpack to \cutmarklength
96 {\scratchdimen{\cutmarklength2}
97 \scratchdistance\ifempty\cutmarkhoffset\cutmarkoffset\scratchdimen\else\cutmarkhoffset\fi
98 \vss
99 \hbox to \d_pack_cutmarks_width
100 {\llap{\copy\scratchbox\kern\scratchdistance}
101 \kern\scratchdimen\hss
102 \infofont#1
103 \hss
104 \kern\scratchdimen
105 \rlap{\kern\scratchdistance\copy\scratchbox}}
106 \vss}
107 \hss}}
108
109\permanent\protected\def\makecutbox#1
110 {\d_pack_cutmarks_height\ht#1
111 \d_pack_cutmarks_depth \dp#1
112 \d_pack_cutmarks_width \wd#1
113 \setbox#1\hpack
114 {\dontcomplain
115 \forgetall
116 \boxmaxdepth\maxdimen
117 \offinterlineskip
118 \scratchdimen{\cutmarklength2}
119 \hsize\d_pack_cutmarks_width
120 \setbox\scratchbox\vpack
121 {\setbox\scratchbox\hpack{\horizontalcuts}
122 \scratchdistance\ifempty\cutmarkvoffset\cutmarkoffset\scratchdimen\else\cutmarkvoffset\fi
123 \tlap{\copy\scratchbox\vskip\scratchdistance}
124 \hpack to \d_pack_cutmarks_width
125 {\scratchdistance\ifempty\cutmarkhoffset\cutmarkoffset\scratchdimen\else\cutmarkhoffset\fi
126 \setbox\scratchbox\hpack{\verticalcuts}
127 \llap{\copy\scratchbox\kern\scratchdistance}
128 \ifzeropt\d_pack_cutmarks_depth
129 \hfill
130 \else
131 \begingroup
132 \setbox\scratchbox\hpack{\baselinecuts}
133 \llap{\copy\scratchbox\kern\scratchdistance}
134 \hfill
135 \rlap{\kern\scratchdistance\copy\scratchbox}
136 \endgroup
137 \fi
138 \rlap{\kern\scratchdistance\copy\scratchbox}}
139 \blap{\vskip\scratchdistance\copy\scratchbox}}
140 \ht\scratchbox\d_pack_cutmarks_height
141 \dp\scratchbox\d_pack_cutmarks_depth
142 \wd\scratchbox\zeropoint
143 \startcolor[\defaulttextcolor]
144 \box\scratchbox
145 \ifrelax\cutmarksymbol \else
146 \setbox\scratchbox\vpack
147 {\scratchdistance\ifempty\cutmarkvoffset\cutmarkoffset\scratchdimen\else\cutmarkvoffset\fi
148 \vskip{\scratchdistance\cutmarklength}
149 \hpack{\cutmarksymbols\cutmarktoptext}
150 \vskip{\scratchdistance\d_pack_cutmarks_height\d_pack_cutmarks_depth\scratchdistance}
151 \hpack{\cutmarksymbols\cutmarkbottomtext}}
152 \ht\scratchbox\d_pack_cutmarks_height
153 \dp\scratchbox\d_pack_cutmarks_depth
154 \wd\scratchbox\zeropoint
155 \box\scratchbox
156 \fi
157 \stopcolor
158 \box#1}
159 \wd#1\d_pack_cutmarks_width
160 \ht#1\d_pack_cutmarks_height
161 \dp#1\d_pack_cutmarks_depth
162 \box#1}
163
164\permanent\protected\def\cuthbox{\hpack\bgroup\dowithnextbox{\makecutbox\nextbox\flushnextbox\egroup}\hbox}
165\permanent\protected\def\cutvbox{\vpack\bgroup\dowithnextbox{\makecutbox\nextbox\flushnextbox\egroup}\vbox}
166\permanent\protected\def\cutvtop{\tpack\bgroup\dowithnextbox{\makecutbox\nextbox\flushnextbox\egroup}\vtop}
167
168\protect \endinput
169 |