summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ncctools/ncccropbox.sty
blob: a34cef273a76c21a75331c6e5faca820607baa49 (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
%%
%% This is file `ncccropbox.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% ncccropbox.dtx  (with options: `package')
%% 
%% IMPORTANT NOTICE:
%% 
%% This file is a generated file from the sources of the `ncctools'
%% bundle.
%% 
%% You are not allowed to modify this file.
%% 
%% You are allowed to distribute this file if and only if
%% it is distributed with the corresponding source files in
%% the `ncctools' bundle.
%% 
%% For the copying and distribution conditions of the source files,
%% see the README file distributed with the ncctools bundle.
%%
%% File: ncccropbox.dtx Copyright (C) 2002--2004 by Alexander I. Rozhenko
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{ncccropbox}
         [2004/11/24 v1.1 Crop Box Package (NCC)]
\newcommand*{\croplinelength}[1]{\def\CRB@length{#1}}
\newcommand*{\croplinewidth}[1]{\def\CRB@width{#1}}
\newcommand*{\cropboxsep}[1]{\def\CRB@sep{#1}}
\newcommand*{\cropbox}[1][]{\@ifnextchar[{\CRB@box[#1]}{\CRB@box[#1][]}}
\def\CRB@box[#1][#2]#3{%
  \@begin@tempboxa\hbox{#3}%
    \def\@tempa{#1}\ifx\@tempa\@empty
      \@tempdima\width \advance\@tempdima 2\CRB@sep\relax
    \else
      \setlength\@tempdima{#1}%
    \fi
    \def\@tempa{#2}\ifx\@tempa\@empty
      \@tempdimb\totalheight \advance\@tempdimb 2\CRB@sep\relax
    \else
      \setlength\@tempdimb{#2}%
    \fi
    \setbox\z@\hb@xt@\z@{%
      \linethickness{\CRB@width}%
      \setlength\unitlength{\CRB@length}%
      \ifdim\unitlength=\z@ \else
        \ifdim\unitlength>\z@
          \CRB@hcross\z@\z@\@ne\@ne
          \CRB@hcross\@tempdima\z@\m@ne\@ne
          \CRB@hcross\z@\@tempdimb\@ne\m@ne
          \CRB@hcross\@tempdima\@tempdimb\m@ne\m@ne
        \else \unitlength -\unitlength
          \CRB@hcross\z@\z@\m@ne\m@ne
          \CRB@hcross\@tempdima\z@\@ne\m@ne
          \CRB@hcross\z@\@tempdimb\m@ne\@ne
          \CRB@hcross\@tempdima\@tempdimb\@ne\@ne
        \fi
      \fi
    }%
    \leavevmode \ht\z@\z@ \dp\z@\z@ \box\z@
    \advance\@tempdimb -\lineskip
    \vbox to\@tempdimb{\vss\vskip -\lineskip
      \hb@xt@\@tempdima{\hss\unhbox\@tempboxa\hss}\vss\kern\z@
    }%
  \@end@tempboxa
}
\def\CRB@hcross#1#2#3#4{%
  \@killglue\raise#2\hb@xt@\z@{\kern#1\line(#3,0)\@ne\hss}\hss
  \@killglue\raise#2\hb@xt@\z@{\kern#1\line(0,#4)\@ne\hss}\hss
}
\croplinelength{10pt}
\croplinewidth{.4pt}
\cropboxsep{5pt}
\endinput
%%
%% End of file `ncccropbox.sty'.