I have created my latex code with a "main" tex file, in which I am calling many other sub-files using the below command.
\subfile{"Path1"}
\subfile{"Path2"}
\subfile{"Path3"}
In each subfile, I have written my text and presenting tables and figures. I have stored each table and figure in a separate file in order to keep my subfiles organized. Thus, I am calling the tables and figures using a code like below:
\input{"FigPath1"}
\input{"TabPath1"}
Some of the figures are created using pgfplots. Although I am asking latex to put the figures exactly where I want (each figure file has a structure like below,) they appear 5 or 6 pages after where they have to appear. What is the problem in your opinion?
\begin{figure}[!htbp]
\centering
\subfloat[Constraints]{
\begin{tikzpicture}[scale=0.75, transform shape]
% Some codes here
\end{tikzpicture}
}
\subfloat[Variables]{
\begin{tikzpicture}[scale=0.75, transform shape]
% Some codes here
\end{tikzpicture}
}
\end{figure}
Hopefully, my explanations make sense! Thanks in advance.
\usepackage[section]{placeins}in the preamble or use\FloatBarrierat point before it which you like to have your images. – Zarko May 03 '21 at 22:37