[latex2html] Re: [l2h] incorrect equation

John A. Turner turner@blueskystudios.com
Thu, 28 Dec 2000 19:34:16 -0500 (EST)

>>>>> "RM" == Ross Moore <ross@ics.mq.edu.au>:

>> However, I noticed a problem - if a macro cmd appears within the text

RM> Within $..$s, or just straight in the text ?

just straight in the text, e.g. \dx, where \dx is defined as:

\newcommand{\dx}{\mbox{${\Delta x \,}$}}

RM> The above solution works because LaTeX2HTML parses math differently
RM> to the way it parses text. 
RM> If a math-environment contains control-sequences apart from a few
RM> that are rather trivial in TeX, then an image is made of the whole
RM> environment or cell in an alignment.

yes, if the above macro is simply in the preamble, an image is made

RM> (Actually, there are several expansion models for math; this solution
RM> is best when you want largish images with little math-parsing.)
RM> In text, the effect of the declaration using:
RM>  &ignore_commands(....
RM> is to simply ignore the commands, as the name suggests.
RM> You will get nothing at all, and any arguments will simply
RM> remain in the text, unless the shape of the arguments has been
RM> specified also (see below).

ok, then what it's doing is completely to be expected

RM> There are 4 other types of declaration:
RM> (e.g. from  latex2html.pin)
RM> &process_commands_in_tex (<<_RAW_ARG_CMDS_);
RM> &process_commands_inline_in_tex (<<_RAW_ARG_CMDS_);
RM> &process_commands_nowrap_in_tex (<<_RAW_ARG_NOWRAP_CMDS_);
RM> &process_commands_wrap_deferred (<<_RAW_ARG_DEFERRED_CMDS_);
RM> The first 2 of these both cause an image to be made,
RM> if the command is encountered during parsing;
RM> i.e. in text, or in the advanced modes of math-parsing.
RM> The first uses math-mode in TeX, when making the image;
RM> the 2nd does not use math-mode.
RM> The 3rd is for commands that should go into the images.tex file,
RM> but which do not cause any visible output;
RM> e.g. \setcounter{equation}{<num>}
RM> The 4th encloses a command and its arguments inside a set
RM> of braces {...} but does not (of itself) cause an image.
RM> This is needed with some commands, to get the expansion
RM> occurring in correct sequence during LaTeX2HTML processing.

ok, I'm getting confused...

[snip stuff about args... this particular example doesn't have args,
 so let's stick with that first...]

RM> In your previous email you said that these were being used
RM> within larger math-environments; my answer was based upon that.

yes, well, I didn't say they were *only* used in math environments :)

RM> It was not a full description of all the possibilities.
RM> Christmas intervened, and a trip to California (where I am 
RM> now for 3 more weeks), before I could give you more details.

no problem - have fun in CA

RM> Hopefully this email gives you enough for now;
RM> write again if there are further difficulties.

the way it looks to me at the moment is that I need to distinguish between
those macros used in text and those used only in math envs - the latter can
be packaged with a corresponding perl module to ignore them, but the former
must be parsed

the problem is, this could be a huge headache, since:

o the macros I need to use in text will change, and
o the macros use other macros, which use other macros...

but maybe I'm missing something...

RM> All the best in the festive season,

and to you as well...