summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/draftcopy/draftcopy.sty
blob: 1553a1400240a6c2ed1a8a214782e96231224c8c (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
%%
%% This is file `draftcopy.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% draftcopy.doc  (with options: `package')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from draftcopy.sty.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file draftcopy.doc.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
\iffalse
%% Package draftcopy to use with LaTeX2e
%% This package is used to print on some pages the word `DRAFT'
%% (or the language dependend analogon) ``behind'' the intended stuff.
%%
%% Copyright (C) 1995 Dr. Juergen Vollmer
%%                    Viktoriastrasse 15, D-76133 Karlsruhe, Germany
%%                    Juergen.Vollmer@acm.org
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1 of the License, or any later version.
%%
%% If you find this software useful, please send me a postcard:
\fi







\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{draftcopy}[2002/02/25 v2.16]

\newif\ifdraftcopy@conditional
\newif\ifdraftcopy@draft
\newif\ifdraftcopy@final
\DeclareOption{conditional}{
  \draftcopy@conditionaltrue
}
\DeclareOption{draft}{
  \draftcopy@drafttrue
}
\DeclareOption{final}{
  \draftcopy@finaltrue
}

\def\draftcopy@Timestamp{}
\def\draftcopy@version{}
\newcount\draftcopy@hour \newcount\draftcopy@minute
\draftcopy@hour=\time
\divide \draftcopy@hour by 60
\draftcopy@minute=\time
\count@=\draftcopy@hour
\multiply \count@ by -60
\advance \draftcopy@minute by \count@
\newcommand{\draftcopy@daytime}{%
   \ifnum\draftcopy@hour=0 00\else\ifnum\draftcopy@hour<10 0\fi%
   \number\draftcopy@hour\fi:%
  \ifnum\draftcopy@minute<10 0\fi\number\draftcopy@minute%
}

\DeclareOption{timestamp}{
   \def\draftcopy@Timestamp{%
   \draftcopy@Show
   \draftcopy@PageX \draftcopy@PageY -40 add moveto
   /Times-Roman findfont 50 \draftcopy@ScaleFactor mul scalefont setfont
   (\draftcopy@version \today -- \draftcopy@daytime)
   }
}

  % VTEX-support: Thanks to "MicroPress Inc." <support@micropress-inc.com>
\let\immediate@special=\special
\DeclareOption{vtex}{
  \def\immediate@special{\immediate\special}
  \immediate@special{!bophook bop-hook}
  \def\draftcopy@BOPhook{/bop-hook}
  \def\draftcopy@UserDictCmd{pS: userdict }
  % MV & AK <mv@micropress-inc.com>
}
\DeclareOption{dvips}{
  \def\draftcopy@BOPhook{/bop-hook}
  \def\draftcopy@UserDictCmd{! userdict }
}
\DeclareOption{dvipsone}{
  % thanks to V. P. Stokes <virgil.stokes@neuro.ki.se>
  % thanks to Y&Y Help Line <support@YandY.com>
  % thanks to "H. Salehfar" <hsalehfa@sage.und.nodak.edu>
 \def\draftcopy@BOPhook{/bphook}
 \def\draftcopy@UserDictCmd{! dvidict}
}
\DeclareOption{textures}{
  % thanks to Jerome LAURENS \texttt{laurens@u-bourgogne.fr>
  \def\draftcopy@BOPhook{/bop-hook}
  \def\draftcopy@UserDictCmd{prepostscript userdict}
}

\DeclareOption{dviwindo}{\ExecuteOptions{dvipsone}}

\DeclareOption{xdvi}{\ExecuteOptions{dvips}}
\DeclareOption{dvi2ps}{\ExecuteOptions{dvips}}
\DeclareOption{dvialw}{\ExecuteOptions{dvips}}
\DeclareOption{dvilaser}{\ExecuteOptions{dvips}}
\DeclareOption{dvitops}{\ExecuteOptions{dvips}}
\DeclareOption{emtex}{\ExecuteOptions{dvips}}
\DeclareOption{dviwin}{\ExecuteOptions{dvips}}
\DeclareOption{oztex}{\ExecuteOptions{dvips}}
\DeclareOption{psprint}{\ExecuteOptions{dvips}}
\DeclareOption{pubps}{\ExecuteOptions{dvips}}
\DeclareOption{pctexps}{\ExecuteOptions{dvips}}
\DeclareOption{pctexwin}{\ExecuteOptions{dvips}}
\DeclareOption{pctexhp}{\ExecuteOptions{dvips}}
\DeclareOption{ln}{\ExecuteOptions{dvips}}


\def\draftcopy@Show{show }
\DeclareOption{outline}{
  \def\draftcopy@Show{false charpath 2 setlinewidth stroke }
}


\DeclareOption{light}{
    \def\draftcopy@GrayValue{0.90}
}

\DeclareOption{dark}{
    \def\draftcopy@GrayValue{0.85}
}

\DeclareOption{none}{
  \def\draftcopy@LastPage{0}
}
\DeclareOption{first}{
  \def\draftcopy@LastPage{1}
}
\DeclareOption{firsttwo}{
  \def\draftcopy@LastPage{2}
}
\DeclareOption{all}{
  \def\draftcopy@LastPage{99999}
}

\newif\ifdraftcopy@bottom
\DeclareOption{bottom}{
  \draftcopy@bottomtrue
}

\newif\ifdraftcopy@bottomAfter
\DeclareOption{bottomafter}{
  \draftcopy@bottomAftertrue
}

\def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
\def\draftcopy@Font{/Times-Roman}
\DeclareOption{american}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}
\DeclareOption{austrian}{
  \def\draftcopy@Name{ENTWURF}\def\draftcopy@Scale{155}
}
\DeclareOption{bahasa}{
  % thanks to Glenn G. Chappell <gchappell@semovm.semo.edu>
  \def\draftcopy@Name{DRAF}\def\draftcopy@Scale{217}
}
\DeclareOption{brazil}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}
\DeclareOption{brazilian}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}
\DeclareOption{breton}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}
\DeclareOption{british}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}
\DeclareOption{catalan}{
  % thanks to Dav <davpuig@mx3.redestb.es>
  % thanks to Xavier <xml@mat.upc.es>
  \def\draftcopy@Name{ESBORRANY}\def\draftcopy@Scale{110}
}
\DeclareOption{croatian}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}
\DeclareOption{czech}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}
\DeclareOption{danish}{
  % thanks to Ejnar Zacho Rath <ezr@md-oss.dk>,
  % thanks to Bjarne Vestergaard <bvbruder@dfi.aau.dk>
  % thanks to Joergen Larsen <JL@mmf.ruc.dk>
  \def\draftcopy@Name{UDKAST}\def\draftcopy@Scale{175}
}
\DeclareOption{dutch}{
  % thanks to Kees Leune <C.J.Leune@kub.nl>
  % \def\draftcopy@Name{CONCEPT}\def\draftcopy@Scale{150}
  % thanks to Anton Stoorvogel <wscoas@as.win.tue.nl> porposed
  \def\draftcopy@Name{ONTWERP}\def\draftcopy@Scale{150}
}
\DeclareOption{english}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}
\DeclareOption{esperanto}{
  % thanks to Stephan B. Webanck <webanck@mpiz-koeln.mpg.de>
  \def\draftcopy@Name{MALNETO}\def\draftcopy@Scale{160}
}
\DeclareOption{estonian}{
  % thanks to DAVID FEEST <mirka!mausgoe.central.de!
  % gOe.maus.de!David_Feest@uranus.central.de>
  \def\draftcopy@Name{VISAND}\def\draftcopy@Scale{215}
}
\DeclareOption{finnish}{
  % thanks to Jaakko Ruohio <jjruohio@boojum.hut.fi>
  \def\draftcopy@Name{LUONNOS}\def\draftcopy@Scale{200}
  % thanks to Mika Grundstroem <mikagr@spittari.cs.tut.fi>
  \def\draftcopy@Name{VEDOS}\def\draftcopy@Scale{220}
}
\DeclareOption{francais}{
  % thanks to Christophe Couvreur <couvreur@Thor.fpms.ac.be>
  \def\draftcopy@Name{BROUILLON}\def\draftcopy@Scale{120}
}
\DeclareOption{french}{
  % thanks to Christophe Couvreur <couvreur@Thor.fpms.ac.be>
  \def\draftcopy@Name{BROUILLON}\def\draftcopy@Scale{120}
  % thanks to Marc Torzynski <marc@snoopy.u-strasbg.fr>
  %\def\draftcopy@Name{EPREUVE}\def\draftcopy@Scale{120}
}
\DeclareOption{galician}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}
\DeclareOption{german}{
  \def\draftcopy@Name{ENTWURF}\def\draftcopy@Scale{155}
}
\DeclareOption{germanb}{
  \def\draftcopy@Name{ENTWURF}\def\draftcopy@Scale{155}
}
\DeclareOption{greek}{
  % thanks to  Apostolos Syropoulos <apostolo@ocean1.ee.duth.gr>
  \def\draftcopy@Name{PROSCEDIO}\def\draftcopy@Scale{85}
  \def\draftcopy@Font{/Symbol}
}
\DeclareOption{hungarian}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}
\DeclareOption{icelandic}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
  % DRÖG
  % Erlendur S Thorsteinsson <esth@cmu.edu>
  % does anybody knows how to create PostScript for that letter Ö?
}
\DeclareOption{irish}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
  % DRÉACHT
  % Breanndán Ó Nualláin <bon@kotona.demon.nl>
  % does anybody knows how to create PostScript for that letter É?
}
\DeclareOption{italian}{
  % thanks to Fabio Massacci <Fabio.Massacci@cl.cam.ac.uk>
  % thanks to Paolo Dell'Aquila <dlle07k1@mo.nettuno.it>
  \def\draftcopy@Name{BOZZA}\def\draftcopy@Scale{215}
  % thanks to Giuseppe De Arcangelis <gdearc@serifos.caspur.it>
  % \def\draftcopy@Name{brutta copia}\def\draftcopy@Scale{80}
}
\DeclareOption{lowersorbian}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}
\DeclareOption{magyar}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}
\DeclareOption{norsk}{
  % thanks to: Dag Langmyhr <dag@ifi.uio.no>
  \def\draftcopy@Name{UTKAST}\def\draftcopy@Scale{178}
}
\DeclareOption{nynorsk}{
  % thanks to: Dag Langmyhr <dag@ifi.uio.no>
  \def\draftcopy@Name{FRAMLEGG}\def\draftcopy@Scale{129}
}
\DeclareOption{polish}{
  % thanks to Piotr Chrusciel <piotr@gargan.math.univ-tours.fr>
  \def\draftcopy@Name{BRUDNOPIS}\def\draftcopy@Scale{120}
}
\DeclareOption{portuges}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}
\DeclareOption{portuguese}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}
\DeclareOption{romanian}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}
\DeclareOption{scottish}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}
\DeclareOption{spanish}{
  % thanks to: Tomas Bautista <bautista@cma.ulpgc.es>
  \def\draftcopy@Name{BORRADOR}\def\draftcopy@Scale{120}
}
\DeclareOption{slovak}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}
\DeclareOption{slovene}{
  % thanks to brodnik@pegam.mat.uni-lj.si <Andrej Brodnik>
  \def\draftcopy@Name{OSNUTEK}\def\draftcopy@Scale{120}
}
\DeclareOption{swedish}{
  % thanks to <matsd@physchem.kth.se>
  \def\draftcopy@Name{UTKAST}\def\draftcopy@Scale{185}
}
\DeclareOption{turkish}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}
\DeclareOption{uppersorbian}{
  \def\draftcopy@Name{DRAFT}\def\draftcopy@Scale{215}
}

\DeclareOption{portrait}{
  % thanks to Ross MOORE \texttt{ross@maths.mq.edu.au>}
  \def\draftcopy@PageTranslate{200 70 translate 65 rotate}
  \def\draftcopy@BottomTranslate{0 25 translate}
  \def\draftcopy@ScaleFactor{1 }
}
\DeclareOption{landscape}{
  % thanks to Ross MOORE \texttt{ross@maths.mq.edu.au>}
  \def\draftcopy@PageTranslate{70 450 translate 25 neg rotate}
  \def\draftcopy@BottomTranslate{25 650 translate 90 neg rotate}
  \def\draftcopy@ScaleFactor{0.6 }
}

\ExecuteOptions{dark,all,english,portrait}
\input{draftcopy.cfg}
\ProcessOptions
\typeout{Prints \draftcopy@Name\space on pages;
does not show in your DVI viewer}

\newcommand{\draftcopyVersion}[1]{
  \def\draftcopy@version{#1}
}

\newcommand{\draftcopySetGrey}[1]{
  \def\draftcopy@GrayValue{#1}
}

\newcommand{\draftcopySetScale}[1]{
  \def\draftcopy@Scale{#1}
}

\newcommand{\draftcopySetScaleFactor}[1]{
  \def\draftcopy@ScaleFactor{#1 }
}

\def\draftcopy@FirstPage{0}
\newcommand{\draftcopyFirstPage}[1]{
  \def\draftcopy@FirstPage{#1}
}

\newcommand{\draftcopyLastPage}[1]{
  \def\draftcopy@LastPage{#1}
}

\newcommand{\draftcopyName}[2]{
  \def\draftcopy@Name{#1}
  \def\draftcopy@Scale{#2}
}

\let\@draftcopyTilde~

\newcommand{\draftcopyPageTransform}[1]{%
 \def\draftcopy@PageTranslate{#1}%
}

\newcommand{\draftcopyBottomTransform}[1]{%
 \def\draftcopy@BottomTranslate{#1}%
}

\def\draftcopy@PageX{0 }
\newcommand{\draftcopyPageX}[1]{%
 \def\draftcopy@PageX{#1 }%
}

\def\draftcopy@PageY{0 }
\newcommand{\draftcopyPageY}[1]{%
 \def\draftcopy@PageY{#1 }%
}

\def\draftcopy@BottomX{0 }
\newcommand{\draftcopyBottomX}[1]{%
 \def\draftcopy@BottomX{#1 }%
}

\def\draftcopy@BottomY{0 }
\newcommand{\draftcopyBottomY}[1]{%
 \def\draftcopy@BottomY{#1 }%
}

\newif\ifdraftcopy@showit
\ifdraftcopy@conditional
  \ifdraftcopy@draft
     \draftcopy@showittrue
  \else
      \draftcopy@showitfalse
  \fi
  \ifdraftcopy@final
    \draftcopy@showitfalse
  \fi
\else
  \draftcopy@showittrue
\fi

\ifdraftcopy@showit
{\obeyspaces
\ifdraftcopy@bottomAfter
  \AtBeginDocument{
    \let~\space
    \immediate@special{\draftcopy@UserDictCmd
      begin
      /draftcopy-CurrentPage 0 def
      /draftcopy-old-BOPhook { } def
      currentdict \draftcopy@BOPhook\space known{
            /draftcopy-old-BOPhook \draftcopy@BOPhook\space load def
      } if
      \draftcopy@BOPhook{
        draftcopy-old-BOPhook
        /draftcopy-CurrentPage draftcopy-CurrentPage 1 add def
        draftcopy-CurrentPage \draftcopy@FirstPage ge
        draftcopy-CurrentPage \draftcopy@LastPage le
        and
        { gsave \draftcopy@PageTranslate
          \draftcopy@Font findfont
          \draftcopy@Scale \draftcopy@ScaleFactor mul scalefont setfont
          \draftcopy@PageX \draftcopy@PageY moveto
          \draftcopy@GrayValue setgray
         (\draftcopy@Name) \draftcopy@Timestamp \draftcopy@Show
          grestore
        } if
        draftcopy-CurrentPage \draftcopy@LastPage gt
        { gsave \draftcopy@BottomTranslate
          \draftcopy@Font findfont
          25 scalefont setfont
          \draftcopy@BottomX \draftcopy@BottomY moveto
          \draftcopy@GrayValue setgray
           (\draftcopy@Name\space\space--\space\space)
           0 1 15 { pop dup show } for
          grestore
        } if
      } def
      end
      }
    \let~\@draftcopyTilde
   }
\else\ifdraftcopy@bottom
  \AtBeginDocument{
    \let~\space
    \immediate@special{\draftcopy@UserDictCmd
      begin
      /draftcopy-CurrentPage 0 def
      /draftcopy-old-BOPhook { } def
      currentdict \draftcopy@BOPhook\space known{
            /draftcopy-old-BOPhook \draftcopy@BOPhook\space load def
      } if
      \draftcopy@BOPhook{
        draftcopy-old-BOPhook
        /draftcopy-CurrentPage draftcopy-CurrentPage 1 add def
        draftcopy-CurrentPage \draftcopy@FirstPage ge
        draftcopy-CurrentPage \draftcopy@LastPage  le
        and
        { gsave \draftcopy@PageTranslate
          \draftcopy@Font findfont
          \draftcopy@Scale \draftcopy@ScaleFactor mul scalefont setfont
          \draftcopy@PageX \draftcopy@PageY moveto
          \draftcopy@GrayValue setgray
         (\draftcopy@Name) \draftcopy@Timestamp \draftcopy@Show
          grestore
        }if
         gsave \draftcopy@BottomTranslate
        \draftcopy@Font findfont
        25 scalefont setfont
        \draftcopy@BottomX \draftcopy@BottomY moveto
        \draftcopy@GrayValue setgray
        (\draftcopy@Name\space\space--\space\space)
        0 1 15 { pop dup show } for
        grestore
      } def
      end
      }
    \let~\@draftcopyTilde
   }
\else
  \AtBeginDocument{
    \let~\space
    \immediate@special{\draftcopy@UserDictCmd
      begin
      /draftcopy-CurrentPage 0 def
      /draftcopy-old-BOPhook { } def
      currentdict \draftcopy@BOPhook\space known{
            /draftcopy-old-BOPhook \draftcopy@BOPhook\space load def
      } if
      \draftcopy@BOPhook{
        draftcopy-old-BOPhook
        /draftcopy-CurrentPage draftcopy-CurrentPage 1 add def
        draftcopy-CurrentPage \draftcopy@FirstPage ge
        draftcopy-CurrentPage \draftcopy@LastPage  le
        and
        { gsave \draftcopy@PageTranslate
          \draftcopy@Font findfont
          \draftcopy@Scale \draftcopy@ScaleFactor mul scalefont setfont
          \draftcopy@PageX \draftcopy@PageY moveto
          \draftcopy@GrayValue setgray
         (\draftcopy@Name) \draftcopy@Timestamp \draftcopy@Show
          grestore
        } if
      } def
      end
      }
    \let~\@draftcopyTilde
  }
\fi\fi
}
\fi

\endinput
%%
%% End of file `draftcopy.sty'.