Why does the following document (with article document class):

1 & 2 \\

5 & 6 \\

creates a perfect html doc.

While the following (using memoir) produces the error:

1 & 2 \\

5 & 6 \\

Following is the error

l.3 --- TeX4ht warning --- \halign translated into linear text ---
! Missing number, treated as zero.
<to be read again> 
l.4 \hline

Note: Both produce completely perfect pdfs.

1 Answer 1


I think the problem is that both memoir and tex4ht redefines lot of standard macros. tex4ht tries hard to translate LaTeX tables to their html counterparts. In order to do that, it inserts some configurable hooks to standard macros. But it seems that memoir also changes standard table macros, in some way which is incompatible with tex4ht

This problem can be solved by writing tex4ht configuration file for memoir. In fact, it exists, but it is really basic and it doesn't contain configuration for tables. You can see it on the ctan

So what is needed at the moment is that someone who understands memoir internals and the way in which tex4ht handles tables write configurations for memoir's tables and possibly other things, which memoir redefines.


For start, you can try to include configurations for packages loaded by memoir automatically. Place this file as memoir.4ht in directory with your document:

% memoir.4ht                           2009-05-21-09:32 %
% Copyright (C) 2003--2009      Eitan M. Gurari         %
%                                                        %
% This work may be distributed and/or modified under the %
% conditions of the LaTeX Project Public License, either %
% version 1.3c 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.3c or later is part of all distributions %
% of LaTeX version 2005/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}                         %
%                                                        %
%                             [email protected]  %
%                 http://www.cse.ohio-state.edu/~gurari  %
\immediate\write-1{version 2009-05-21-09:32}

\input book.4ht
\input verse.4ht
% Tables Handling
\input array.4ht
\input dcolumn.4ht
\input tabularx.4ht
\input booktabs.4ht

   \gHAdvance\:mpNum by 1
\HAssign\minipageNum=\:mpNum \relax
   {\SkipRefstepAnchor \let\addcontentsline\:gobbleIII\no@chapter[#1]{}%
    \global\let\f@rhdr\f@rhdr  }%
   \HtmlEnv   \Toc:Title{#1}\:chapter{#2}}

\ifx \memgobble\:UnDef


  • yes i understood that much however i would like to know what to put in the memoir.4ht so that it doesn't cripple my html.. is there someway to inherit tabular from article instead of memoir? Any solution if i have a 1000 page document written using memoir commands and don't have the flexibility to change to article? what would be the easiest way around? Dec 5, 2012 at 7:57
  • @RamneekHanda I added sample config file
    – michal.h21
    Dec 5, 2012 at 9:12
  • thanks for the solution. could you help me with the tex.stackexchange.com/questions/85302/… , after making your recommended changes there in that example it fails somewhere else :( Dec 5, 2012 at 11:21
  • +1 I really appreciate how much you know about tex4ht, thanks so much :)
    – cmhughes
    Dec 6, 2012 at 1:51
  • ahh cant delete comments.. had put it on wrong post :) Dec 6, 2012 at 9:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .