I have a problem with images positioning. I dont know why but latex puts the last figure on a new page. I want it all at the same page. And I cant find what is wrong.
Here is my code:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[czech]{babel}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{epsfig}
\usepackage{subfig}
\usepackage[lighttt]{lmodern}
\usepackage[left=2.5cm,right=2.5cm,top=2cm,bottom=2cm]{geometry}
\usepackage{fancyhdr}
\newcounter{priklad}
\newenvironment{priklad}
{\refstepcounter{priklad}
\medskip
\textbf{Příklad \thepriklad .\ }}
\lhead{TEXT}
\pagestyle{fancy}
\begin{document}
\begin{priklad}
text-n-1
\end{priklad}
\begin{figure}[hbtp]
\subfloat[]{\includegraphics[height=3cm]{11.eps}}
\hspace{10pt}
\subfloat[]{\includegraphics[height=3cm]{16.eps}}
\hspace{10pt}
\subfloat[]{\includegraphics[height=3cm]{23.eps}}
\hspace{10pt}
\subfloat[]{\includegraphics[height=3cm]{14.eps}}
\hspace{10pt}
\subfloat[]{\includegraphics[height=3cm]{15.eps}}
\hspace{10pt}
\subfloat[]{\includegraphics[height=3cm]{12.eps}}
\end{figure}
\begin{priklad}
text-n-2
\end{priklad}
\begin{figure}[hbtp]
\includegraphics[height=1.8cm]{E.eps}
\hspace{20pt}
\subfloat[]{\includegraphics[height=1.5cm]{Eb.eps}}
\hspace{8pt}
\subfloat[]{\includegraphics[height=1.5cm]{Eano.eps}}
\hspace{8pt}
\subfloat[]{\includegraphics[height=1.5cm]{Ec.eps}}
\hspace{8pt}
\subfloat[]{\includegraphics[height=1.5cm]{Ed.eps}}
\hspace{8pt}
\subfloat[]{\includegraphics[height=1.5cm]{Ee.eps}}
\end{figure}
\begin{priklad}
text-n-3
\end{priklad}
\begin{figure}[hbtp]
\includegraphics[height=2.7cm]{7.eps}
\hspace{8pt}
\subfloat[]{\includegraphics[height=2.5cm]{7b.eps}}
\hspace{0pt}
\subfloat[]{\includegraphics[height=2.5cm]{7d.eps}}
\hspace{2pt}
\subfloat[]{\includegraphics[height=2.5cm]{7ano.eps}}
\hspace{4pt}
\subfloat[]{\includegraphics[height=2.5cm]{7c.eps}}
\end{figure}
\begin{priklad}
text-n-4
\end{priklad}
\begin{figure}[hbtp]
\includegraphics[height=4.2cm]{2u.eps}
\subfloat[]{\includegraphics[height=1.9cm]{2a.eps}}
\hspace{3pt}
\subfloat[]{\includegraphics[height=1.9cm]{2b.eps}}
\hspace{3pt}
\subfloat[]{\includegraphics[height=1.9cm]{2c.eps}}
\hspace{3pt}
\subfloat[]{\includegraphics[height=1.9cm]{2d.eps}}
\hspace{3pt}
\subfloat[]{\includegraphics[height=1.9cm]{2e.eps}}
\end{figure}
\end{document}
Would anyone know what may cause my problem?
\newenvironment
(defining the end code) it is not an error as it takes the blank line you have before\lhead
as the argument so defines teh end code to be\par
\includegraphics
?