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