[Tex/LaTex] Force LaTeX image to appear in the section in which it’s declared

floatspositioningsectioningsections-paragraphs

Possible Duplicates:
How do I ensure that figures appear in the section they're associated with?
Keeping tables/figures close to where they are mentioned

How can I force an image in a LaTeX documents to appear in the section in which I declared it?

I don't want that an image about "Section A" to appear in "Section F". 🙁

I actually include an image with

\begin{figure}[ht]
\begin{center}
\includegraphics[scale=0.7]{./img/RobotManipulator3D_WorkSpace.png}
\end{center}
\caption{3D View of the robotic workspace (in red).}
\label{Img:3DRobotWorkspace}
\end{figure}

Best Answer

Try \begin{figure}[!htb]. In nearly all cases it helps.

Explanation of the figure placement parameters:

  • h - Place figure here, if possible
  • t - Place figure at the top of a page
  • b - Place figure at the bottom of a page and
  • ! - Over-ride default LaTeX figure placement (do not use the parameter values).

If that doesn't work then use:

\usepackage[section]{placeins}

This prevents placing floats before a section.