0

I am relatively new to Latex, and I have a report I need to write. One common thing in my report is the use of figures surrounded around text (some text, a figure, some additional text). The issue I am having is that the initial text and figure are correct, but instead of the additional text being placed after the figure, the additional text starts right after the initial text. How can I fix it so I have the text, my figure, and the additional text start right after the figure? Thanks!!

Below is the code I have surrounding the issue:

\indent Figure \ref{fig:dabtree} shows an example of two parent states connecting to the same child state through actions.\\
\begin{figure}[h!]
  \centering
  \includegraphics[width=0.5\textwidth]{Figures/dabtree.png}
  \caption{Two parent nodes connecting to the same child node through separate actions}
  \label{fig:dabtree}
\end{figure}
\indent A node that has multiple actions leading to it is called a transposition [4].

Which looks like:

enter image description here

I realize that there is not enough space for the figure to it on the end of the page, which is fine, but I need the text itself to logically start after the figure. Also, I will remove the indents (thanks).

  • 1
    Welcome to TeX SX! Probably there is not enough space at the bottom of the page for your figure, so it is placed at the top of the next page. Perhaps try inserting its code a few paragrahs before with placement specifier [!hb], or reorganise your text. – Bernard Apr 25 '19 at 21:03
  • 1
    note that the only purpose of the figure environment is to specify its content is a float that may be moved to help with page breaking. – David Carlisle Apr 25 '19 at 21:09
  • 1
    You should never need \indent in latex, if you want to start a new paragraph, just leave a blank line before the text. – David Carlisle Apr 25 '19 at 21:14
  • 1
    You can use the float package to implement [H], or equivalently replace figure with a minipage and \caption with \captionof from the caption or capt-of packages. You might also use \setlength{\parskip}{0pt plus 1fil} to distribute the ugly gaps more evenly. – John Kormylo Apr 25 '19 at 23:00

0 Answers0