3

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? – dustin 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. – Zohar Levi Aug 9 '13 at 3:21
  • 1
    @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. – David Carlisle Aug 9 '13 at 10:04
5

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! – Zohar Levi Aug 9 '13 at 3:22
0

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

For more detailed information on figure placement, see post: More info

  • 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. – David Carlisle 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. – Nicolas Aug 8 '13 at 16:06
  • No. That's not how it works. – David Carlisle Aug 8 '13 at 16:07
  • My bad in that case ... But that's the experience I've had so far when using it ... – Nicolas Aug 8 '13 at 16:11
  • 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. – David Carlisle Aug 8 '13 at 16:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.