[l2h] Wrong figure numbers in figure captions when I attempted to have my figures automatically numbered using ~\ref..... commands in my .tex file

Robin Fairbairns Robin.Fairbairns at cl.cam.ac.uk
Tue Jan 15 18:07:40 CET 2013

Pat Somerville <l_pat_s at hotmail.com> wrote:

> Hello.  I tried to automatically number 
> figures using commands like "Fig.~\ref{....}" and in text and \label{...} 
> commands within figure environments in my .tex file.  I might have tried to 
> include figure captions within \caption and/or \parbox commands.  
> Anyhow, my figure numbers were incorrect in the figure captions.  
> Another variable is that I have been using both pdflatex and latex plus 
> latex2html commands in recent weeks; so there is a question whether I was 
> examining a Portable Document Format (.pdf) output file produced by a 
> pdflatex command or a .html file produced by executing a latex2html 
> command.  Recently I gave up on getting the figure numbers within captions 
> correct by attempting to have the figures automatically numbered via 
> the use of ~\ref{....} commands.---That is I numbered the figures myself 
> everywhere within a .tex file.  Would someone please guide me or refer 
> me to a guide of consistent \caption or \parbox commands together with 
> ~\ref{...} in text and \label{...} commands within figure environments for 
> automatic figure numbering in text that will enable both the figure numbers 
> within figure captions and the figure numbers within text to be correct?  A 
> desirable solution for the automatic numbering of figures within both the figure 
> captions and the text of a document would be one which would work in a .tex file 
> with either pdflatex or latex2html commands.

this is either totally trivial (sequence should always be

or totally impossible to diagnose with statements like

  I might have tried to include figure captions within \caption and/or
  \parbox commands.

captions would work within a \parbox but not with \caption.

tbh, this doesn't sound particularly specific to latex2html: i would
guess that if you feed rubbish to latex2html, you're _more_ likely to
get rubbish out than if you feed it to (la)tex.  in such a circumstance,
the (la)tex problem may be more amenable to comprehension.

the standard recommendation is that you produce a "minimal example" of a
problem.  this is described (for example) in
(there are different explanations all over the web).

post the minimal example and we might be able to help.  (those of us
owning crystal balls can probably see the solution without the minimal
example, but we ordinary mortals can only understand things that have

roibn (anag)

More information about the latex2html mailing list