floats,cross-referencing,captions,cleveref,apa7 – How to Fix Wrong Figure Caption and Number in APA 7 Style

apa7captionscleverefcross-referencingfloats

I'm trying to adjust the figure formatting style to the APA 7 style. So far I'm doing well, but now I got an issue. When cross-referencing a figure in the text, it appears as "Figure 1a" instead of as "Figure 1". See below:

enter image description here

\documentclass[12pt,english,oneside]{book}
\usepackage{babel}
\usepackage{graphicx}
\usepackage[utf8]{inputenc} 
\usepackage[labelformat=simple]{caption}
\usepackage[labelformat=empty]{subcaption}
\usepackage{hyperref}
\usepackage[noabbrev]{cleveref}

%-----------------------------------------------------------------
%   APA 7 FIGURES
%-----------------------------------------------------------------
\DeclareCaptionFormat{apa7figure}
{%
    \textbf{#1#2}\textit{\small #3}
}
\captionsetup{format=apa7figure, justification=raggedright,singlelinecheck=false}

\begin{document}
In order to undertand these concepts, please refer to \Cref{fig:objetocuadruple}

\begin{figure}[hp]
\caption[]{}
\subcaption[]{\textit{The quadruple object according to Graham Harman}}
\begin{center}
%\includegraphics[width=0.5\textwidth]{images/objeto-cuadruple-001.jpg}
\rule{\linewidth}{10em}
\end{center}
\footnotesize
\emph{Note:} Adapted from the \textit{Objetc-Oriented Ontology} witten by Harman on 2018.
\label{fig:objetocuadruple}
\end{figure}

Hope you can help me solve this problem. Thanks in advance!

Best Answer

(I updated this answer to incorporate some information provided by the OP via the comments.)

Let's look at the following code block:

\begin{figure}[hp]
\caption[]{}
\subcaption[]{\textit{The quadruple object according to Graham Harman}}
\begin{center}
%\includegraphics[width=0.5\textwidth]{images/objeto-cuadruple-001.jpg}
\rule{\linewidth}{10em}
\end{center}
\footnotesize
\emph{Note:} Adapted from the \textit{Objetc-Oriented Ontology} witten by Harman in 2018.
\label{fig:objetocuadruple}
\end{figure}

The incorrect cross-reference to the figure -- "1a" instead of just "1" -- is caused by the needless (and inappropriate) use of \subcaption. I believe that what you really want is

\usepackage{caption}
\captionsetup{labelfont=bf, textfont={it,small}, labelsep=newline,
              justification=raggedright, singlelinecheck=false}

in the preamble, followed by

\caption{The quadruple object according to Graham Harman}

inside the figure environment.


Remark: If the formatting of captions inside table environments should not be the same as that for figure environments, just (a) change

\captionsetup{...}

to

\captionsetup[figure]{...}

and (b) provide an appropriately designed

\captionsetup[table]{...}

instruction as well.


Here's a full MWE (minimum working example) and an associated screen shot.

enter image description here

\documentclass[12pt,oneside]{book}
\usepackage[english]{babel}
\usepackage[demo]{graphicx} % remove 'demo' option in real document
%%\usepackage[utf8]{inputenc} % that's the default nowadays

\usepackage{caption}
\captionsetup{labelfont=bf, textfont={it,small}, labelsep=newline,
              justification=raggedright, singlelinecheck=false}
              
\usepackage[colorlinks,allcolors=blue]{hyperref}
\usepackage[noabbrev,capitalize]{cleveref}

\begin{document}

In order to undertand these concepts, please refer to \cref{fig:objetocuadruple}.
\begin{figure}[htbp]
\caption{The quadruple object according to Graham Harman}
\label{fig:objetocuadruple}
\centering
\includegraphics[width=0.5\textwidth]{images/objeto-cuadruple-001}
\flushleft
\footnotesize
\emph{Note:} Adapted from \textit{Object-Oriented Ontology} (Harman, 2018).
\end{figure}

\end{document}