[tex4ht] Tables generated by htlatex are too complex for Kindle

Radhakrishnan CV cvr at river-valley.org
Sat Nov 12 03:16:16 CET 2011


On Thu, Nov 10, 2011 at 10:36 PM, Ray Seyfarth <ray.seyfarth at gmail.com> wrote:
> Hi tex4ht Fans!
>
> I have prepared a book using LaTeX which looks great as a printed book
> (PDF).  However, to have an electronic version for Kindles and Nooks, I had
> to convert the book to HTML.  The htlatex command does an outstanding job of
> conversion to html, but the lines for the tables are too complex for the
> Kindle to handle properly.

TeX4ht generates the kind of tables as found in LaTeX documents.

> Is there some way to tell htlatex to generate tables with border="1"?

You might provide a simpler configuration for tabular structure after
\begin{document} in the following fashion:

the syntax is

\Configure{tabular}
  {at the start of table}
  {at the end of table}
  {at the beginning of row}
  {at the end of row}
  {before each cell}
  {after each cell}

\Configure{tabular}
    {\HCode{<table width="100\%" cellspacing="3" cellpadding="3" border="1">}}
    {\HCode{</table>}}
    {\HCode{<tr style="background-color:\rowcolor">}}
    {\HCode{</tr>}}
    {\HCode{<td  align="left"
            \ifnum \HMultispan>1 colspan="\HMultispan"\fi >}}
    {\HCode{</td>}}

The following is for alternate background colors for rows and unique
color first row.

\def\rowcolor{\ifnum\HRow=1
    \#aaaaff;\else\ifodd\HRow\#f0f0f0;\else\#fdeded;\fi\fi}

Hope this will help your purpose.

Best regards
-- 
Radhakrishnan



More information about the tex4ht mailing list