2

I am trying to control the position of the figure. I would like to place it right below the title of paragraph, but it does not work.

When I add a text right below the \paragraph, the figure moves below the title as I wish. So I tried some of my ideas such as \phantom, \vspace and things like that to create invisible spacing. But it did not work that way.

Could you help me fix this issue?

P.S., I would also like to make the text start in the next line, instead of starting in the same line with the paragraph. Linebreaking functions did not work..

enter image description here

 \paragraph{[2] xxx}
 \begin{figure}[h!]
 \centering
 \includegraphics[width=0.9\textwidth]{P2.png}
 \caption{\label{fig:frog}This is a figure caption.}
 \end{figure}
  • the only reason to use figure is to take the content out of the main document flow so that is a float that may be re-inserted at a different place to helpwith page breaking. – David Carlisle Dec 03 '18 at 00:22
  • but probably https://tex.stackexchange.com/questions/8625/force-figure-placement-in-text – David Carlisle Dec 03 '18 at 00:22

1 Answers1

1

I used sub-paragraph to make the text start in the next line, instead of starting in the same line with the paragraph.

I have used the following packages and reduced the size of the picture to fit it in the same page. If you are keeping the size same, it still remains below the paragraph but maybe in the following page. Hope my answer helps.

\documentclass{article}
\usepackage{graphicx}
\usepackage{float}

\begin{document}

    \section{Section}

    Hello

    \paragraph{Paragraph}

    \subparagraph{}

     \begin{figure}[H]
        \centering
        \includegraphics[width=0.7\textwidth]{"example3".png}
        \caption{\label{fig:frog}This is a figure caption.}
     \end{figure}

\end{document}

enter image description here

Lily G
  • 111