2

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}
9
  • 2
    the only reason to use figure is 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 Mar 4 '20 at 21:35
  • 1
    Please provide complete, compilable small document which reproduce your problem. From your code fragment we cant say anythivh what you doing wrong.
    – Zarko
    Mar 4 '20 at 21:36
  • 1
  • 1
    The symptom is that LaTeX cannot place that figure in any of the previous pages for some reason (too many tables, for instance), but without a MWE showing what is wrong is not possible to give you a clue to make it right, except that you can use captions without floats with the help of some packages. See ctan.org/pkg/caption
    – Fran
    Mar 4 '20 at 21:45
  • 1
    No sorry it does not help at all, as the positioning of the figure depends on the actual size of the images, the amount of text that needs to be on the page, the document settings etc, so you need to make an actual document that we can run that shows the problem (you can use example-image as the image as it is available for tests like this) Mar 4 '20 at 21:49
4

You are using apa6 document class which enforces the house style of the APA.

The class manual (texdoc apa6) says in section 5.2 Float Placement :

The 6th Edition requires that tables and figures (in that order) be placed after the references but before the appendices.

That is, in this document class the float placement option is ignored and figures are always inserted at the end.

However the class has a [floatsintext] option to over-ride this in manuscripts.

1
  • Thanks again David, I've been trying to figure that out for about 2 hours!
    – Peck3277
    Mar 4 '20 at 21:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.