I'm able to include an image where I want if I use the following code
\section{foo}
...content
\includegraphics[width=\textwidth]{images/blockchain.png}
...more content
However I'd like to have a caption for my image so I have replaced the includegraphics with the following
\begin{figure}[!htbp]
\centering
\includegraphics[width=\textwidth]{images/blockchain.png}
\captionsetup{justification=centering}
\caption{An illustration of blockchain (own image)}
\label{fig:blockchain}
\end{figure}
When I do this the image goes to the bottom of the entire document, after the references.
I've tried a few different positioning parameters with no lock. I also tried to include the float package and a [H] parameter.
Ideally I'd like to keep it where I put the block but even if it was within the section I'd be happy.
I'm using overleaf if that has any bearing.
Edit Below is the structure of my document
\documentclass[letterpaper,man,natbib]{apa6}
\usepackage[natbibapa]{apacite}
\usepackage{graphicx}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\title{title content}
\shorttitle{short title content}
\author{name}
\affiliation{foo}
\begin{document}
\maketitle
\section{Introduction}
paragraph
paragraph
\section{How blockchain works}
paragraph
\begin{figure}
\centering
\includegraphics[width=\textwidth]{images/blockchain.png}
\caption{An illustration of blockchain (own image)}
\label{fig:my_label}
\end{figure}
paragraph
\section{Applications}
\subsection{s1}
paragraph
\subsection{s2}
paragraphon{The role of blockchain in Smart Contracts}
Role
\bibliography{ref}
\bibliographystyle{apacite}
\end{document}
figureis to allow it to be moved, so moving isn't that much of a surprise (it will not move if you use[H]) but without a test document it is impossible to debug why it moves to any place as it depends on so many factors not shown – David Carlisle Mar 04 '20 at 21:35example-imageas the image as it is available for tests like this) – David Carlisle Mar 04 '20 at 21:49example-imageyou will see in the log and terminalAED endfloat:that is your document class is enforcing a journal style that has all figures at teh end, so it is by design. – David Carlisle Mar 04 '20 at 21:52\documentclass[letterpaper,man,natbib,floatsintext]{apa6}– Fran Mar 04 '20 at 21:53