[l2h] Re: loosing control characters ("\}") during creation of 'images.tex'

Ross Moore Ross Moore <ross@ics.mq.edu.au>
Sun, 7 Nov 1999 12:33:49 +1100 (EST)


> 
> hy again,
> 
> i found another strange behavior in the new 99.2beta5.
> in my latex file i have the following two lines:
> 
> \renewcommand{\{}{\symbol{123}}%
> \renewcommand{\}}{\symbol{125}}%

> unfortuantely only the first one makes its way down to 'images.tex'.
> the second one gets slightly scrumbled:
> 
> \renewcommand{\{}{\symbol{123}}%
> \renewcommand{}}{\symbol{125}}%   <--- NO MORE SLASH HERE TO ESCAPE '}'

Interesting bug.
Brace characters are extremely important to LaTeX2HTML,
and \renewcommand is tricky to program correctly,
given the differences between TeX's expansion model
and that used in LaTeX2HTML.

Presumably these \renewcommand s are never intended to be used
outside of images.tex ?
In that case, the best workaround is to define a macro:

\newcommand{\alterbraces}{%
 \renewcommand{\{}{\symbol{123}}%
 \renewcommand{\}}{\symbol{125}}%
}

Make this definition within an \input (or \include) file
having name ending in .sty  (e.g. in a user-defined package)
so that LaTeX2HTML never reads the file's contents.

Then declare \alterbraces to be ignored by LaTeX2HTML,
so that it goes into images.tex unexpanded.
That is, list it within  .latex2html-init as follows:

&ignore_commands( <<_IGNORED_CMDS);
alterbraces
_IGNORED_CMDS


This is by far the safest way to define macros that only
have a use during the processing of images.tex .
If you need the altered \{ and \} symbols directly in
the HTML; then this will not work at all.
In that case, send me an example file to test,
and I'll attempt to find the missing \ .


Hope this helps,

	Ross Moore


 
> it seems as if the slash in the second line was eaten by latex2html,
> thus leading to a stack owerflow error in tex.
> unfortunately i couldn't find the place in latex2html where this 
> happens until now.
> 
> can anybody help?
> 
> thanks
> 
> volker