# float placement using endfloat

I have a lyx file in which there are several figures and tables. The preamble has been amended to have:

`````` \usepackage{multirow}
\usepackage{rotating}
\usepackage{subfig}
\usepackage{longtable,lscape}
\usepackage[nolists,tablesfirst]{endfloat}
\usepackage{caption}
\captionsetup[table]{skip=20pt}
``````

When I added a new figure after all my other figures, in the lyx screen it numbers it Figure 5. However, when I actually export to PDF LaTeX seems to number it Figure 1. Any ideas on this? This latest figure is an eps graphic. The other figures are all pdf documents.

EDIT: Interesting: I figured out the issue (or atleast what fixes it). This figure was specified to be sideways. Once I removed that the ordering became correct. Any ideas what's going on?

-
Can you please build a minimal working example illustrating the problem? Nothing too complicated; document class used and a couple of figures; one of them a "regular" figure and the other one with the sideways specification. In this way we can reproduce your problem and detect the cause of the problem. –  Gonzalo Medina Oct 9 '12 at 1:31
Note that LyX is just a front-end or editor. So its placement of floats is usually different (and not floating at all). During compile time, TeX does its magic to optimize the float placement. `sidewaysfigure`s usually land on a page of floats, which could even further disturb the difference between the editor and the output. –  Werner Oct 9 '12 at 4:21
yes, attempting to produce example but it seems a simple example is not working to illustrate my problem. will post something as soon as i get it "working" –  Alex Oct 9 '12 at 21:40

I had a similar problem and the following solution worked for me: add `\DeclareDelayedFloatFlavor{sidewaystable}{table}` `\DeclareDelayedFloatFlavor{sidewaysfigure}{figure}` to the preamble (Document - Settings - LaTeX Preamble in LyX). Then endfloat "grabs" (not the right term I'm sure) sideways floats and puts them in the right order. –  user21155 Feb 28 at 16:30
PS - it appears that LyX adds the `rotfloat` package when you insert a sideways table through LyX, but if you were including the table manually (i.e. entering LaTeX code directly), I suppose you would have to add the package manually as well. –  user21155 Feb 28 at 16:36