[Tex/LaTex] How to place the figures in LaTeX document

floatspositioning

Although I am putting the figures after some subsection, they do not appear in which I am putting in them.

Best Answer

Alan Munn posted a link to Keeping tables/figures close to where they are mentioned. Here's some code showing a way mentioned there, using the placeins package:

\usepackage{placeins}
...
\FloatBarrier
\subsection{A subsection}
...
\begin{figure}[ht]
% your figure
\end{figure}
...
\FloatBarrier
\subsection{Another subsection}

The \FloatBarrier command prevents floating of the figure into another subsection.