tags:

views:

307

answers:

4

I have a few equations that appear in a floating figure. Unfortunately, the corresponding equation numbers are assigned assuming that the float (and hence the equations) appear in the position that the float was defined. Conceptually, a page will appear like this:

equation #1
figure begins
  equation #2
figure ends
equation #3

But if latex floats the figure to the top of the page, then I would like it to be numbered like this:

figure begins
   equation #1
figure ends
equation #1
equation #2

Is it possible to get Latex to do this?

A: 

Not sure, but probably not. In your second example, two equations are numbered as #1. I don't know the context, but you should consider not numbering the equation in the figure (or not put an equation in a figure), or overriding the standard label for the equation (by using the \tag command from the AMS packages)

Martijn
+1  A: 

One way round this would be just to use unnumbered equation inside the float, and then refer to it by saying "the equation in figure \ref{fig:foo}"

Seamus
Indeed, many technical editors would consider having a numbered equation (or any content which must be referenced from the text) in a figure caption to be bad style.
dmckee
A: 

make your figures not float by adding the array package \usepackage{array}

then tell latex you want your figure exactly where it is in the code:

\begin{figure}[H]
blah blah figure
\end{figure}
Mica
I generally discourage this, but it pushes the work of laying out the page back on the author: TeX is better at that than most people. Do it if you *must*, but avoid it if you *can*.
dmckee
It has generally worked pretty well for me. I do agree with you though, but if you absolutely *must* have your figures in a specified order, this is the best way I've found of doing it. If you have a better way, I'm all ears :P
Mica
A: 

I suggest that after the document is finished you move the code for the figure into the same place it appears in the output. I'm not aware of any automatic means that this can be done (although I haven't looked into it, I'm fairly sure that it would be quite a difficult problem).

Will Robertson