Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Keeping tables/figures close to where they are mentioned

I want to make it like this:

text
image
text
image

But even if I put [h!] to the position the figures, the figure is moved to the next page because it is too large. The text which should be under the figure goes up over it!!!

How I can fix it?

share|improve this question

migrated from stackoverflow.com Jun 3 '11 at 9:22

This question came from our site for professional and enthusiast programmers.

marked as duplicate by lockstep, Caramdir, Martin Scharrer Jun 5 '11 at 9:31

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

1 Answer

up vote 9 down vote accepted

You can use \FloatBarrier from the placeins package to prevent floats (figures) pass some point such as start of the text that follows. For example:

\documentclass[12pt]{article}
\usepackage{graphicx}
\usepackage{placeins}
\begin{document}
Text
\begin{figure}[h!]
\includegraphics{pic1.jpg}
\end{figure}
\FloatBarrier
Text
\begin{figure}[h!]
\includegraphics{pic2.jpg}
\end{figure}
\FloatBarrier
Text
\end{document}
share|improve this answer
    
thanks a lot - that is what I was looking for :) –  user606521 Jun 3 '11 at 9:43
    
It will be more flexible if we omit the file extension. –  xport Jun 3 '11 at 9:47
add comment

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