summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/tex4ht/array.4ht
blob: 3a6202934441b27d5316c41654f5b4a80b26d1dc (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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% array.4ht                             2007-01-03-21:02 %
% Copyright (C) 1997--2007       Eitan M. Gurari         %
%                                                        %
% This work may be distributed and/or modified under the %
% conditions of the LaTeX Project Public License, either %
% version 1.3 of this license or (at your option) any    %
% later version. The latest version of this license is   %
% in                                                     %
%   http://www.latex-project.org/lppl.txt                %
% and version 1.3 or later is part of all distributions  %
% of LaTeX version 2003/12/01 or later.                  %
%                                                        %
% This work has the LPPL maintenance status "maintained".%
%                                                        %
% This Current Maintainer of this work                   %
% is Eitan M. Gurari.                                    %
%                                                        %
% If you modify this program your changing its signature %
% with a directive of the following form will be         %
% appreciated.                                           %
%            \message{signature}                         %
%                                                        %
%                             gurari@cse.ohio-state.edu  %
%                 http://www.cse.ohio-state.edu/~gurari  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\immediate\write-1{version 2007-01-03-21:02}

  \def\@tabular{\leavevmode
  \hbox \bgroup \:@tabular:
      $\col@sep\tabcolsep \let\d@llarbegin\begingroup
                                    \let\d@llarend\endgroup
  \@tabarray}
\pend:def\@tabular{\let\@array:a\a:tabular \let\@array:b\b:tabular
   \let\@array:c\c:tabular \let\@array:d\d:tabular
   \let\@array:e\e:tabular \let\@array:f\f:tabular }
\def\:temp[#1]#2{%
  \def\Clr{#2}\a:VBorder
\HAssign\ar:cnt0
\let\HAlign\empty
%
  \@tempdima \ht \strutbox
  \advance \@tempdima by\extrarowheight
  \setbox \@arstrutbox \hbox{\vrule
             \@height \arraystretch \@tempdima
             \@depth \arraystretch \dp \strutbox
             \@width \z@}%
  \begingroup
    \@mkpream{#2}%
    \xdef\@preamble{%
        \everycr{}\tabskip\z@skip\noexpand\MkHalign\noexpand\@sharp
   {\@arstrut \@preamble \tabskip\z@skip}%
}%
    \xdef\:temp{%
   \def\noexpand\HAlign{\HAlign}%
   \def\noexpand\ar:cnt{\ar:cnt}}\aftergroup\:temp
%
  \endgroup
  \@arrayleft
  \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi \fi
  \bgroup
    \def\v:TBL{#1}%
    \let \protect \relax  \lineskip \z@
    \baselineskip \z@ \m@th
    \let\\\@arraycr \let\tabularnewline\\\let\par\@empty
    \ifx \EndPicture\:UnDef
       \SaveMkHalignConfig %%%%%%%%% \let\sv:ALIGN\HAlign
       \ifx \recall:ar\:UnDef
   \pend:def\@array{\recall:ar}%
   \edef\recall:ar{%
      \noexpand\ifx \noexpand\EndPicture\noexpand\:UnDef \noexpand\else
         \arrayrulewidth\the\arrayrulewidth
         \doublerulesep\the\doublerulesep
         \arraycolsep\the\arraycolsep
         \tabcolsep\the\tabcolsep
      \noexpand\fi }%
\fi
\arrayrulewidth\z@  \doublerulesep\z@
\arraycolsep\z@     \tabcolsep\z@
\Configure{MkHalign}
   {\@array:a}%
   {\@array:b\ProperTrTrue}%
   {\a:putHBorder\InitHBorder \ifProperTr{\@array:c}}%
   {\ifProperTr{\@array:d}\a:putHBorder\InitHBorder}%
   {\ifProperTr{\@array:e}\RecallMkHalignConfig\recall:ar}%
   {\ifProperTr{\@array:f}}
%
       \Configure{MkHalign}%
   {\@array:a}%
   {\@array:b\ProperTrTrue}%
   {\a:putHBorder\InitHBorder \ifProperTr{\@array:c}}%
   {\ifProperTr{\@array:d}\a:putHBorder\InitHBorder}%
   {\ifProperTr{\@array:e}%%%%%%%%%%\global \let\HAlign\sv:ALIGN
          \RecallMkHalignConfig\recall:ar}%
   {\ifProperTr{\@array:f}}
%
    \else \let\@sharp##\fi  
    \@preamble}
\HLet\@array\:temp
\HLet\@@array\@array
\let\:tempc\@startpbox
\append:defI\:tempc{\expandafter\everypar
   \expandafter{\the\everypar\everypar{\HtmlPar}\HtmlPar}}
\HLet\@startpbox\:tempc

\def\:tempc{\relax \ifnum\HCol=1 \a:endarray\fi
   \enda:rray}
\HLet\endarray\:tempc
\def\:tempc{\relax \ifnum\HCol=1 \a:endtabular\fi
   \enda:rray $\egroup}
\HLet\endtabular\:tempc
\def\enda:rray{\crcr\ifx \EndPicture\:UnDef \EndMkHalign
   \else \egroup\fi  \egroup \@arrayright \gdef\@preamble{}}
\expandafter \let \csname endtabular*\endcsname\endtabular
\def\:tempc{\@classx
   \@tempcnta \count@
   \prepnext@tok
   \@addtopreamble{\ifcase \@chnum
      \hfil
      \d@llarbegin
      \insert@column
      \d@llarend \hfil \or
      \hskip1sp\d@llarbegin \insert@column \d@llarend \hfil \or
      \hfil\hskip1sp\d@llarbegin \insert@column \d@llarend \or
    %
   \vtop \@startpbox{\@nextchar}\insert@column \@endpbox \or
   \vtop \@startpbox{\@nextchar}\insert@column \@endpbox \or
   \vbox \@startpbox{\@nextchar}\insert@column \@endpbox
  \fi}\prepnext@tok}
\HLet\@classz\:tempc
\def\:tempc{\@chclass
 \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
  \ifnum \@lastchclass=7 5 \else
   \ifnum \@lastchclass=8 \tw@ \else
    \ifnum \@lastchclass=9 \thr@@
   \else \z@
   \ifnum \@lastchclass = 10 \else
   \edef\@nextchar{\expandafter\string\@nextchar}%
   \@chnum
   \if \@nextchar c\z@ \add:ar-\else
    \if \@nextchar l\@ne \add:ar<\else
     \if \@nextchar r\tw@ \add:ar>\else
   \z@ \@chclass
   \if\@nextchar |\@ne \b:VBorder\else
    \if \@nextchar !6 \else
     \if \@nextchar @7 \d:VBorder\else
      \if \@nextchar <8 \else
       \if \@nextchar >9 \else
  10
  \@chnum
  \if \@nextchar m\thr@@ \add:ar m\else
   \if \@nextchar p4 \add:ar p\else
    \if \@nextchar b5 \add:ar b\else
   \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi
   \fi \fi  \fi  \fi  \fi  \fi  \fi \fi \fi \fi \fi \fi}
\HLet\@testpach\:tempc
\def\add:ar#1{\HAdvance\ar:cnt by 1
   \def\ch:class{#1}%
\c:VBorder
   \edef\HAlign{\HAlign 0 \ar:cnt\space #1 }}
\def\HColAlign{\expandafter \ifx\csname
   \expandafter\string\ch:class :T:D\endcsname\relax \else \csname
   \expandafter\string\ch:class :T:D\endcsname\fi}

\long\def\:temp#1#2#3{%
   \multispan{#1}\begingroup
%%%%%%%%     \let\sv:ALIGN\HAlign % \let\ar:cnt:\ar:cnt
     \def\@addamp{\if@firstamp \@firstampfalse \else
                \@preamerr 5\fi}%
     \let\HAlign\empty  \@mkpream{#2}%
\ifx \EndPicture\:UnDef
   \def\:temp##1 ##2 ##3 {##3}%
   \xdef\new:span{\new:span\HRow.\HCol\expandafter\:temp\HAlign;}%
\fi
\@addtopreamble\@empty
     \global\let\ch:class\ch:class
%%%%%%%%     \global\let\HAlign\sv:ALIGN
     \xdef\:temp{%
   \def\noexpand\HAlign{\HAlign}%
   \def\noexpand\ar:cnt{\ar:cnt}}\aftergroup\:temp
%
   \endgroup
   \def\@sharp{\a:multicolumn#3\b:multicolumn}%
   \@arstrut \@preamble
   \null
   \ignorespaces}
\HLet\multicolumn\:temp

\def\save@decl{%
  \toks \count@ = \expandafter\expandafter\expandafter {%
     \csname a:array\ifnum\@lastchclass=9
   >\else <\fi \expandafter\expandafter\expandafter\endcsname
\expandafter\@nextchar\the\toks
     \expandafter\count@\csname b:array\ifnum\@lastchclass=9
   >\else <\fi\endcsname
}}
\NewConfigure{array>}{2}
\NewConfigure{array<}{2}

\Hinput{array}
\endinput