[l2h] "regexp explosion" - apology and a bit more

Ross Moore Ross Moore <ross@ics.mq.edu.au>
Wed, 12 Jan 2000 22:12:49 +1100 (EST)


> 
> Hi, 
> 
>  Last month I reported a l2h processing error for my documents as
> "regexp explosion for large toc on l2h99.2", and Ross Moore pointed
> out as;
> 
> {
> \renewcommand{\theenumi}{(\arabic{enumi})}
> \renewcommand{\labelenumi}{\theenumi}
> \begin{enumerate}
> \item Item1
> \item Item2
> \item Item3
> \item Item4
> \end{enumerate}
> }

OK; that is indeed rather messy; especially since *all* of those
renewcommands are quite redundant to LaTeX2HTML...

...well, sort of.

The HTML <OL> ordered list does not use brackets around its numbers.
If you really *do* want that style of numbering, you have to use
a <DL> description list, and provide the numbering yourself.

LaTeX2HTML does this in certain circumstances.

However, for simplicity, I suspect that getting:

<OL TYPE="1">
<LI>Item1</LI>
<LI>Item2</LI>
<LI>Item3</LI>
<LI>Item4</LI>
</OL>

would be quite acceptable here.  Agreed ?


BTW, you could probably use a stylesheet to make the above HTML
appear onscreen with parenthetical numbering; but that's really
a different issue.

 
> As a matter of fact, these redefitions are not added by me but
> inserted automatically by a tool to convert simple text files to LaTeX
> documents ("Plain2" by A.Uchida - a popular tool in Japan), to create
> enumerate environment from a list like;
> 
> (1) Item1
> (2) Item2
> (2) Item3
> (2) Item4
> 
> 
> Currently I'm using a gimmick to convert \renewcommand's to \def's
> using "sed" (yes, workaround again :-P).
> 
>   sed 's/^ *\\renewcommand *{\(.*\)} *{\(.*\)} *$/\\def\ \1{\2}/'
> 
> 
> Is it difficult to modify l2h99.x to accept any number of *enumi
> redefinitions ?

If the format of the output is always as you described, then an appropriate
reg-exp could indeed be inserted to cause all those redefinitions to be
filtered-out or ignored.


Alternatively, can the tool be customised to produce output as follows ?

{%begin{latexonly}
\renewcommand...
\renewcommand...
%end{latexonly}
\begin{enumerate}
\item Item1
...
...
}

This would give an immediate solution to all your problems,
and would work as expected in both LaTeX and LaTeX2HTML.


Hope this helps,

	Ross Moore








 
>  ==========================================
>   Makoto Sasaki
>    The Japan Research Institute Ltd.
>    sasaki@tyo.sci.jri.co.jp