Graphics, Figures & Tables ⇒ Float Placement
Float Placement
I'm using "PhD/MPhil Thesis - a LaTeX Template" of University of Cambridge http://www-h.eng.cam.ac.uk/help/tpl/tex ... esisStyle/.
I’ve been plagued by misplaced figures in a paper I’m writing. I wrote some pseudo-code of algorithms and would like to end each of them by for example "Figure 1.1: blabla", "Figure 1.2: blablabla" , and so on. But when I'm using this \begin{figure}[] ...\end{figure} I got the figure 1.1 on the top of my algorithm (preview page not in the same page). I've tried \newpage, \pagebreak,\samepage and \vfill\eject after each figure, as well as \begin{figure}[p], and many combinations of the above, but none of them worked. Latex still put the name of the algorithm (figure 1.1:) not in the same page and not on the bottom of the algorithm.
To write the algorithm I used this: \usepackage{algorithm \usepackage{algorithmic}.
Is there something like compatibility between those packages and figure environment ? I need your help ! This is for my thesis.
Thanks
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
Float Placement
how do you write your algorithms? Which package do you use for it? Perhaps post a small example which shows what you are doing, so we can check it. Otherwise it's hard to guess, just from a description without details and code.
If you use figure environments, use the algorithm within. If you don't want figures to float, don't use this environment. algorithm packages offer caption commands, or use the caption package.
Note, if you use figures, you can use more placement options beside p, such as [!htbp] or less. Also, \clearpage forces output of figures, and the command \FloatBarrier of the placeins package can help to restrict floating. More fore example here: Prevent floating of figures or tables.
Stefan