Possible Duplicate:
Keeping tables/figures close to where they are mentioned
I have a .tex document which generates a several paged .pdf document. I have inserted several images of charts / graphs into the document like this:
\section*{section header}
\subsection*{sub section header}
\begin{figure}[htbp]
\centering
\includegraphics{C:/Documents/Samples/image 1.png}
\caption{A caption}
\label{fig:reference}
\end{figure}
What this produces in my multi-paged document is that the image appears on its own page and the section header and sub section header appear after the image despite being inserted before the image in the .tex document.
When I test this out as in a sample document:
\documentclass{article}
\usepackage{graphicx}
\usepackage{grffile}
\begin{document}
\section*{section header}
\subsection*{subsection header}
\subsubsection*{(i)}
\begin{figure}[htbp]
\centering
\includegraphics{C:/Documents/Samples/image 1.png}
\caption{A caption}
\label{fig:reference}
\end{figure}
\end{document}
I do not get this problem. It only seems to occur in my multi-paged document when the image is inserted either side of pages that would otherwise be filled with text.
The images have been inserted using the Insert > Picture option in TeXnicCenter toolbar.
Is there a way to make the graphic appear after the relevant section and subsection and not on its own page before the section and subsection?
[H]fromfloatpackage) too … – Tobi Sep 25 '11 at 14:03