Is there a way to get LaTeX to place figures and tables in the order they are referenced in the text?
I think this question is novel. Here is the problem I have. I have a relatively short piece of text associated with a lot of figures and a table. I want floats to appear on pages just for floats but in the order I specify. I have set all of the table and figure parameters to [hp] and placed them in the order I want them to appear in the source e.g.
Figure 1
Figure 2
Figure 3
Table 1
Figure 4
Figure 5
The problem I have is th开发者_如何转开发at no matter what I do the document typesets like this
Table 1
Figure 1
Figure 2
etc....
I have tried trashing the Aux files before typesetting. I am aware of the endfloats package but I still want latex to place the floats in between larger sections of txts in other parts of the document. Any help is greatly appreciated.
Thanks
I'll try to explain why the fix by @user476160 (placement modifier hp
instead of just p
) works. A figure
is a float, i.e. an element that cannot be broken across a page. The figure
environment accepts a parameter list with placement hints:
\begin{figure}[placement parameters]
% ...
\end{figure}
The placement specifier h
stands for here and places the figure approximately at the same point as in the source text. The placement specifier p
puts the figure
in a special page that contains only floats:
\begin{figure}[hp]
% ...
\end{figure}
Wikibooks has an excellent article on figure placement if you want to fine-tune your figure and table placement.
I also recommend posting LaTeX-related questions in the TeX Stack Exchange Q&A.
Problem solved, the first figure in my list had the parameter [p] rather [hp]. This seemed to cause latex a lot of grief for some reason. Anyhow problem solved for now. The figures and txt all appear in the order I have specified.
It is quite easy. All you have to do is use this package.
\usepackage{float}
And you have to change the figure parameters to
\begin{figure}{H}
%..
\end{figure]}
Let me know if it works :)
精彩评论