Debian Codegraph @

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

raw
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 % mdwtab.4ht 2009-05-21-09:32 %
3 % Copyright (C) 2007--2009 Eitan M. Gurari %
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 %
9 % in %
10 % http://www.latex-project.org/lppl.txt %
11 % and version 1.3c or later is part of all distributions %
12 % of LaTeX version 2005/12/01 or later. %
13 % %
14 % This work has the LPPL maintenance status "maintained".%
15 % %
16 % This Current Maintainer of this work %
17 % is Eitan M. Gurari. %
18 % %
19 % If you modify this program your changing its signature %
20 % with a directive of the following form will be %
21 % appreciated. %
22 % \message{signature} %
23 % %
24 % [email protected] %
25 % http://www.cse.ohio-state.edu/~gurari %
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27 \immediate\write-1{version 2009-05-21-09:32}
28
29 \def\:tempc[#1]#2{%
30 \def\Clr{#2}\a:VBorder
31 \HAssign\ar:cnt0
32 \let\HAlign\empty
33 %
34 \edef\tab@restorehlstate{%
35 \global\tab@endheight\the\tab@endheight%
36 \gdef\noexpand\tab@hlstate{\tab@hlstate}%
37 }%
38 \def\tab@hlstate{n}%
39 \colset{tabular}%
40 \tab@initread
41 \let\@sharp\relax % <--------
42 \def\tab@midtext{\tab@setcr\ignorespaces\@sharp\@maybe@unskip}% <---------
43 \def\tab@multicol{\@arstrut\tab@startrow}%
44 \tab@preamble{\tab@multicol\tabskip\z@skip}%
45 \tab@readpreamble{#2}%
46 \tab@leftskip\z@skip%
47 \tab@rightskip\z@skip%
48 \tab@setposn{#1}%
49 % \ifdim\tab@width=\z@%
50 % \def\tab@halign{}%
51 % \else%
52 % \def\tab@halign{to\tab@width}%
53 % \fi%
54 \lineskip\z@\baselineskip\z@%
55 %%%%%%%%%%%%%%%%%%%%%%%%%%
56 \SaveMkHalignConfig
57 \Configure{MkHalign}
58 {\@array:a}%
59 {\@array:b\ProperTrTrue}%
60 {\a:putHBorder\InitHBorder
61 \gHAdvance\cline:cnt by 1
62 \expandafter\ifx \csname cw:cline-\cline:cnt\endcsname \relax \else
63 \Tag{Cline-\cline:cnt}{}%
64 \fi
65 \expandafter\ifx \csname cw:Cline-\cline:cnt\endcsname \relax \else
66 \ht:special{t4ht@[}%
67 \fi
68 %
69 \ifProperTr{\@array:c}}%
70 {\ifProperTr{\@array:d}%
71 \ifomit: \Tag{cline-\cline:cnt}{}\fi
72 \expandafter\ifx \csname cw:Cline-\cline:cnt\endcsname \relax \else
73 \ht:special{t4ht@]}%
74 \fi
75 \global \omit:false
76 %
77 \a:putHBorder\InitHBorder}%
78 {\ifProperTr{\@array:e}\RecallMkHalignConfig %\recall:ar
79 }%
80 {\ifProperTr{\@array:f}}%
81 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
82 \m@th%
83 \def\tabularnewline{\tab@arraycr\tab@penalty}%
84 \tab@setcr%
85 \let\par\@empty%
86 \everycr{}\tabskip\tab@leftskip \tab@left
87 \edef\:temp{\noexpand\MkHalign \@sharp{\the\tab@preamble}}%
88 % \hshow{:temp}%
89 \:temp
90 % \halign\expandafter\bgroup%
91 % \the\tab@preamble\tabskip\tab@rightskip\cr%
92 }
93 \HLet\@array\:tempc
94 \def\:tempc#1{%
95 \@ifundefined{\tab@colset!col.\string#1}{%
96 \tab@err@undef{#1}\tab@mkpreamble%
97 }{%
98 \if c#1\add:ar -\else
99 \if l#1\add:ar <\else
100 \if r#1\add:ar >\else
101 \if p#1\add:ar p\else
102 \if b#1\add:ar b\else
103 \if m#1\add:ar m\else
104 \if |#1\b:VBorder\else
105 \if @#1\d:VBorder \else
106 \fi\fi\fi\fi\fi\fi\fi\fi
107 \@nameuse{\tab@colset!col.\string#1}%
108 }%
109 }
110 \HLet\tab@mkpreamble@iii\:tempc
111 \def\add:ar#1{\HAdvance\ar:cnt by 1
112 \def\ch:class{#1}%
113 \c:VBorder
114 \edef\HAlign{\HAlign 0 \ar:cnt\space #1 }}
115 \def\HColAlign{\expandafter \ifx\csname
116 \expandafter\string\ch:class :T:D\endcsname\relax \else \csname
117 \expandafter\string\ch:class :T:D\endcsname\fi}
118
119 %
120 \def\:tempc{\relax
121 \ifx \HCol\:UnDef \else \ifnum\HCol=1 \a:endarray\fi \fi
122 \crcr\ifx \EndPicture\:UnDef \EndMkHalign
123 \else \egroup\fi
124 \tab@right
125 \tab@restorehlstate }
126 \HLet\endarray\:tempc
127 \pend:def\tabular{\let\@array:a\a:tabular \let\@array:b\b:tabular
128 \let\@array:c\c:tabular \let\@array:d\d:tabular
129 \let\@array:e\e:tabular \let\@array:f\f:tabular
130 }
131 \def\endtabular{\endarray}
132 \expandafter\pend:defI\csname tabular*\endcsname{
133 \expandafter\let\expandafter\@array:a\csname a:tabular*\endcsname
134 \expandafter\let\expandafter\@array:b\csname b:tabular*\endcsname
135 \expandafter\let\expandafter\@array:c\csname c:tabular*\endcsname
136 \expandafter\let\expandafter\@array:d\csname d:tabular*\endcsname
137 \expandafter\let\expandafter\@array:e\csname e:tabular*\endcsname
138 \expandafter\let\expandafter\@array:f\csname f:tabular*\endcsname
139 }
140 \expandafter\def\csname endtabular*\endcsname{\endarray}
141 \NewConfigure{tabular*}{6}
142 \pend:def\smarray{%
143 \let\@array:a\a:smarray \let\@array:b\b:smarray
144 \let\@array:c\c:smarray \let\@array:d\d:smarray
145 \let\@array:e\e:smarray \let\@array:f\f:smarray
146 }
147 \def\endsmarray{\endarray}
148 \NewConfigure{smarray}{6}
149
150 \Hinput{mdwtab}
151 \endinput
152