summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/pclnfss/old/dvilj/graybox.sty
blob: ad66bf9873609a9c2abec673ce979d94649d3612 (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
% graybox.sty  9.3.1989
% print fboxes with various backgrounds
%
%    graybox#1#2
%        #1 -> grayscale; valid values are 2, 10, 15, 30, 45, 70, 90, 100
%        #2 -> textargument (exactly like fbox)
%
%    patbox#1#2
%        #1 -> pattern; valid values are:
%              1: horizontal lines
%              2: vertical lines
%              3: diagonal lines
%              4: diagonal lines
%              5: square grid
%              6: diagonal grid
%        #2 -> textargument (exactly like fbox)
%
\makeatletter
%
%
%

\long\def\graybox#1#2{\leavevmode\setbox\@tempboxa\hbox{#2}\@tempdima\fboxrule
\advance\@tempdima \fboxsep \advance\@tempdima \dp\@tempboxa
   \hbox{\lower \@tempdima\hbox
  {\vbox{\special{defpoint=1(,)}%
          \hrule \@height \fboxrule
          \hbox{\vrule \@width \fboxrule \hskip\fboxsep
            \vbox{\vskip\fboxsep \box\@tempboxa\vskip\fboxsep}\hskip
                         \fboxsep\vrule \@width \fboxrule%
                         \special{defpoint=2(,)}\special{gray=#1}%
                         \special{fill=1/2}%
                     }\hrule \@height \fboxrule%
                   }}}}


\long\def\patbox#1#2{\leavevmode\setbox\@tempboxa\hbox{#2}\@tempdima\fboxrule
\advance\@tempdima \fboxsep \advance\@tempdima \dp\@tempboxa
   \hbox{\lower \@tempdima\hbox
  {\vbox{\special{defpoint=11(,)}%
          \hrule \@height \fboxrule
          \hbox{\vrule \@width \fboxrule \hskip\fboxsep
            \vbox{\vskip\fboxsep \box\@tempboxa\vskip\fboxsep}\hskip
                         \fboxsep\vrule \@width \fboxrule%
                         \special{defpoint=12(,)}\special{pattern=#1}%
                         \special{fill=11/12}%
                     }\hrule \@height \fboxrule%
                   }}}}