3

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!

1 Answer 1

4

(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}
5
  • Dear Mico thanks, but I'm 100% sure that's what I want. I need to follow APA 7 rules, where Figure # goes first without any other text attached. Next goes the figure title in italics. Then you place the figure and, if necessary, add notes at the end. So, I had to rely on that solution to comply with the APA 7 rules. More info here: normas-apa.org/wp-content/uploads/normas-apa-ejemplo-figura.png Aug 2 at 5:07
  • 1
    @killthepixelnow -- It is most certainly the \subcaption expression that's causing the numbering problem. Why are you using \subcaption? Is it the fact that you need a line break between "Figure 1" and the actual caption text? If so, the caption package affords a much better method to achieve this formatting goal. Please advise.
    – Mico
    Aug 2 at 5:09
  • 1
    thanks for the explanation. I'm using \subcaption because that's the only way I found to separate Figure 1 from the caption itself. That means I need "Figure 1" to stand alone without any other text to the right (e.g. Figure 1: this is the caption). In APA 7 the figure title goes below "Figure 1." Any idea how to solve or fix that? Aug 2 at 5:19
  • 1
    @killthepixelnow - Please see my revised answer. It does away with the subcaption stuff entirely, while being way more detailed in terms of \captionsetup.
    – Mico
    Aug 2 at 5:28
  • 1
    That was exactly what I was looking for. Thanks, it's a cleaner solution and now I don't have more problems regarding the numbering. Aug 2 at 5:40

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.