[l2h] Fails to number figures: bogus "arguments too complex" erro r.

Ross Moore ross at ics.mq.edu.au
Thu Oct 20 01:51:46 CEST 2005

On 19/10/2005, at 9:06 PM, John Blackburn wrote:

> Thanks for that, Ross,
> The \rms and \peak commands I defined are certainly causing the  
> problem. Replacing with something simple like
> \newcommand{\rms}{\textbf{rms}~}
> \newcommand{\peak}{\textbf{peak}~}
> solves the problem (though its not what I wanted!)

Right; that's because \textbf is robust in LaTeX.

> However using
> \DeclareRobustCommand{\rms}{{\footnotesize rms}~}
> \DeclareRobustCommand{\peak}{{\footnotesize peak}~}
> as you suggest does not work. The complaints about \leftmargin and  
> p_at_ go away but it still fails to number figures. It says, eg,

OK; although I didn't say so in my mail, I suspected that
this would *not* work, as you report.

The reason is that LaTeX writes  ... \rms ...  into the .aux file,
rather than expanding into the complete mess that \footnotesize gives.

However, LaTeX2HTML sees \rms expanded into  {\footnotesize rms}~
within the figure caption, so cannot correlate this with the .aux

My other suggestion should work fine:

> \newcommand{\rms}{{\protect\footnotesize rms}~}
> \newcommand{\peak}{{\protect\footnotesize peak}~}

since LaTeX writes:    {\footnotesize rms}~

and LaTeX2HTML sees:   {\protect\footnotesize rms}~
  and should discard the \protect when looking for the figure number.

> No number for  
> "Experimentalsetupforconstantvoltage.OSCoutputisinrange5mV<FONTSIZ
> E="-1">rms</FONT>-1.1V<FONTSIZE="-1">rms</ 
> FONT>.Theamplifiermagnifiesvoltageupto
> $100times 
> $.TheinputtoportAisvoltageoverpiezoelectricdividedby10,000tokeepitlowe 
> n
> ough.Thecurrentdetectorscreate1Vper1A."
> It would appear to have converted \footnotesize into html *before  
> looking up the caption*. Since the caption is in the aux file  
> generated by latex, there is no html there and the matching fails.

Hmm. But did you test the case with \protect ?

It's true that \DeclareRobustCommand needs a bit more work in the
LaTeX2HTML programming. It is a much more recent addition to LaTeX
than is the \protect mechanism.

> There is a less serious manifestation of this behaviour in  
> footnotes. I have the tex source
> 20mV\rms\footnote{In fact the HP...}
> This comes out as
> ... SIZE="-1">rms 5
>     In fact the HP outputs voltage in dBm: ...
> on the footnote page (footnote number 5)
> So it seems that Latex2html struggles with sizing commands in  
> captions.

If unprotected, yes.
Perhaps more generally too.

Thanks for these reports,


> John.

Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia  2109                            fax: +61 +2 9850 8114

More information about the latex2html mailing list