# Renumber figures as they appear in text

I have two questions:

1. When I use figure*, LaTeX sometimes places the figure before its predecessor. Is there a way to automatically number the figures as they appear in the text?

2. On the other hand, is there a way to enforce the figures order? I tried to put \FloatBarrier before each figure, but it messed up the document. I don't mind it to float past a specific point, but I do want it to keep them in order.

• When you use *, you are letting LaTeX manage the placement. That is, you have given up control of order. \Floatbarrier is generally used to stop figures from moving out of a chapter, section, subsection, etc. but not order since LaTeX is making the best use of space. The figures are automatically numbered. What do you mean by is there a way to automatically number the figures as they appear? Aug 8 '13 at 15:23
• Latex decided on a certain order of figures: 4,1,3,2. I have no problem with the order or placement of the figures themselves, but I still would like to figure counter to increase monotonically, i.e. set a different numbering to the figures: 1,2,3,4. Aug 9 '13 at 3:21
• @ZoharLevi basically it's a bug, but we can't change the default figure placement as it would potentially affect every latex document. That is why the core latex distribution has the fixltx2e package that allows people to opt-in to certain fixed behaviour, without forcing incompatible changes on the existing archive of latex documents. Aug 9 '13 at 10:04

double and single column figures are kept in the correct order if you load the fixltx2e package.

Update

The ordering is correct by default for LaTeX releases from 2015/01/01.

• Works like magic! Aug 9 '13 at 3:22

You can "force" the figure placement by adding:

\begin{figure}[ht!]
...
\end{figure}


You can also use [H] as suggested in this post: Similar post

• The main effect of [ht!] is to prevent the use of float pages, so make it rather likely that that figure and all following ones go to the end of the document. Aug 8 '13 at 15:49
• I think it's the other way around... Since [ht!] prevents the use of float pages, the figure appears as close as possible to where it's called in the text. Aug 8 '13 at 16:06
• well because you use ! it masks the effect, but stopping p does not make t or b more likely so if you have a float that can not be placed t, stopping p just makes it go to the end. Aug 8 '13 at 16:33