Debian Codegraph @

texmf-dist/tex/generic/tex4ht/array.4ht

raw
1 % array.4ht (2025-08-14-13:28), generated from tex4ht-4ht.tex
2 % Copyright (C) 1997-2009 Eitan M. Gurari
3 % Copyright 2009-2025 TeX Users Group
4 %
5 % This work may be distributed and/or modified under the
6 % conditions of the LaTeX Project Public License, either
7 % version 1.3c of this license or (at your option) any
8 % later version. The latest version of this license is in
9 % https://www.latex-project.org/lppl.txt
10 % and version 1.3c or later is part of all distributions
11 % of LaTeX version 2005/12/01 or later.
12 %
13 % This work has the LPPL maintenance status "maintained".
14 %
15 % The Current Maintainer of this work
16 % is the TeX4ht Project <https://tug.org/tex4ht>.
17 %
18 % If you modify this program, changing the
19 % version identification would be appreciated.
20 \immediate\write-1{version 2025-08-14-13:28}
21
22 \def\@tabular{\leavevmode
23 \hbox \bgroup \:@tabular:
24 $\col@sep\tabcolsep \let\d@llarbegin\begingroup
25 \let\d@llarend\endgroup
26 \@tabarray}
27 \pend:def\@tabular{\let\@array:a\a:tabular \let\@array:b\b:tabular
28 \let\@array:c\c:tabular \let\@array:d\d:tabular
29 \let\@array:e\e:tabular \let\@array:f\f:tabular
30 }
31 \def\:temp[#1]#2{%
32 \def\Clr{#2}\a:VBorder
33 \HAssign\ar:cnt0
34 \let\HAlign\empty
35 %
36 \@tempdima \ht \strutbox
37 \advance \@tempdima by\extrarowheight
38 \setbox \@arstrutbox \hbox{}%
39 \begingroup
40 \@mkpream{#2}%
41 \xdef\@preamble{%
42 \everycr{}\tabskip\z@skip\noexpand\MkHalign\noexpand\@sharp
43 {\@arstrut \@preamble \tabskip\z@skip}%
44 }%
45 \xdef\:temp{%
46 \def\noexpand\HAlign{\HAlign}%
47 \def\noexpand\ar:cnt{\ar:cnt}}\aftergroup\:temp
48 %
49 \endgroup
50 \@arrayleft
51 \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi \fi
52 \bgroup
53 \def\v:TBL{#1}%
54 \let \protect \relax \lineskip \z@
55 \baselineskip \z@ \m@th
56 \let\\\@arraycr \let\tabularnewline\\\let\par\@empty
57 \ifx \EndPicture\:UnDef
58 \SaveMkHalignConfig %%%%%%%%% \let\sv:ALIGN\HAlign
59 \ifx \recall:ar\:UnDef
60 \pend:def\@array{\recall:ar}%
61 \edef\recall:ar{%
62 \noexpand\ifx \noexpand\EndPicture\noexpand\:UnDef \noexpand\else
63 \arrayrulewidth\the\arrayrulewidth
64 \doublerulesep\the\doublerulesep
65 \arraycolsep\the\arraycolsep
66 \tabcolsep\the\tabcolsep
67 \noexpand\fi }%
68 \fi
69 % why did we set these variables to zero? it leads to wrong spacing
70 % in pictures.
71 % https://puszcza.gnu.org.ua/bugs/?229
72 % \arrayrulewidth\z@ \doublerulesep\z@
73 % \arraycolsep\z@ \tabcolsep\z@
74 \Configure{MkHalign}
75 {\@array:a}%
76 {\@array:b\ProperTrTrue}%
77 {\a:putHBorder\InitHBorder
78 \gHAdvance\cline:cnt by 1
79 \expandafter\ifx \csname cw:cline-\cline:cnt\endcsname \relax \else
80 \Tag{Cline-\cline:cnt}{}%
81 \fi
82 \expandafter\ifx \csname cw:Cline-\cline:cnt\endcsname \relax \else
83 \ht:special{t4ht@[}%
84 \fi
85 %
86 \ifProperTr{\@array:c}}%
87 {\ifProperTr{\@array:d}%
88 \ifomit: \Tag{cline-\cline:cnt}{}\fi
89 \expandafter\ifx \csname cw:Cline-\cline:cnt\endcsname \relax \else
90 \ht:special{t4ht@]}%
91 \fi
92 \global \omit:false
93 %
94 \a:putHBorder\InitHBorder}%
95 {\ifProperTr{\@array:e}\RecallMkHalignConfig\recall:ar}%
96 {\ifProperTr{\@array:f}}
97 %
98 \Configure{MkHalign}%
99 {\@array:a}%
100 {\@array:b\ProperTrTrue}%
101 {\a:putHBorder\InitHBorder \ifProperTr{\@array:c}}%
102 {\ifProperTr{\@array:d}\a:putHBorder\InitHBorder}%
103 {\ifProperTr{\@array:e}%%%%%%%%%%\global \let\HAlign\sv:ALIGN
104 \RecallMkHalignConfig\recall:ar}%
105 {\ifProperTr{\@array:f}}
106 %
107 \else \let\@sharp##\fi
108 \@preamble}
109 \HLet\@array\:temp
110 \HLet\@@array\@array
111 \let\:tempc\@startpbox
112 \append:defI\:tempc{\expandafter\everypar
113 \expandafter{\the\everypar\everypar{\HtmlPar}\HtmlPar}}
114 \HLet\@startpbox\:tempc
115 \def\@startpbox@action{\@startpbox}
116
117 \def\:tempc{\relax \ifnum\HCol=1 \a:endarray\fi
118 \enda:rray}
119 \HLet\endarray\:tempc
120 \def\:tempc{\relax \ifnum\HCol=1 \a:endtabular\fi
121 \enda:rray $\egroup}
122 \HLet\endtabular\:tempc
123 \def\enda:rray{\crcr\ifx \EndPicture\:UnDef \EndMkHalign
124 \else \egroup\fi \egroup \@arrayright \gdef\@preamble{}}
125 \expandafter \let \csname endtabular*\endcsname\endtabular
126 \def\:tempc{\@classx
127 \@tempcnta \count@
128 \prepnext@tok
129 \@addtopreamble{\ifcase \@chnum
130 \hfil
131 \d@llarbegin
132 \insert@column
133 \d@llarend \hfil \or
134 \hskip1sp\d@llarbegin \insert@column \d@llarend \hfil \or
135 \hfil\hskip1sp\d@llarbegin \insert@column \d@llarend \or
136 %
137 \vtop \@startpbox{\@nextchar}\insert@column \@endpbox \or
138 \vtop \@startpbox{\@nextchar}\insert@column \@endpbox \or
139 \vbox \@startpbox{\@nextchar}\insert@column \@endpbox
140 \fi}\prepnext@tok}
141 \HLet\@classz\:tempc
142 \def\:tempc{\@chclass
143 \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
144 \ifnum \@lastchclass=7 5 \else
145 \ifnum \@lastchclass=8 \tw@ \else
146 \ifnum \@lastchclass=9 \thr@@
147 \else \z@
148 \ifnum \@lastchclass = 10
149 \global \expandafter\let \csname @testpach \ar:cnt\endcsname\@nextchar
150 %
151 \else
152 \edef\@nextchar{\expandafter\string\@nextchar}%
153 \@chnum
154 \if \@nextchar c\z@ \add:ar-\else
155 \if \@nextchar l\@ne \add:ar<\else
156 \if \@nextchar r\tw@ \add:ar>\else
157 \z@ \@chclass
158 \if\@nextchar |\@ne \b:VBorder\else
159 \if \@nextchar !6 \else
160 \if \@nextchar @7 \d:VBorder\else
161 \if \@nextchar <8 \else
162 \if \@nextchar >9 \else
163 10
164 \@chnum
165 \if \@nextchar m\thr@@ \add:ar m\else
166 \if \@nextchar p4 \add:ar p\else
167 \if \@nextchar b5 \add:ar b\else
168 \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi
169 \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi}
170 \HLet\@testpach\:tempc
171 \def\add:ar#1{\HAdvance\ar:cnt by 1
172 \def\ch:class{#1}%
173 \c:VBorder
174 \edef\HAlign{\HAlign 0 \ar:cnt\space #1 }}
175 \def\HColAlign{\expandafter \ifx\csname
176 \expandafter\string\ch:class :T:D\endcsname\relax \else \csname
177 \expandafter\string\ch:class :T:D\endcsname\fi}
178
179 %
180 \long\def\:temp#1#2#3{%
181 \multispan{#1}\a:multicolumn \begingroup
182 \def\@addamp{\if@firstamp \@firstampfalse \else
183 \@preamerr 5\fi}%
184 \def\Clr{#2}\a:VBorder
185 \HAssign\ar:cnt0
186 \let\HAlign\empty
187 %
188 \@mkpream{#2}%
189 \ifx \EndPicture\:UnDef
190 \def\:temp##1 ##2 ##3 {##3}%
191 \xdef\new:span{\new:span\HRow.\HCol\expandafter\:temp\HAlign;}%
192 \fi
193 \@addtopreamble\@empty
194 \global\let\ch:class\ch:class
195 \xdef\:temp{%
196 \def\noexpand\HAlign{\HAlign}%
197 \def\noexpand\ar:cnt{\ar:cnt}}\aftergroup\:temp
198 %
199 \endgroup
200 \def\@sharp{\c:multicolumn#3\d:multicolumn}%
201 \@arstrut \@preamble
202 \null
203 \b:multicolumn
204 \ignorespaces}
205 \HLet\multicolumn\:temp
206
207 \def\save@decl{%
208 \toks \count@ = \expandafter\expandafter\expandafter {%
209 \csname a:array\ifnum\@lastchclass=9
210 >\else <\fi \expandafter\expandafter\expandafter\endcsname
211 \expandafter\@nextchar\the\toks
212 \expandafter\count@\csname b:array\ifnum\@lastchclass=9
213 >\else <\fi\endcsname
214 }}
215 \NewConfigure{array>}{2}
216 \NewConfigure{array<}{2}
217
218 \Hinput{array}
219 \endinput
220