0

I am writing in Latex. I am new with it and need some help. I need to add figures. I can do it with the following code:

\begin{figure}[h]
    \includegraphics[width = 15cm]{figures/mlpStrSingle}
    \caption{MLP neural network for one single output node}
    \label{fig:mlp}
\end{figure}

However, if I use this the figure goes to the next page. I need it right after the text, then the next text should start. How can I do that?

Mensch
  • 65,388
  • 2
    Welcome to TeX.SE! Simply do not use the floating environment figure, for the caption load package caption and use command captionof{figure} ... As usual here please make your code snippet compilable, then we do not have to guess what you are doing ... – Mensch Jun 30 '19 at 17:32
  • 1
  • 2
    Be aware that LaTeX defines floating environments such as figureand table so it can place them in the best possible way according to its criteria. Forcing the placement may result in large white spaces in your document. – Bernard Jun 30 '19 at 17:36
  • 1
    If you don't want your image to move away, you could use \begin{center}\includegraphics[width = 15cm]{figures/mlpStrSingle} \captionof{figure}{MLP neural network for one single output node} \label{fig:mlp} \end{center}. You will need the caption package or this to work. – leandriis Jun 30 '19 at 17:41
  • @leandriis thanks. that worked out – TheTechGuy Jul 07 '19 at 14:14

0 Answers0