summaryrefslogtreecommitdiff
path: root/macros/plain/contrib/cellular/cell1.tex
blob: 89b98a354ea47772c0ee62986d68b2e923338b02 (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
% File:       TeX Inputs Cell1.tex
% Author:     J E Pittman
% Bitnet:     JEPTeX@TAMVenus
% Internet:   JEPTeX@Venus.TAMU.EDU
% Date:       October 11, 1988
%
% Set up the cellular environment
%
\catcode`_=11 % Protect local macros.
%
\ifx\forcount\undefined \input loopy \fi
\ifx\declarecount\undefined \input declare \fi
%
% Handy abbreviations
%
\def\half{0.5}%
\def\by{by}%
\def\height{height}%
\def\depth{depth}%
\def\width{width}%
\def\to{to}%
\def\zeropt{0pt}%
\let\x_after=\expandafter
%
% When using the Xerox 9700s or 4050, use \setverticaladjustment for 
% portrait output and \sethorizontaladjustment for landscape output 
% due to the differences in the way that vertical and horizontal lines 
% of the same weight are printed.
%
\declaredimen\pixelwidth
\pixelwidth=1in
\divide\pixelwidth by 300                         % assume 300dpi
%
\declaredimen\horizontal_rule_adjust
\horizontal_rule_adjust=\zeropt
\def\sethorizontaladjustment{\horizontal_rule_adjust=\pixelwidth}%
%
\declaredimen\vertical_rule_adjust
\vertical_rule_adjust=\zeropt
\def\setverticaladjustment{\vertical_rule_adjust=\pixelwidth}%
%
% The left, right, bottom, and top rule widths are used to determine
% the widths of the box around each cell.
%
\declaredimen\leftrulewidth
\declaredimen\rightrulewidth
\declaredimen\bottomrulewidth
\declaredimen\toprulewidth
%
% The left, right, bottom, and top border skips are used to position 
% the text of a cell within it, relative to the centers of the rulers.
%
\declareskip\leftborderskip
\declareskip\rightborderskip
\declareskip\bottomborderskip
\declareskip\topborderskip
%
\declarecount\last_column
\declaredimen\columnwidth
\declarecount\merge_columns
\declaredimen\merge_width
%
\declarecount\last_row
\declaredimen\rowheight
\declarecount\merge_rows
\declaredimen\merge_height
\declarecount\rowpenalty
%
% The row info and column info token registers contain a list of 
% tokens of the form /number/info, where number is the number of a 
% row or column of interest and info is information, usually register 
% assignments, that pertains to the row or column.
%
\declaretoks\column_info
\column_info={/}%
%
\declaretoks\row_info
\row_info={/}%
%
\def\everycolumn{\leftrulewidth=0.4pt\relax
   \rightrulewidth=\leftrulewidth
   \leftborderskip=6pt plus 1fil\relax
   \rightborderskip=\leftborderskip
   \columnwidth=\zeropt\relax
   \merge_rows=0\relax
   \merge_height=\zeropt\relax
   \columnwidth=\zeropt\relax
   }%
%
\def\everyrow{\toprulewidth=0.4pt\relax
   \bottomrulewidth=\toprulewidth
   \topborderskip=3pt plus 1fil\relax
   \bottomborderskip=\topborderskip
   \rowheight=\zeropt\relax
   \merge_columns=0\relax
   \merge_width=\zeropt\relax
   }%
%
\def\get_data#1<#2{\relax
   \def\temp##1/#1/##2/##3***{\relax
      \def\temp{##2}%
      \ifnum1=0\temp
         #2={##1/#1//}%
      \else
%        \message{extracted ##2}% debug
         ##2%
      \fi
      }%
   \x_after\temp\the#2#1/1/***%
   }%
%
\def\add_data#1>#2#3{\relax
   \def\temp##1/#1/##2/##3***{\relax
      #2={##1/#1/##2#3/##3}%
%     \message{\string#2=\the#2}% debug
      }%
   \x_after\temp\the#2***%
   }%
%
\def\add_column_number_data{\relax
   \x_after \add_data \the\column_number>\column_info
   }%
%
\def\get_column_number_data{\relax
   \x_after \get_data \the\column_number<\column_info
   }%
%
\def\add_row_number_data{\relax
   \x_after \add_data \the\row_number>\row_info
   }%
%
\def\get_row_number_data{\relax
   \x_after \get_data \the\row_number<\row_info
   }%
%
\declarebox\temp_box
\declarebox\scratch_box
\declaredimen\temp_dimen
\declaredimen\scratch_dimen
\declareskip\temp_skip
\declarecount\temp_count
%
\declarecount\tracingexpansions
\tracingexpansions=0
%
\catcode`_=8 % Return to normal.
%
\endinput