I make two pictures with TikZ in two figures at top of each secion.
I refer their position at the end of each section.
Can you suggest a way to move them arbitrarily?
My problem is lables
They should make before using them.
Here is my entire code to show an example of a table (splited by lines) which forced me to locate the figure at the beginning of the section:
\documentclass{article}
\usepackage[a4paper]{geometry}
% and other necessary packages
\begin{document}
\section{جلسه اول}
\begin{figure}
\centering
\subfloat[سوال اول و دوم]{\label{fig:J55VH}
\begin{tikzpicture}
\filldraw [black] (.5,.5) rectangle (.75,.75);
\foreach \x in {.125,.375,...,1.125}
\foreach \y in {.125,.375,...,1.125}
\draw (\x,\y) +(-.125,-.125) rectangle ++(.125,.125);
\end{tikzpicture}}
\caption{جلسه اول(خانههای مشکی حذف شدهاند.)}
\end{figure}
\begin{prob}
شکل
\ref{fig:J55VH}
را با تعداد کافی از مهرهی
\ref{fig:LP}
بپوشانید.
\end{prob}
\begin{prob}
شکل
\ref{fig:J55VH}
را با تعداد کافی از مهرهی
\ref{fig:3t1}
بپوشانید.
\end{prob}
\end{document}
figureenvironment does not depend on its contents (tikzin this case) so I think your question is just about floats not abouttikz, it's not really clear where you want the figure to appear? In particular if you want it to come at the end of the section can you not just place the figure environment at the end rather than the start? Please always provide complete (small) documents that demonstrate the issue, it is hard to comment on figure positioning just given a fragment. – David Carlisle Jan 2 at 7:53\refbefore the figure that defines the label, LaTeX will resolve the reference on the second run. – David Carlisle Jan 2 at 8:04