summaryrefslogtreecommitdiff
path: root/info/examples/tip/graphmac.tip
blob: 6cf2ba10d90629e8e7be4a5b8538b1ca6bd277d1 (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
% This macro source file is from the four volume series
% "TeX in Practice" by Stephan von Bechtolsheim, published
% 1993 by Springer-Verlag, New York.
% Copyright 1993 Stephan von Bechtolsheim.
% No warranty or liability is assumed.
% This macro may be copied freely if no fees other than
% media cost or shipping charges are charged and as long
% as this copyright and the following source code itself
% is not changed. Please see the series for further information.
%
% Version: 1.0
% Date: May 1, 1993
%
%
% This source code is documented in 9.2.1, p. I-314.
% Original source in file "boxit.TEX", starting line 79.
\wlog{L: "graphmac.tip" ["boxit.TEX," l. 79, p. I-314]}%
% This file DOES belong to format "texip."
\InputD{box-zero.tip}
\catcode`\@ = 11
\newdimen\@ScaleLength
\def\SetScale #1{% 
    \@ScaleLength = #1
}
\SetScale{1mm}
\newdimen\@LineThickness
\def\SetLineThickness #1{%
    \@LineThickness = #1
}
\SetLineThickness{0.3mm}
\newbox\@GraphDataBox
\def\SetGraphDataBox #1{%
    \dimen0 = #1%
    \setbox\@GraphDataBox =
        \hbox{%
            \hskip -0.5\dimen0
            \vrule height 0.5\dimen0
                   depth  0.5\dimen0
                   width  1.0\dimen0
        }%
    \ZeroBox{\@GraphDataBox}%
}
\SetGraphDataBox{2mm}
\def\DrawDataBox (#1,#2){%
    {%
        \setbox0 = \hbox{%
            \hskip #1\@ScaleLength
            \raise #2\@ScaleLength\copy\@GraphDataBox
        }%
        \ZeroBoxOut{0}% 
    }% 
}
\def\DrawHLine (#1,#2)#3{%
    {%
        \setbox0 = \hbox{%
            \hskip #1\@ScaleLength
            \raise #2\@ScaleLength
                \hbox{%
                    \vrule height 0.5\@LineThickness
                           depth  0.5\@LineThickness
                           width  #3\@ScaleLength
                }% 
        }%
        \ZeroBoxOut{0}% 
    }% 
}
\def\DrawVLine (#1,#2)#3{%
    {%
        \setbox0 = \hbox{%
            \hskip #1\@ScaleLength
            \hskip -0.5\@LineThickness
            \raise #2\@ScaleLength
                \hbox{%
                    \vrule height #3\@ScaleLength
                           depth  0pt
                           width  \@LineThickness
                }% 
        }%
        \ZeroBoxOut{0}% 
    }% 
}
\catcode`\@ = 12