summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/crop/crop.dtx
blob: 321cd24c2410788cc3804542638256c1c8895d88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
% \iffalse
%% File: crop.dtx Copyright (C) 1998--2003 Melchior FRANZ
%% $Id: crop.dtx,v 1.92 2003/05/19 20:05:17 m Rel $
%% $Version: 1.9 $
%<*preamble>
%
%
%
% on Unix/Linux just run "make" to get the style file and the documentation;
% else generate the driver crop.ins (if you don't already have it):
%
%     $ latex crop.dtx
%
% Now generate the style file:
%
%     $ tex crop.ins
%
% And finally to produce the documentation run LaTeX three times:
%
%     $ latex crop.dtx
%
%
%
%
%
%
%$
%% ====================================================================
%%  @LaTeX-package-file{
%%     author          = "Melchior FRANZ",
%%     version         = "1.9",
%%     date            = "20 May 2003",
%%     filename        = "crop.dtx",
%%     address         = "Melchior FRANZ
%%                        Rieder Hauptstrasse 52
%%                        A-5212 SCHNEEGATTERN
%%                        AUSTRIA",
%%     URL             = "http://www.unet.univie.ac.at/~a8603365/",
%%     email           = "a8603365@unet.univie.ac.at",
%%     codetable       = "ISO/ASCII",
%%     keywords        = "cropmarks, frame, mirror, rotate, invert",
%%     supported       = "yes",
%%     docstring       = "This document describes the crop package, which
%%                        provides different forms of crop marks for
%%                        trimming paper stacks, for camera alignment and
%%                        for visualizing the page dimensions.
%%                        There are options for centering the page with
%%                        respect to some physical paper size, for
%%                        mounting pages on a physical sheet, for
%%                        reflecting and inverting the whole document or
%%                        printing it upside-down, and for suppressing
%%                        either text or graphics output.",
%%  }
%% ====================================================================
%
% COPYRIGHT NOTICE:
% This package is free software that can be redistributed and/or modified
% under the terms of the LaTeX Project Public License as specified
% in the file macros/latex/base/lppl.txt on any CTAN archive server.
%
%</preamble>
%
%
%<*batchfile>
\begin{filecontents}{crop.ins}
\def\batchfile{crop.ins}
\input docstrip.tex
\askforoverwritefalse
\keepsilent
\generate{\file{crop.sty}{\from{crop.dtx}{package}}}
\endbatchfile
\end{filecontents}
%</batchfile>
%
%
%
%<*driver>
\def\fileversion{1.9}
\def\filedate{2003/05/20}
\documentclass[draft]{ltxdoc}
%
\newcommand*\option{\textsf}
\newcommand*\package{\texttt}
\newcommand*\program{\texttt}
\newcommand*\person{\textsc}
\newcommand*\itemfont{\sffamily}
\newcommand*\versal[1]{\textsc{\small#1}}
\newcommand*\CD{\versal{CD}}
\newcommand*\PS{\versal{PS}}
\newcommand*\DVI{\versal{DVI}}
\newcommand*\A{\versal{A4}}
\newcommand*\ISO{\versal{ISO-A4}}
\newcommand*\POSTSCRIPT{\textsc{PostScript}}
\newcommand*\CROP{\package{crop}}
% (the following two are for development versions ONLY!   :-)
\newcommand*\FIXME{\marginpar{\Huge FIXME}\message{<FIXME>}\shop\stop}
\newcommand*\BS{\marginpar{\Huge BULLSHIT!}\show\stop}
%
%
\IfFileExists{crop.sty}
  {\usepackage{crop}[2001/11/16]\let\CROPSTYfound\active}
  {\GenericWarning{crop.dtx}
    {Package file `crop.sty' not found (One picture will be missing.^^J
    Generate `crop.sty' by (La)TeXing `crop.ins' and
    process `crop.dtx' again.)^^J}}
%
%
\newenvironment{labeling}[1]
  {\list{}{\settowidth{\labelwidth}{\textbf{#1}}
  \leftmargin\labelwidth\advance\leftmargin\labelsep
  \def\makelabel##1{\textbf{##1}\hfil}}}{\endlist}
%
%
\newenvironment{example}[1][.9\textwidth]
  {\par\medskip\begin{tabular}{p{#1}l}}
  {\end{tabular}\noindentafter\medbreak}
%
\makeatletter
\newcommand*\noindentafter{\@nobreaktrue\everypar{{\setbox\z@\lastbox}}}
\makeatother
%
% ^^A \RecordChanges
%
\begin{document}
\hfuzz.6pt
\setcounter{tocdepth}{2}
\DocInput{crop.dtx}
\end{document}
%</driver>
% \fi
%
%
% \CheckSum{1063}
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
%
%
%
%
% \title{The \CROP\ package}
%
% \author{Melchior \textsc{FRANZ}}
% \date{May 20, 2003}
% \maketitle
%
%
% \changes{v1.0}{1998/05/20}{Initial version}%
%
% \changes{v1.1a}{1998/10/20}{`smash replaced; The crop marks
%   were displaced, when the package was used together with the
%   \texttt{amsmath} package (V1.2c), which redefines the \LaTeX\ smash
%   command to have a different meaning. Although, this is definitely a
%   bug in the \texttt{amsmath} design, we do no longer use
%   `smash. This problem was kindly reported by \person{Pauli Viljamaa.}}%
%
% \changes{v1.2}{1998/12/07}{options `mirror' and `invert' added
%   on suggestion by \person{Rolf Niepraschk.}}%
%
% \changes{v1.3}{1999/03/07}{center the logical paper `AtBeginDocument'
%   instead of immediately; postamble changed slightly; `uppercase
%   removed from info}
%
% \changes{v1.3a}{1999/05/15}{copyright complies with the LPPL; code unchanged}
%
% \changes{v1.4}{2000/02/02}{options `rotate' (suggested by \person{Rolf}) and
%   `info/noinfo' (requested by \person{Anshuman Pandey}) added}
%
% \changes{v1.5}{2001/10/07}{*center options replaced by `center' and paper size
%   options; options `dvips', `pdftex', `graphics', `nographics', `notext',
%   `color', `horigin' and `vorigin' added; new info line with time stamp;
%   some of the improvements were suggested by Cpt.~\person{Leszek Flis}}
%
% \changes{v1.6}{2001/11/16}{font option added; dvips/pdftex/vtex options
%   changed; nographics enabled for pdftex; fixed a nasty bug that
%   disallowed setting the physical paper size in the config file---thanks
%   to \person{Stefan Becuwe} for reporting this.}
%
% \changes{v1.7}{2002/05/14}{odd/even/width/height options added; better
%   geometry.sty compatibility; adopting `stockwidth/`stockheight}
%
% \changes{v1.8}{2003/05/10}{removed all the `changes entries except those
%   in the preamble (crop is in CVS since v1.4, anyway); rewrote kernel;
%   added color support; fixed a nasty bug; better driver detection}
%
% \changes{v1.9}{2003/05/20}{don't create command sequences by merely
%   checking for them}
%
%
%
% \begin{abstract}
% This article describes the \CROP\ package^^A
%^^A
% \footnote{This file has version number \fileversion, last revised
% \filedate.\\I'd like to thank \person{Rolf Niepraschk} for his useful
% hints and suggestions, which influenced the package substantially.
% A big thank you also goes to \person{Walter Schmidt} for his extensive
% tests and his expertise on compatibility issues with different devices.}^^A
%^^A
% , which provides different forms of crop marks for trimming paper
% stacks, for camera alignment and for visualizing the page dimensions.
% There are options for centering the document page on the paper sheet,
% for mounting pages on a physical sheet, for reflecting and inverting
% the whole document or printing it upside-down, and for suppressing
% either text or graphics output.
%
% The package was originally developed for needs of the
% Austrian Red Cross\slash Federal Province of Vienna\slash
% Department of Radiation Protection.
% \end{abstract}
%
%
%
%
%
% {\setlength\parskip{0pt}\tableofcontents}
% \addtocontents{toc}{\protect\begin{multicols}{2}}
%
%
% \section{Introduction}
% It is convenient to print documents for smaller logical paper sizes
% on paper of the printer's standard physical paper size.
% On the one hand this keeps from changing paper stacks, on the other
% hand it allows printing close to the logical paper edge and even outside
% the logical page.
%
% For trimming a whole paper stack or lining up the single pages on
% printing plates for photographical duplication a set of corner marks
% is required.
%
%
%
%
%
% \section{How to use the package}
%
% \subsection{Conventional options}
% \label{sec:conventional}
%
% These options may only be used in the preamble and have to be stated
% as arguments to the |\usepackage| command (as in |\usepackage[mirror]{crop}|).
%
% \begin{labeling}{\indent\indent}
% \item[\itemfont a0, a1, a2, a3, a4, a5, a6,
%    b0, b1, b2, b3, b4, b5, b6, letter, legal, executive]\hfill\break
%    These options declare the printing paper dimensions. One of them should be
%    specified if the \option{center} option or one of the options \option{dvips},
%    \option{pdftex} and \option{vtex} is used. The size options do not
%    define the logical document page size! See section~\ref{sec:custom-logical}
%    for how to achieve this.
%
% \item[\itemfont width, height]---
%    Instead of using one of the pre-defined paper formats as described
%    above, you can also set the physical paper dimensions directly. You may omit
%    the `|true|' specifier if you don't plan to scale the document.
%    Example: |\usepackage[cam,width=10truecm,height=13truecm]{crop}|
%
% \item[\itemfont center]
%    This option centers the logical document page on the physical printer paper
%    and therefore requires that you declare the sheet size properly. Write,
%    for example, |\usepackage[cam,a4,center]{crop}| to center a document of any size
%    on \ISO\ sheets.
%
% \item[\itemfont landscape]---
%    Use this option in addition to the \option{center} option if you want
%    to center a document on \emph{landscape oriented} paper. It has nothing
%    to do with \LaTeX's |landscape| document class option.
%
% \item[\itemfont dvips, pdftex, pdflatex, vtex, nodriver]---
%    If you are working with \program{dvips}, \program{pdftex} or \program{vtex}
%    you may want to pass the dimensions of the paper that you are planning to print on to
%    the respective driver program. Especially viewer programs like \program{gs}
%    or \program{gv} make use of this \emph{bounding box} information. Unfortunately,
%    this can't be done in a generic way---there's no standard. These options select
%    driver specific methods to set the paper size and to rotate and reflect a page.
%
%    The \CROP\ package tries to find out by itself which driver to use.
%    You find its choice mentioned in the log file. Additionally, you can
%    \emph{suggest} (|[dvips]|) or \emph{enforce} (|[dvips!]|) one of the drivers. In the
%    latter case you only have to add an exclamation point to the driver
%    option. The difference is, that a suggestion may get overruled by the
%    package. Assume you have asked for |[dvips]|, but run the document file
%    through \program{pdflatex}. In this case \CROP\ will automatically use
%    the \option{pdflatex} driver. You can also force \CROP\ not to use any
%    of the drivers by requesting the \option{nodriver} option.
%    \option{pdflatex} is a synonym for \option{pdftex}.
%
% \item[\itemfont mirror]
%    This option reflects the whole document, provided that the selected output
%    driver supports the \package{graphics} package's |\reflectbox| command.
%    It doesn't have any effect on the \DVI\ file.
%
% \item[\itemfont rotate]
%    Rotates the document by 180\(^\circ\) so that it appears upside-down.
%    This may be useful to circumvent problems with printers, which do not print
%    close enough to the lower paper edge due to their paper feed mechanism.
%
% \item[\itemfont invert]
%    Lets the whole document be printed white onto black background,
%    if the \package{color} package can be loaded and the document is output with a
%    color aware device. All further color changing commands stated in the document
%    are disabled. This option doesn't invert pictures, nor does it really swap
%    text and paper color. Red text on green will still become white
%    text on black. \option{invert} is stronger than \option{notext}.
%
% \item[\itemfont notext]---
%    This option uses the \package{color} package to turn text to white
%    color, after which all further color switching commands are disabled. This
%    makes the text disappear from the printout, although it remains in the
%    output file. See the description of the options \option{nographics} and
%    \option{graphics} on page~\pageref{graphics} for an explanation.
%    This option is ignored if option \option{invert} was also requested.
% \end{labeling}
%
%
%
%
%
%
%
% \subsection{Runtime options}
%
% These options may be used in the preamble like the `conventional' options
% (see section~\ref{sec:conventional}), but also as optional arguments to the
% |\crop| command everywhere in the document (as in |\crop[frame]|). Using
% this command without options implies |\crop[cam,noaxes]|.
%
% \begin{labeling}{\indent\indent}
% \item[\itemfont cam]
%    This mode provides four different marks (see figure \ref{fig:marks}),
%    one for each corner. They indicate the logical paper edges without
%    touching them and can thus be printed on every page. These
%    marks are mainly thought for camera alignment. The |\crop| command
%    selects this mode if no other mode is requested.
%
% \item[\itemfont cross]
%    This mode provides four 4~cm wide crosses (see figure
%    \ref{fig:marks}), one at each corner, that touch the logical paper
%    edge. That's why they should be printed on an extra page
%    that will be used as a cover page while trimming the whole paper stack.
%    (This is also the \emph{Red Cross} mode ;-)
%
% \item[\itemfont frame]
%    This mode draws a frame around the logical page and is mainly thought
%    for visualizing the document page dimensions.
%
% \item[\itemfont off]
%    This `option' makes only sense in connection with the |\crop| command
%    (i.\,e.~at runtime). It disables all markings and is selected by
%    default if the package is input without requesting any of the marks.
%
% \item[\itemfont odd, even]---
%    Use these options to let the crop marks be put on odd\slash even pages only.
%    They automatically turn on \option{cam} marks if no other marks have been
%    requested. Note that only the page number is considered. If you have
%    two subsequent pages both with page number~1, and ask for the \option{odd}
%    option, then both pages will have marks.
%
% \item[\itemfont axes, noaxes]---
%    These options enable\slash disable the output of little marks that
%    indicate the logical page's horizontal and vertical middle axis and
%    may be selected in addition to one of the main modes. These marks
%    might be needed for punching. Note that they are lost after
%    trimming, since they lie outside the logical page.
%    These marks are disabled by default.
%
% \item[\itemfont info, noinfo]---
%    Print the page information consisting of filename, date, time, page number and page
%    index on every sheet (see figure~\ref{fig:marks}). The page index starts
%    with \#1 and is incremented with every page info line, hence being more
%    reliable than page numbers, which are not unique and may be negative or
%    contain letters. It can also be seen as a crop marks counter.
%    Pages without crop marks aren't counted. This page information is enabled
%    by default.
%
% \item[\itemfont font]
%    The page info line uses |\normalfont| by default. If you are typesetting
%    the document in non-latin glyphs or a decorative, but less legible font,
%    you may want to request a specific font for that info. Just assign
%    a font switching command like |\textsf| to the \option{font} option
%    parameter, leaving the initial backslash away: |[font=textsf]|. This
%    command may take one argument (like |\textsf{}|) or stand alone (like |\small|).
%    You can, of course, define a more complex command first, and assign that
%    one: |\newcommand*\infofont[1]{\textcolor{blue}{\textsf{\small#1}}}|
%    |\crop[font=infofont]|
%
% \item[\itemfont color]
%    You can set the color of crop marks, axes and info text with this
%    option, if the \package{color} package could be loaded.
%    The option takes only color names, as in |[color=red]|. See
%    the \package{color} package documentation for how to define custom colors.
%
% \item[\itemfont mount1, mount2]---
%    If more than one logical page is to be mounted on a physical sheet,
%    you normally don't want marks to appear on the inner edges, where
%    the pages touch each other.
%    The \option{mount2} option prints only the outer marks.
%    There's also a \option{mount1} option that is selected by default.
%    These commands take a number as an optional argument serving
%    as page offset. Type |mount2| or |mount2=0| for odd pages right
%    and |mount2=1| for odd pages left. Since further modes are likely
%    to be document, driver, and printer dependent, it is up to you to
%    implement them yourself. (See a \option{mount4} suggestion on page
%    \pageref{sec:mount4}.)
%
% \item[\itemfont horigin, vorigin]---
%    The top and left margin are by default 1~inch wide. This can be changed
%    using the dimensions |\oddsidemargin|, |\evensidemargin| and
%    |\topmargin|. It's more convenient, though, to let the |geometry| package
%    define all these and further parameters. The options \option{horigin} and \option{vorigin} only
%    move the marks and don't change the page contents. \emph{Using these options is almost
%    always a mistake, so use them only as a last resort!} Both options take a
%    (mandatory) dimension. These dimensions describe the way from the reference point---the
%    upper left corner of the text block---to the upper left corner of the page in
%    a Cartesian coordinate system.
%    As both |horigin| and |vorigin| are by default $-1$~inch, you would for
%    example write |horigin=-.6in| to move the marks by 0.4~inch to the right.
%
% \item[\itemfont graphics, nographics]---
%    \label{graphics}
%    Color printouts are often more expensive than black-and-white ones, while
%    their text quality is sometimes reduced. Therefore it may be desirable to create
%    two versions of a document, one with only text and one with only
%    graphics. Now you can feed the concerned pages to a color printer to
%    print the \option{notext} version, and then to a mono laser printer with the
%    \option{nographics} version. The \option{graphics} option turns graphics on again. You may
%    want to mark up all colored pictures so that you can decide in the preamble,
%    whether they shall be printed or not.
%
% \begin{example}[.86\textwidth]^^A
% |%\newcommand*\colorgraphic{}                 % print them;|\\
% |\newcommand*\colorgraphic{\crop[nographics]} % don't!|\\
% |...|\\
% |{\colorgraphic|\\
% |\includegraphics{...}|\\
% |\caption{...}|\\
% |}|
% \end{example}
% \end{labeling}
%
%
%
% {\makeatletter
% \ifx\CROPSTYfound\active
% \begin{figure}
%   \begin{quote}
%     \begin{center}
%       \vspace{1.5cm}
%       \leavevmode
%       \hbox to9cm{\CROP@@ulc\hss\CROP@@info\hss\CROP@@urc}
%       \vspace{.5cm}
%       \caption{That's what you see on top of a 9~cm wide document page when
%           \option{cam} mode is requested: the marks, jobname, date, time, page number and
%           crop marks index.}
%       \label{fig:marks}
%    \end{center}
%   \end{quote}
% \end{figure}
% \fi}
%
%
% \subsection{Loading}
%
% Since all marks lie outside the logical page, the horizontal and vertical
% offset should be set properly. Otherwise the marks are likely to be cut
% off by the \DVI\ driver or the printer.
% Provided that you have declared the size of your printing paper, you can
% use the |center| option to center every logical page on the respective sheet.
% There's, however, no harm in centering an \A~page on
% \A~paper, in which case both offsets are set to 0\,pt (unless, of course,
% you have set $\hbox{\verb"\mag"}\ne1000$).
%
% ^^A\begin{figure}
% \qquad\hbox{
% \begin{minipage}[t]{.45\textwidth}
%\begin{verbatim}
%\documentclass[a5paper]{article}
%\usepackage[cam,a4,center]{crop}
%\begin{document}
%...
%\end{document}
%\end{verbatim}
% \end{minipage}
%
% \begin{minipage}[t]{.45\textwidth}
%\begin{verbatim}
%\documentclass[a5paper]{article}
%\usepackage[a4,center]{crop}
%\begin{document}
%...
%\crop  % or: \crop[cross], etc.
%...
%\end{document}
%\end{verbatim}
% \end{minipage}
% }\hspace*{-1cm}
% ^^A\caption{Loading the package. The marks can be activated in the preamble
% ^^A         and anywhere in the document.}
% ^^A\label{fig:loading}
% ^^A\end{figure}
% \bigskip^^A\FIXME
%
% \noindent
% You get corner markings at every page shipped out after a \option{cam},
% \option{cross}, or \option{frame} mode request until you turn them off by
% typing \DescribeMacro{\crop}|\crop[off]|, or the actual grouping level
% ends.
% ^^ASee figure \ref{fig:loading}.
% Typing |\crop| without argument is equivalent to typing
% |\crop[cam,noaxes]|.
% Axis marks appear only together with one of the modes as listed above.
% If you only want one cover page for trimming, make sure that a page is
% actually output in the scope of |\crop|, for example:
%
% \begin{example}
% |\newpage|\\
% |{\crop[cross,axes]\mbox{}\newpage}|\\
% {}
% \end{example}
%
%
%
%
%
% \subsection{Color support}
%
% The \CROP\ package always tries to load the \package{color} package.
% You can change the color of the physical page as usual by using the
% |\pagecolor| command in the preamble. But after that, within the |document|
% environment, |\pagecolor| is redefined to only color the logical
% page. The color of crop marks, axes marks and page info can independently
% be set via the \option{color} option. The options \option{invert} and
% \option{notext} override any color settings.
%
%
%
%
%
%
% \subsection{Custom document page size}
% \label{sec:custom-logical}
%
% The \CROP\ package respects any page layout that you specify by means of
% \LaTeX\ dimensions. The following example uses the |geometry| package,
% which I strongly recommend. Let's assume you want to print a
% \CD~booklet ($4\,^{23}\!/_{32} \times 4\,^3\!/_4$~inch) on \ISO\ paper:
%
% \begin{example}
% |\documentclass{article}|\\
% |\usepackage[dvips=false,pdftex=false,vtex=false]{geometry}|
% \end{example}
%
% \indent
% \begin{example}
% |\geometry{|\\
% |   paperwidth=4.71875in,|\\
% |   paperheight=4.75in,|\\
% |   margin=2em,|\\
% |   bottom=1.5em,|\\
% |   nohead|\\
% |}|
% \end{example}
%
% \indent
% \begin{example}
% |\usepackage[cam,a4,center,dvips]{crop}|\\
% \end{example}
%
% \indent
% \begin{example}
% |\begin{document}|\\
% |...|\\
% |\end{document}|
% \end{example}
%
% Note that the \CROP\ package should always be requested after setting
% up the `geometry'. See the \package{geometry} documentation for details.
% Always disable all of \package{geometry}'s driver options. While this isn't
% necessary in every case, it doesn't hurt and it makes your document more portable.
% You never know how the local |geometry.cfg| file on other workstations looks
% like!
%
%
%
%
%
% \subsection{Custom printing paper sheet size}
%
% If you want to use one of the \option{center}, \option{dvips}, \option{pdftex} or \option{vtex}
% options together with non-standard printing paper, you can set it
% via the \option{width} and \option{height} option, or simply add
% the respective paper definition to your |crop.cfg| file (see \ref{sec:config}).
% Let's for example define a new \option{weird} paper format, whereby the first dimension
% shall describe the paper width. Don't forget to request |true| dimensions,
% otherwise you will get really weird results with scaled documents.
%
% \begin{example}
% |\DeclareOption{weird}{\CROP@size{12truecm}{34truecm}}|
% \end{example}
%
% Now you can use your new printing paper format like the pre-defined ones.
%
% \begin{example}
% |\usepackage[frame,weird,center]{crop}|\\
% \end{example}
%
% If you don't need that format regularly or don't want to depend on a
% |crop.cfg| file, then you might prefer to declare the dimensions in the document:
%
% \begin{example}
% |\usepackage[frame,width=12truecm,height=34truecm,center]{crop}|\hspace*{-3cm}\\
% \end{example}
% \null
%
%
%
%
%
% \subsection{Defining your own marks}
% \label{sec:cropdef}
%
% If you need a \option{funny} mode, you can easily define it with
% only a couple of macros. The \DescribeMacro{\cropdef}|\cropdef| command
% defines the mode switch.
% It takes as arguments: the name of a macro providing the page info
% (optional; enclosed in brackets), four macro names to be assigned to
% the upper left, the upper right, the lower left, and the lower right
% corner, each representing a |picture| with zero width and height, or
% |\relax|, and finally the mode name. The optional brackets may also
% be empty, if no page info is wanted, or contain the info code instead of
% a macro name.
%
% \begin{example}
% |\newcommand*\funnymarkA{%         % a little x|\\
% |  \begin{picture}(0,0)|\\
% |    \thinlines\unitlength1pt|\\
% |    \put(-5,-5){\line(1,1){10}}|\\
% |    \put(-5,5){\line(1,-1){10}}|\\
% |  \end{picture}}|
% \end{example}
%
% \indent
% \begin{example}
% |\newcommand*\funnymarkB{%         % a bullet|\\
% |  \begin{picture}(0,0)|\\
% |    \unitlength1pt|\\
% |    \put(0,0){\circle*{5}}|\\
% |  \end{picture}}|\\
% \end{example}
%
% \indent
% \begin{example}[.91\textwidth]
% |\newcommand*\funnyinfo{funny page info}|\\
% |\cropdef[\funnyinfo]\relax\funnymarkA\relax\funnymarkB{funny}|
% \end{example}
%
%
% Now you can select your new mode by typing |\crop[funny]|.
%
% Each of the axis marks is a |picture| that you can easily replace
% by some custom definition. There's no setup command like |\cropdef|, though.
% The kernel provides two `hooks' that can be used to add local
% extensions. These are macros that default to |\relax|. The first, |\CROP@user@a|,
% is executed at every page, no matter if marks are shown or not, while the
% second, |\CROP@user@b| is only executed at pages that contain crop marks.
% Local definitions and modifications are ideally put into a local configuration
% file:
%
%
% \subsection{The configuration file}
% \label{sec:config}
%
% If you want to change the predefined settings or add new features,
% then create a file named `|crop.cfg|' and put it in a directory, where \TeX\
% can find it. This configuration file will then be loaded
% at the end of the |crop.sty| file, so you can redefine
% any settings or commands therein, select package options and even
% introduce new ones. But if you intend to give
% your documents to others, don't forget to give them the
% required configuration files, too! That's how such a file
% could look like:
%
% \begin{example}
% |% define a new printing paper size|\\
% |\DeclareOption{special}{\CROP@size{22truecm}{37truecm}}|
% \end{example}
%
% \indent
% \begin{example}
% |% make the internal time string (used in the page|\\
% |% information) accessible in the whole document|\\
% |\let\Time\CROP@time|
% \end{example}
%
% \indent
% \begin{example}
% |% let's use a different font for the predefined page|\\
% |% information (we could also have written|\\
% |% \newcommand*\CROP@font[1]{\textsf{#1}})|\\
% |\crop[font=textsf]|\\
% |\endinput|\\
% {}
% \end{example}
%
%
%
% \section{How the package works}
%
% \subsection{The kernel mechanism}
%
% \TeX\ outputs a page via the |\shipout| command. The \CROP\ package
% redefines |\shipout| to insert the requested marks before it outputs
% the page contents. It is carefully designed to coexist peacefully with
% other packages, which use the same method (like the \package{everyshi} package
% by \person{Martin Schr\"oder,} from whom I have in fact borrowed some ideas).
%
% In addition to the crop marks every page gets an info line containing the
% jobname, the current date and time, the page number and an index number
% printed on top. This line can be turned off (\option{noinfo}) and on (\option{info})
% anywhere in the document.
%
%
%
%
% \subsection{Dependencies}
%
% \subsubsection{\package{latex.ltx}}
%
% The package works with all \LaTeXe\ standard classes (tested with
% \LaTeXe\ 1997/12/01 and sporadically with later versions), it does
% not work with plain \TeX.
%
% The \CROP\ package uses (and relies on) the internal \LaTeX\ tokens
% |\hb@xt@|, |\filename@parse|, |\@classoptionslist|,
% |\@ifundefined|, |\@height|, |\@depth|, |\filename@base|
% |\@width|, |\z@|, |\@ne|, |\z@skip|, |\p@|,
% |\c@page|, |\@namedef|, |\@nameuse|, |\strip@pt|, |\two@digits|,
% |\count@|, |\dimen@|, |\@for|, |\@empty|, |\@gobble| and |\@undefined|,
% % all of which are expected to keep their current meaning in future
% \LaTeXe\ releases. The \CROP\ package will, however, be supported
% at least for some years, so you needn't worry about it.
%
%
% \subsubsection{\package{color.sty}}
%
% \CROP's color handling depends on the \package{color} package.
% The following internal macros are used directly:
% |\@declaredcolor|, |\current@color|, |\set@color|, |\set@page@color|
% (Tested with |color.sty|, version~1.0i as of 1999/02/16.)
%
%
%
% \subsubsection{\package{graphics.sty}}
%
% \CROP's driver detection, as well as the options \option{rotate}
% \option{mirror}, and \option{nographics} depend on the
% \package{graphics} package. The following internal macros are used directly:
% |\Gin@PS@raw|, |\Ginclude@graphics|, |\Gin@driver|
% (Tested with |graphics.sty|, version~1.0l as of 1999/02/16.)
%
%
%
% \StopEventually{\addtocontents{toc}{\protect\end{multicols}}}
%
%
%
%
%
%
%
%
%^^A max 72 columns
%^^A--------------------------------------------------------------------
%
%
%
%
% \section{The implementation}
%
% \subsection{Preamble}
%
% \begin{macro}{\stockwidth}
% \begin{macro}{\stockheight}
% \begin{macro}{\CROP@index}
% \begin{macro}{\CROP@font}
% Make sure that |\stockwidth| and |\stockheight| are |\dimen|
% registers that hold the physical paper size. They are initially set
% to the paper size, but will be changed by the size options.
% These registers are also used\slash provided by the \package{memoir}
% class and the \package{hyperref} package.
% The |\CROP@font| macro is by default empty and can be changed
% through the \option{font} option.
%
%    \begin{macrocode}
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{crop}[2003/05/20 v1.9 crop marks  (mf)]
\expandafter\ifx\csname stockwidth\endcsname\relax
    \newdimen\stockwidth
    \stockwidth\paperwidth
\fi
\expandafter\ifx\csname stockheight\endcsname\relax
    \newdimen\stockheight
    \stockheight\paperheight
\fi
\newcount\CROP@index
\CROP@index\z@
\newcommand*\CROP@font{}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@stockcolor}
% \begin{macro}{\CROP@pagecolor}
% \begin{macro}{\CROP@needscolor}
% Try to load the \package{color} package. It is needed for the
% \option{invert} and the \option{notext} option and, of course,
% for the modified |\pagecolor| command. Changing the meaning of
% |\current@color| looks dangerous, but it is only done if the
% \package{color} package couldn't be loaded, anyway.
%
%    \begin{macrocode}
\let\CROP@stockcolor\@empty
\let\CROP@pagecolor\@empty
\IfFileExists{color.sty}{%
    \RequirePackage{color}%
    \let\CROP@needscolor\@empty
}{%
    \newcommand*\CROP@needscolor{%
        \PackageError{crop}{%
            The `invert' and `notext' options require the\MessageBreak
            `color' package, which doesn't seem to be installed%
        }{%
            Install the `color' package or don't use the `invert'
            \MessageBreak or `notext' option.
        }%
        \let\CROP@needscolor\relax
    }%
    \let\current@color\relax
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{The device drivers}
%
% \begin{macro}{\CROP@detdriver}
% \begin{macro}{\CROP@Ginclude@graphics}
% \begin{macro}{\CROP@ps}
% The options \option{graphics} and \option{nographics} depend on the
% \package{graphics} package, which, if configured appropriately, also
% tells us which output device is preferred on the system. Show a
% warning, if the package couldn't be loaded, because we have to use a
% less portable \PS\ `driver' then.
%
%    \begin{macrocode}
\let\CROP@detdriver\@empty
\IfFileExists{graphics.sty}{%
    \RequirePackage{graphics}%
    \let\CROP@Ginclude@graphics\Ginclude@graphics
    \ifx\Gin@driver\@empty\else
        \filename@parse{\Gin@driver}%
        \edef\CROP@detdriver{\filename@base}%
    \fi
    \let\CROP@ps\Gin@PS@raw
}{%
    \PackageWarning{crop}{I couldn't find the `graphics' package, so
        I'll use\MessageBreak my internal PostScript interface%
    }%
    \newcommand*\CROP@ps[1]{\special{ps: ##1}}%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@reqdriver}
% Define options that suggest \dots
%
%    \begin{macrocode}
\let\CROP@reqdriver\@empty
\DeclareOption{vtex}{\def\CROP@reqdriver{vtex}}
\DeclareOption{pdftex}{\def\CROP@reqdriver{pdftex}}
\DeclareOption{pdflatex}{\def\CROP@reqdriver{pdftex}}
\DeclareOption{dvips}{\def\CROP@reqdriver{dvips}}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@driver}
% \dots\ or enforce a graphics driver. Note the exclamation points!
%
%    \begin{macrocode}
\let\CROP@driver\@empty
\DeclareOption{vtex!}{\def\CROP@driver{vtex}}
\DeclareOption{pdftex!}{\def\CROP@driver{pdftex}}
\DeclareOption{pdflatex!}{\def\CROP@driver{pdftex}}
\DeclareOption{dvips!}{\def\CROP@driver{dvips}}
\DeclareOption{nodriver}{\def\CROP@driver{none}}
\DeclareOption{!}{\def\CROP@driver{none}}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@evaldriver}
% If |\CROP@driver| wasn't already set, decide |\AtBeginDocument| which
% graphics driver to use. A detected driver takes precedence over a
% `suggested' one. Show a warning if the user's choice is ignored.
%
%    \begin{macrocode}
\newcommand*\CROP@evaldriver{%
    \ifx\CROP@driver\@empty
        \PackageInfo{crop}{requested driver: `\CROP@reqdriver'}%
        \ifx\pdfoutput\@undefined\else
            \ifx\pdfoutput\relax\else
                \ifcase\pdfoutput\else
                    \def\CROP@detdriver{pdftex}%
                \fi
            \fi
        \fi
        \ifx\VTeXversion\@undefined\else
            \ifx\VTeXversion\relax\else
                \def\CROP@detdriver{vtex}%
            \fi
        \fi
        \PackageInfo{crop}{detected driver: `\CROP@detdriver'}%
        \ifx\CROP@reqdriver\@empty\else
            \ifx\CROP@reqdriver\@empty\else
                \ifx\CROP@reqdriver\CROP@detdriver\else
                    \PackageWarningNoLine{crop}{%
                        You requested the `\CROP@reqdriver' driver
                        but I think that\MessageBreak the
                        `\CROP@detdriver' driver works better in the
                        current\MessageBreak context. You can force
                        me to respect your decision\MessageBreak
                        by adding an exclamation point as in
                        [\CROP@reqdriver!]%
                    }%
                \fi
            \fi
        \fi
        \ifx\CROP@detdriver\@empty
            \let\CROP@driver\CROP@reqdriver
        \else
            \let\CROP@driver\CROP@detdriver
        \fi
    \fi
    \let\CROP@evaldriver\relax
}
\AtBeginDocument{\CROP@evaldriver}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@init@dvips}
% \begin{macro}{\CROP@init@pdftex}
% \begin{macro}{\CROP@init@vtex}
% \begin{macro}{\CROP@init@none}
% These macros prepare the \CROP\ package for one of the supported
% graphics drivers. They don't do anything spectacular, they just
% select the proper \option{rotate} and \option{mirror} macro and
% hand the physical paper size over to the driver program.
%
%    \begin{macrocode}
\newcommand*\CROP@init@dvips{%
    \PackageInfo{crop}{using `dvips' graphics driver}%
    \AtBeginDvi{%
        \special{papersize=\the\stockwidth,\the\stockheight}%
    }%
}
\newcommand*\CROP@init@pdftex{%
    \PackageInfo{crop}{using `pdftex' graphics driver}%
    \pdfpagewidth\stockwidth
    \pdfpageheight\stockheight
    \let\CROP@reflect\CROP@genreflect
    \let\CROP@rotate\CROP@genrotate
}
\newcommand*\CROP@init@vtex{%
    \PackageInfo{crop}{using `vtex' graphics driver}%
    \mediawidth\stockwidth
    \mediaheight\stockheight
    \let\CROP@reflect\CROP@genreflect
    \let\CROP@rotate\CROP@genrotate
}
\newcommand*\CROP@init@none{%
    \PackageInfo{crop}{not using any graphics driver}%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{Size options}
%
% \begin{macro}{\CROP@size}
% \begin{macro}{\CROP@opt@width}
% \begin{macro}{\CROP@opt@height}
% These options set different standard printing paper sizes, which
% are needed for centering and as a hint for the \program{dvips},
% \program{pdftex} or \program{vtex} program. Since the physical paper
% dimensions must not underlie a possible scaling, |true| dimensions
% are used. The \option{landscape} option exchanges the |\hoffset| and
% |\voffset| values.
%
%    \begin{macrocode}
\newcommand*\CROP@size[2]{\stockwidth#1 \stockheight#2 }
\DeclareOption{landscape}{%
    \def\CROP@size#1#2{\stockheight#1 \stockwidth#2 }%
}
\DeclareOption{a0}{\CROP@size{841truemm}{1189truemm}}
\DeclareOption{a1}{\CROP@size{595truemm}{841truemm}}
\DeclareOption{a2}{\CROP@size{420truemm}{595truemm}}
\DeclareOption{a3}{\CROP@size{297truemm}{420truemm}}
\DeclareOption{a4}{\CROP@size{210truemm}{297truemm}}
\DeclareOption{a5}{\CROP@size{149truemm}{210truemm}}
\DeclareOption{a6}{\CROP@size{105truemm}{149truemm}}
\DeclareOption{b0}{\CROP@size{1000truemm}{1414truemm}}
\DeclareOption{b1}{\CROP@size{707truemm}{1000truemm}}
\DeclareOption{b2}{\CROP@size{500truemm}{707truemm}}
\DeclareOption{b3}{\CROP@size{353truemm}{500truemm}}
\DeclareOption{b4}{\CROP@size{250truemm}{353truemm}}
\DeclareOption{b5}{\CROP@size{176truemm}{250truemm}}
\DeclareOption{b6}{\CROP@size{125truemm}{176truemm}}
\DeclareOption{letter}{\CROP@size{8.5truein}{11truein}}
\DeclareOption{legal}{\CROP@size{8.5truein}{14truein}}
\DeclareOption{executive}{\CROP@size{7.25truein}{10.5truein}}
\newcommand\CROP@opt@width{\stockwidth\CROP@@}
\newcommand\CROP@opt@height{\stockheight\CROP@@}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@center}
% The \option{center} option sets |\voffset| and |\hoffset| so that the
% document pages are centered on the printing paper sheets.
%
%    \begin{macrocode}
\DeclareOption{center}{\AtBeginDocument{\CROP@center}}
\newcommand*\CROP@center{%
    \voffset\stockheight
    \advance\voffset-\paperheight
    \voffset.5\voffset
    \hoffset\stockwidth
    \advance\hoffset-\paperwidth
    \hoffset.5\hoffset
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{Runtime options handling}
%
% Pass every unknown option to the macro |\CROP@execopt|.
%
%    \begin{macrocode}
\DeclareOption*{\CROP@execopt\CurrentOption}
%    \end{macrocode}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\crop}
% The |\crop| macro allows options to be used both in the preamble and
% throughout the document. Every argument of the optional argument list
% is passed to the macro |\CROP@execopt|. The options \option{cam} and
% \option{noaxes} are selected by default.
%
%    \begin{macrocode}
\newcommand*\crop[1][cam,noaxes]{%
    \@for\CROP@@:=#1\do{\CROP@execopt\CROP@@}%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@execopt}
% Every execution of this macro with an argument $n$ leads to the
% execution of a macro |\CROP@opt@|$n$ or a warning if no such exists.
% Optional arguments (separated by an equal sign) are cut off and
% stored in |\CROP@@|.
% The macro tolerates even arguments for options that are not prepared
% to handle arguments (e.\,g.~|cross=garbage|), or more than one
% argument (e.\,g.~|mount2=1=garbage|). This makes the design simpler
% and doesn't hurt.
%
%    \begin{macrocode}
\newcommand*\CROP@execopt[1]{%
    \def\CROP@##1=##2=##3\@nil{\def\CROP@{##1}\def\CROP@@{##2}}%
    \expandafter\CROP@#1==\@nil%
    \@ifundefined{CROP@opt@\CROP@}{%
        \PackageError{crop}{%
            Requested option `#1' not provided%
        }{%
            Note that the `*center' options are obsolete. You have to
            request\MessageBreak e.g. [a4,center] instead of
            [a4center].
        }%
    }{%
        \@nameuse{CROP@opt@\CROP@}%
    }%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\cropdef}
% The |\cropdef| macro defines a mode switch (see section
% \ref{sec:cropdef}). It supports only corner marks and the page info,
% but not the axis marks, mainly for hysterical raisins.
%
%    \begin{macrocode}
\newcommand*\cropdef[6][\CROP@@info]{%
    \@namedef{CROP@opt@#6}{%
        \def\CROP@info{#1}%
        \let\CROP@ulc#2
        \let\CROP@urc#3
        \let\CROP@llc#4
        \let\CROP@lrc#5
        \let\CROP@@@marks\CROP@marks
    }%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{Axes and page info}
%
% \begin{macro}{\CROP@@laxis}
% \begin{macro}{\CROP@@raxis}
% \begin{macro}{\CROP@@upaxis}
% \begin{macro}{\CROP@@loaxis}
% The standard definitions for the \option{axes} option.
%
%    \begin{macrocode}
\newcommand*\CROP@@laxis{%
    \begin{picture}(0,0)
        \unitlength\p@\thinlines
        \put(-2,0){\line(-1,0){11}}
    \end{picture}%
}
\newcommand*\CROP@@raxis{%
    \begin{picture}(0,0)
        \unitlength\p@\thinlines
        \put(2,0){\line(1,0){11}}
    \end{picture}%
}
\newcommand*\CROP@@upaxis{%
    \begin{picture}(0,0)
        \unitlength\p@\thinlines
        \put(0,2){\line(0,1){11}}
    \end{picture}%
}
\newcommand*\CROP@@loaxis{%
    \begin{picture}(0,0)
        \unitlength\p@\thinlines
        \put(0,-2){\line(0,-1){11}}
    \end{picture}%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@time}
% \begin{macro}{\CROP@@info}
% \begin{macro}{\CROP@opt@font}
% This macro prints the jobname, the current date and time, the page
% number and an index number at the top of the logical page.
%
%    \begin{macrocode}
\newcommand*\CROP@time{}
\bgroup
    \count@\time
    \divide\time60
    \count\@ne\time
    \multiply\time60
    \advance\count@-\time
    \xdef\CROP@time{\the\count\@ne:\two@digits{\count@}}
\egroup
\newcommand*\CROP@@info{{%
    \global\advance\CROP@index\@ne
    \def\x{\discretionary{}{}{\hbox{\kern.5em---\kern.5em}}}%
    \advance\paperwidth-20\p@
    \dimen@4pt
    \ifx\CROP@pagecolor\@empty
    \else
        \advance\dimen@\CROP@overlap
    \fi
    \hb@xt@\z@{%
        \hss
        \vbox to\z@{%
            \centering
            \hsize\paperwidth
            \vss
            \normalfont
            \normalsize
            \expandafter\csname\CROP@font\endcsname{%
                ``\jobname''\x
                \the\year/\the\month/\the\day\x
                \CROP@time\x
                page\kern.5em\thepage\x
                \#\the\CROP@index
                \strut
            }%
            \vskip\dimen@
        }%
        \hss
    }%
}}
\newcommand*\CROP@opt@font{\let\CROP@font\CROP@@}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{The marks}
%
% The following four macros provide different marks for the
% \option{cam} mode. They do not touch the logical page and can, thus,
% be printed on every single sheet.
%
% \begin{macro}{\CROP@@ulc}
% The \option{cam} mode corner mark for the upper left corner.
%
%    \begin{macrocode}
\newcommand*\CROP@@ulc{%
    \begin{picture}(0,0)
        \unitlength\p@\thinlines
        \put(-30,0){\circle{10}}
        \put(-30,-5){\line(0,1){10}}
        \put(-35,0){\line(1,0){30}}
        \put(0,30){\circle{10}}
        \put(-5,30){\line(1,0){10}}
        \put(0,35){\line(0,-1){30}}
    \end{picture}%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@@urc}
% The \option{cam} mode corner mark for the upper right corner.
%
%    \begin{macrocode}
\newcommand*\CROP@@urc{%
    \begin{picture}(0,0)
        \unitlength\p@\thinlines
        \put(30,0){\circle{10}}
        \put(30,-5){\line(0,1){10}}
        \put(35,0){\line(-1,0){30}}
        \put(0,30){\circle{10}}
        \put(-5,30){\line(1,0){10}}
        \put(0,35){\line(0,-1){30}}
    \end{picture}%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@@llc}
% The \option{cam} mode corner mark for the lower left corner.
%
%    \begin{macrocode}
\newcommand*\CROP@@llc{%
    \begin{picture}(0,0)
        \unitlength\p@\thinlines
        \put(-30,0){\circle{10}}
        \put(-30,-5){\line(0,1){10}}
        \put(-35,0){\line(1,0){30}}
        \put(0,-30){\circle{10}}
        \put(-5,-30){\line(1,0){10}}
        \put(0,-35){\line(0,1){30}}
    \end{picture}%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@@lrc}
% The \option{cam} mode corner mark for the lower right corner.
%
%    \begin{macrocode}
\newcommand*\CROP@@lrc{%
    \begin{picture}(0,0)
        \unitlength\p@\thinlines
        \put(30,0){\circle{10}}
        \put(30,-5){\line(0,1){10}}
        \put(35,0){\line(-1,0){30}}
        \put(0,-30){\circle{10}}
        \put(-5,-30){\line(1,0){10}}
        \put(0,-35){\line(0,1){30}}
    \end{picture}%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@opt@cam}
% Define the \option{cam} mode switch with four different marks.
%
%    \begin{macrocode}
\cropdef\CROP@@ulc\CROP@@urc\CROP@@llc\CROP@@lrc{cam}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@@cross}
% This macro provides a 4~cm wide cross.
%
%    \begin{macrocode}
\newcommand*\CROP@@cross{%
    \begin{picture}(0,0)
        \unitlength1cm\thinlines
        \put(-2,0){\line(1,0){4}}
        \put(0,-2){\line(0,1){4}}
    \end{picture}%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@opt@cross}
% Define the \option{cross} mode switch with four times the same mark.
%
%    \begin{macrocode}
\cropdef\CROP@@cross\CROP@@cross\CROP@@cross\CROP@@cross{cross}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@@frame}
% The \option{frame} mode draws a simple frame around the logical
% page. The frame mark is designed to be used in the upper left
% corner. Since graphics commands expect numbers without dimensions,
% |\paperwidth| and \hbox{-|height|} are transformed to numbers
% (representing printer's points). This is done by stripping off the
% unit~|pt|.
%
%    \begin{macrocode}
\newcommand*\CROP@@frame{%
    \begin{picture}(0,0)
        \unitlength\p@\thinlines
        \put(0,0){\line(1,0){\strip@pt\paperwidth}}
        \put(0,0){\line(0,-1){\strip@pt\paperheight}}
        \put(\strip@pt\paperwidth,0){\line(0,-1){\strip@pt\paperheight}}
        \put(0,-\strip@pt\paperheight){\line(1,0){\strip@pt\paperwidth}}
    \end{picture}%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@opt@frame}
% Define the \option{frame} mode switch with only one mark. The other
% corners may |\relax|.
%
%    \begin{macrocode}
\cropdef\CROP@@frame\relax\relax\relax{frame}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{The kernel}
%
% \begin{macro}{\CROP@shipout}
% \begin{macro}{\shipout}
% \begin{macro}{\CROP@ship}
% \begin{macro}{\CROP@shiplist}
% \begin{macro}{\CROP@@ship}
%
% These macros redefine the \TeX\ primitive |\shipout| to insert the
% contents of the macro |\CROP@shiplist| on top of the box which contains
% the page contents ready for output, after which the original
% |\shipout| command is executed.
%
%    \begin{macrocode}
\let\CROP@shipout\shipout
\renewcommand*\shipout{%
    \afterassignment\CROP@ship
    \setbox\@cclv=%
}
\newcommand*\CROP@ship{%
    \ifvoid\@cclv
        \expandafter\aftergroup
    \fi
    \CROP@@ship
}
\newcommand*\CROP@shiplist{%
    \lineskip\z@
    \lineskiplimit\z@
    \baselineskip\z@
    \CROP@kernel
    \box\@cclv
}
\newcommand*\CROP@@ship{%
    \CROP@shipout\vbox{\CROP@shiplist}%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@shipadd}
% This macro adds a page manipulation command to the \emph{shiplist},
% which gets every ready page as argument.
%
%    \begin{macrocode}
\newcommand*\CROP@shipadd[1]{%
    \bgroup
        \toks@\expandafter{\expandafter#1\expandafter{\CROP@shiplist}}%
        \xdef\CROP@shiplist{\the\toks@}%
    \egroup
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@kernel}
% \begin{macro}{\CROP@marks}
% \begin{macro}{\CROP@@@marks}
% \begin{macro}{\CROP@setmarkcolor}
% \begin{macro}{\CROP@user@a}
% \begin{macro}{\CROP@user@b}
% \begin{macro}{\CROP@opt@horigin}
% \begin{macro}{\CROP@opt@vorigin}
% |\CROP@kernel| essentially contains a |\vbox| with zero width and
% height. The |\CROP@hook| command---which normally equals
% |\relax|---allows to insert commands that modify the behavior of the
% selected mode (see the options \option{mount1} and \option{mount2}).
% |\CROP@user@a| and |\CROP@user@b| are user definable hooks.
%
%    \begin{macrocode}
\newcommand*\CROP@kernel{%
    \vbox to\z@{%
        \vskip\CROP@vorigin
        \hb@xt@\z@{%
            \hskip\CROP@horigin
            \vbox to\paperheight{%
                \let\protect\relax
                \hsize\paperwidth
                \CROP@hook
                \CROP@user@a
                \CROP@drawstockcolor
                \CROP@drawpagecolor
                \CROP@@@marks
            }%
            \hss
        }%
        \vss
    }%
}
\newcommand*\CROP@marks{%
    \CROP@setmarkcolor
    \CROP@user@b
    \CROP@ulc\null\hfill\CROP@@@info\CROP@upedge\hfill\null\CROP@urc
    \vfill
    \CROP@ledge\hfill\CROP@redge
    \vfill
    \CROP@llc\null\hfill\CROP@loedge\hfill\null\CROP@lrc
}
\let\CROP@@@marks\CROP@marks
\newcommand*\CROP@setmarkcolor{%
    \let\current@color\CROP@markcolor
    \set@color
}
\let\CROP@user@a\relax
\let\CROP@user@b\relax
\newcommand*\CROP@opt@horigin{\let\CROP@horigin\CROP@@}
\newcommand*\CROP@opt@vorigin{\let\CROP@vorigin\CROP@@}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@opt@off}
% \begin{macro}{\CROP@opt@odd}
% \begin{macro}{\CROP@opt@even}
% These macros start and stop the output of crop marks.
%
%    \begin{macrocode}
\newcommand*\CROP@opt@off{%
    \let\CROP@@@marks\vfil
}
\newcommand*\CROP@opt@odd{%
    \def\CROP@@@marks{\ifodd\c@page\CROP@marks\else\vfil\fi}%
}
\newcommand*\CROP@opt@even{%
    \def\CROP@@@marks{\ifodd\c@page\vfil\else\CROP@marks\fi}%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@@@info}
% \begin{macro}{\CROP@opt@info}
% \begin{macro}{\CROP@opt@noinfo}
% \begin{macro}{\CROP@opt@axes}
% \begin{macro}{\CROP@opt@noaxes}
% Enable and disable the output of axis marks and page info.
%
%    \begin{macrocode}
\newcommand*\CROP@@@info{}
\newcommand*\CROP@opt@info{\def\CROP@@@info{\CROP@info}}
\newcommand*\CROP@opt@noinfo{\let\CROP@@@info\relax}
\newcommand*\CROP@opt@axes{%
    \let\CROP@ledge\CROP@@laxis
    \let\CROP@redge\CROP@@raxis
    \let\CROP@upedge\CROP@@upaxis
    \let\CROP@loedge\CROP@@loaxis
}
\newcommand*\CROP@opt@noaxes{%
    \let\CROP@ledge\relax
    \let\CROP@redge\relax
    \let\CROP@upedge\relax
    \let\CROP@loedge\relax
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{Mounting}
%
% \begin{macro}{\CROP@opt@mount1}
% \begin{macro}{\CROP@opt@mount2}
% Since |\newcommand| doesn't allow macro names to contain non-letters,
% we need a construction with |\csname|, |\endcsname|, and
% |\expandafter|. |\@namedef| would have worked, too, but it would not
% have made a check for redefinitions.
%
%    \begin{macrocode}
\expandafter\newcommand\expandafter*\csname CROP@opt@mount1\endcsname{%
    \let\CROP@hook\relax
}
\newcount\CROP@offset
\expandafter\newcommand\expandafter*\csname CROP@opt@mount2\endcsname{%
    \CROP@offset=\ifx\CROP@@\@empty\z@\else\CROP@@\fi
    \def\CROP@hook{%
        \count@\c@page
        \advance\count@\CROP@offset
        \ifodd\count@
            \let\CROP@ulc\relax
            \let\CROP@llc\relax
            \let\CROP@ledge\relax
        \else
            \let\CROP@urc\relax
            \let\CROP@lrc\relax
            \let\CROP@redge\relax
        \fi
    }%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{Page manipulation}
%
% \begin{macro}{\CROP@reflect}
% \begin{macro}{\CROP@genreflect}
% \begin{macro}{\CROP@rotate}
% \begin{macro}{\CROP@genrotate}
% The \option{mirror} and \option{rotate} options add a macro to the
% \emph{shiplist,} which then gets every output page and embeds it in
% a \POSTSCRIPT\ environment (\option{dvips}) or lets the
% \package{graphics} package reflect or rotate it (\option{pdftex}).
% We could also use the generic operations |\CROP@genreflect| and
% |\CROP@genrotate| for the \option{dvips} mode. They would produce
% correct \PS\ documents, the intermediate \DVI\ document, however,
% would be unreadable.
%
%    \begin{macrocode}
\DeclareOption{mirror}{%
    \AtBeginDocument{\CROP@shipadd\CROP@reflect}
}
\newcommand*\CROP@reflect[1]{%
    \vbox to\z@{%
        \vskip\CROP@vorigin
        \hb@xt@\z@{%
            \hskip\CROP@horigin
            \CROP@ps{gsave currentpoint}%
            \kern\paperwidth
            \CROP@ps{currentpoint}%
            \hss
        }%
        \vss
    }%
    \CROP@ps{translate -1 1 scale neg exch neg exch translate}%
    \vbox{#1}%
    \CROP@ps{grestore}%
}
\newcommand*\CROP@genreflect[1]{%
    \leavevmode
    \dimen0\CROP@horigin
    \kern2\dimen0
    \reflectbox{%
        \hb@xt@\paperwidth{%
            \vbox to\paperheight{%
                #1%
                \vss
            }%
            \hss
        }%
    }%
}
\DeclareOption{rotate}{%
    \AtBeginDocument{\CROP@shipadd\CROP@rotate}
}
\newcommand*\CROP@rotate[1]{%
    \hb@xt@\z@{%
        \hskip\CROP@horigin
        \vbox to\z@{%
            \vskip\CROP@vorigin
            \CROP@ps{gsave currentpoint}%
            \kern\paperheight
            \hb@xt@\z@{%
                \kern\paperwidth
                \CROP@ps{currentpoint}%
                \hss
            }%
            \vss
        }%
        \hss
    }%
    \CROP@ps{translate 180 rotate neg exch neg exch translate}%
    \vbox{#1}%
    \CROP@ps{grestore}%
}
\newcommand*\CROP@genrotate[1]{%
    \dimen0\CROP@vorigin
    \kern2\dimen0
    \leavevmode
    \dimen0\CROP@horigin
    \kern2\dimen0
    \rotatebox{180}{%
        \hb@xt@\paperwidth{%
            \vbox to\paperheight{%
                #1%
                \vss
            }%
            \hss
        }%
    }%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{Color handling}
%
% \begin{macro}{\CROP@stockcolor}
% \begin{macro}{\CROP@pagecolor}
% \begin{macro}{\set@page@color}
% \begin{macro}{\CROP@needscolor}
% \begin{macro}{\CROP@defmarkcolor}
% \begin{macro}{\CROP@opt@color}
% \begin{macro}{\CROP@drawstockcolor}
% \begin{macro}{\CROP@drawpagecolor}
% \begin{macro}{\CROP@overlap}
% \begin{macro}{\CROP@opt@overlap}
% These macros care for the color of crop marks and of the logical and
% the physical page. The \option{overlap} value is the amount that
% the logical page is drawn over the page boundaries on each side.
% This is necessary to get good results on imprecise cutting machines.
%
%    \begin{macrocode}
\newcommand*\CROP@defmarkcolor[1]{{%
    \def\set@color{\global\let\CROP@markcolor\current@color}%
    \@declaredcolor{#1}%
}}
\ifx\CROP@needscolor\@empty
    \renewcommand*\set@page@color{%
        \global\let\CROP@stockcolor\current@color
    }%
    \AtBeginDocument{%
        \def\set@page@color{%
            \global\let\CROP@pagecolor\current@color
        }%
    }%
    \CROP@defmarkcolor{black}%
    \let\CROP@needscolor\relax
\fi
\newcommand*\CROP@opt@color{%
    \CROP@needscolor
    \expandafter\CROP@defmarkcolor\expandafter{\CROP@@}%
}
\newcommand*\CROP@drawstockcolor{%
    \ifx\CROP@stockcolor\@empty
    \else
        \rlap{%
            \smash{%
                \raise\voffset\hbox{%
                    \let\current@color\CROP@stockcolor
                    \set@color
                    \hskip-\hoffset
                    \vrule width\stockwidth height\z@ depth\stockheight
                }%
            }%
        }%
    \fi
}
\newcommand*\CROP@drawpagecolor{%
    \ifx\CROP@pagecolor\@empty
    \else
        \rlap{%
            \smash{%
                \dimen@\CROP@overlap
                \advance\paperwidth2\dimen@
                \advance\paperheight2\dimen@
                \raise\dimen@\hbox{%
                    \let\current@color\CROP@pagecolor
                    \set@color
                    \hskip-\dimen@
                    \vrule width\paperwidth height\z@ depth\paperheight
                }%
            }%
        }%
    \fi
}
\def\CROP@overlap{3truemm}
\newcommand*\CROP@opt@overlap{\let\CROP@overlap\CROP@@}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \begin{macro}{\CROP@invert}
% The \option{invert} option simply switches to black background
% and white text, after which it disables all color
% switching commands. The \option{notext} option does the same
% with white text on white background. The |\@gobble| on the last
% line keeps \option{notext} from switching to white background
% and breaking a prior \option{invert}.
%
%    \begin{macrocode}
\newcommand*\CROP@invert[1]{%
    \CROP@needscolor
    \AtBeginDvi{%
        \pagecolor{#1}%
        \global\let\set@page@color\relax
        \global\let\CROP@setpagecolor\relax
    }%
    \color{white}%
    \DeclareRobustCommand*\color[2][]{}%
    \let\pagecolor\color
    \let\textcolor\color
    \let\CROP@invert\@gobble
}
\DeclareOption{invert}{%
    \CROP@invert{black}%
    \let\CROP@setmarkcolor\relax
}
\DeclareOption{notext}{%
    \CROP@invert{white}%
}
%    \end{macrocode}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{The graphics commands}
%
% \begin{macro}{\CROP@opt@nographics}
% \begin{macro}{\CROP@opt@graphics}
% The \option{nographics} option redefines the |\Ginclude@graphics|
% command from the \package{graphics} package, so that it outputs its
% argument as a phantom. This makes the image invisible but takes up
% the same amount of white space. The \option{graphics} option
% re-enables graphics.
%
%    \begin{macrocode}
\newcommand*\CROP@opt@nographics{%
    \def\Ginclude@graphics##1{%
        \phantom{%
            \CROP@Ginclude@graphics{##1}%
        }%
    }%
}%
\newcommand*\CROP@opt@graphics{%
    \let\Ginclude@graphics\CROP@Ginclude@graphics
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{Final settings}
%
% \begin{macro}{\CROP@horigin}
% \begin{macro}{\CROP@vorigin}
% Switch off marks and axes, set one page per sheet,
% load the local configuration file, and
% process the requested options. Finally: Exit.
%
% Notice that we cannot simply use |\ExecuteOptions| to preselect
% options \option{off}, \option{noaxes}, \option{info}, and
% \option{mount1}, because it does not accept default options declared
% with |\DeclareOption*|. |\@nameuse| doesn't complain if the command
% sequence is undefined. We let this only be executed |\AtBeginDocument|,
% because there are possibly commands from the \option{center} option
% in the queue that have to be processed first.
%
%    \begin{macrocode}
\newcommand*\CROP@horigin{-1truein}
\newcommand*\CROP@vorigin{-1truein}
\crop[cam,off,noaxes,info,mount1]
\InputIfFileExists{crop.cfg}{%
    \PackageInfo{crop}{Local config file crop.cfg used}
}{}
\ProcessOptions
\AtBeginDocument{\@nameuse{CROP@init@\CROP@driver}}
\endinput
%</package>
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
%
%
%
%^^A--------------------------------------------------------------------
%
%
%
%
% \subsection{A \option{mount4} example}
% \label{sec:mount4}
%
% Since a \option{mount4} mode is likely to be subject to specific local
% needs, there's only a suggestion provided, which supports a page
% arrangement as shown in figure \ref{fig:mount4}.
%
% \begin{figure}
%   \begin{center}
%     \vspace*{10pt}
%     \makeatletter \catcode`\|=12
%     \sffamily\bfseries
%     \begin{tabular}{|c|c|}
%       \hline
%       \vrule\@height16\p@\@depth8\p@\@width\z@ 2&1\\
%       \hline
%       \vrule\@height16\p@\@depth8\p@\@width\z@ 0&3\\
%       \hline
%     \end{tabular}
%     \vspace*{-10pt}
%   \end{center}
%   \caption{Possible \option{mount4} arrangement}
%   \label{fig:mount4}
% \end{figure}
%
%
% First of all |\CROP@offset| is set to the value of the (optional)
% argument or zero.
% Then |\CROP@hook| is defined first to set |\count@| to the page number
% increased by this offset: $p=\mbox{pagenumber}+\mbox{offset}$.
% \medbreak
%
% {\def\MacroFont{\small\ttfamily\itshape}%
%\begin{verbatim}
%\expandafter\newcommand\expandafter*\csname CROP@opt@mount4\endcsname{%
%    \CROP@offset=\ifx\CROP@@\@empty\z@\else\CROP@@\fi
%    \def\CROP@hook{%
%        \count@\c@page
%        \advance\count@\CROP@offset
%\end{verbatim}
%
% \noindent
% Now bits~0 and~1 are checked via |\ifodd| to get
% $p$ modulo 4, after which the respective marks are deleted.
% The comments in the example use for simplicity C-notation in which
% `|%|' is the modulo or remainder operator, `|==|' the equal, and
% `{\catcode`\|=12\texttt{||}}' the logical (inclusive) OR operator.
%
%\begin{verbatim}
%        \ifodd\count@                  %% if (p % 4 == 1 || p % 4 == 3)
%            \let\CROP@ulc\relax
%            \let\CROP@llc\relax
%            \let\CROP@ledge\relax
%            \divide\count@2
%            \ifodd\count@              %%    if (p % 4 == 3)
%                \let\CROP@urc\relax
%                \let\CROP@info\relax
%                \let\CROP@upedge\relax
%            \else                      %%    if (p % 4 == 1)
%                \let\CROP@lrc\relax
%                \let\CROP@loedge\relax
%            \fi
%        \else                          %% if (p % 4 == 0 || p % 4 == 2)
%            \let\CROP@urc\relax
%            \let\CROP@lrc\relax
%            \let\CROP@redge\relax
%            \divide\count@2
%            \ifodd\count@              %%    if (p % 4 == 2)
%                \let\CROP@llc\relax
%                \let\CROP@loedge\relax
%            \else                      %%    if (p % 4 == 0)
%                \let\CROP@ulc\relax
%                \let\CROP@info\relax
%                \let\CROP@upedge\relax
%            \fi
%        \fi
%    }%
%}
%\end{verbatim}
% }
%
% ^^A \PrintChanges
% ^^A vim:ts=4:sw=4:et:cindent
% \Finale                                               ^^A.E.I.O.U.^^