I am using pandoc to convert markdown to pdf, but I need to place some figures with more formating than the

so I use something like this:
# Document with figures
This document have figures but they appear before the title
\begin{figure}
\centering
{\includegraphics[width=2.5in]{some_figure.png}}
\caption{Comparing Dq from different p-model}
\end{figure}
and then I use the following command:
pandoc -H test_fig.sty test_fig.md -o test_fig.pdf
and test_fig.sty have:
\usepackage{graphicx}
the resulting pdf have first the figure and then the title.