13.3 array.sty


Options
Options 8 and 9

Good sample: tabsatz.tex

<..array.4ht..>
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % array.4ht                             2014-07-12-22:36 %
 % Copyright (C) 1997--2009       Eitan M. Gurari         %
 <.TeX4ht copyright.>
   <.array hooks.>
 \Hinput{array}
 \endinput
 -_-_-

array.sty

<..array hooks..>
 <.html private array/tabular array.sty.>
 -_-_-

In array.sty we have

ol=\relax        \let\@expast=\relax 
\let\@arrayclassiv=\relax   \let\@arrayclassz=\relax 
\let\@tabclassiv=\relax     \let\@tabclassz=\relax 
\let\@arrayacol=\relax      \let\@tabacol=\relax 
\let\@tabularcr=\relax      \let\@@endpbox=\relax 
\let\@argtabularcr=\relax   \let\@xtabularcr=\relax 

so we need diffenent definition than in latex

<..html private array/tabular array.sty..>
 \def\@tabular{\leavevmode
   \hbox \bgroup \:@tabular:
       $\col@sep\tabcolsep \let\d@llarbegin\begingroup
                                     \let\d@llarend\endgroup
   \@tabarray}
 \pend:def\@tabular{<.set hooks of tabular.>}
 -_-_-

The ‘\array’ and ‘\tabular’ environments are both defined in terms of \@array,

Two definitions of \@mkpream appear in array.sty, with the following being the second one. What use the first def has?

The checking of options needs to be at the end.

<..html private array/tabular array.sty..>+
 \def\:temp[#1]#2{%
   <.init conds for @mkpream.>%
   \@tempdima \ht \strutbox
   \advance \@tempdima by\extrarowheight
   \setbox \@arstrutbox \hbox{}%
   \begingroup
     \@mkpream{#2}%
     \xdef\@preamble{%
         <.ialign for html @array.>}%
     <.globalize ar:cnt for array.sty.>%
   \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
        <.@array configuration for MkHalign.>%
        <.modefied @array config.>%
     \else \let\@sharp=##\fi  \HRestore\noalign
     \@preamble}
 \HLet\@array=\:temp
 \HLet\@@array=\@array
 <.array.hooks: show paragraphs in array par box.>
 -_-_-

<..array.hooks: show paragraphs in array par box..>
 \let\:tempc=\@startpbox
 \append:defI\:tempc{\expandafter\everypar
    \expandafter{\the\everypar\everypar{\HtmlPar}\HtmlPar}}
 \HLet\@startpbox=\:tempc
 -_-_-

<..modefied @array config..>
 \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}}
 -_-_-

\endarray has two defs in array.sty. Where the first one is in use (it is ignored here).

<..html private array/tabular array.sty..>+
 \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
 -_-_-

We can’t put \endarray in \endtabular directly, because both change dynamically.

<..html private array/tabular array.sty..>+
 \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
    $\vcenter
    \@startpbox{\@nextchar}\insert@column \@endpbox $\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
 -_-_-

THe math environment above serves just for centering a column. It is problematic for pictorial inline math, when introduced before \end{tabular}. See the following example under dblatex.

\documentclass{article} 
  \usepackage{array} 
\begin{document} 
\begin{tabular}{m{6.5cm}c} 
a&b\\ 
c&d\\ 
\end{tabular} 
\end{document}