我正在尝试将图形格式样式调整为 APA 7 样式。到目前为止,我做得还不错,但现在我遇到了一个问题。在文本中交叉引用图形时,它显示为“图 1a”,而不是“图 1”。见下文:
\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}
希望您能帮助我解决这个问题。提前谢谢!
答案1
(我更新了这个答案,以纳入 OP 通过评论提供的一些信息。)
我们来看看下面的代码块:
\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}
对图的错误交叉引用——“1a”而不是“1”——是由于不必要(和不恰当)使用造成的\subcaption
。我相信你真正想要的是
\usepackage{caption}
\captionsetup{labelfont=bf, textfont={it,small}, labelsep=newline,
justification=raggedright, singlelinecheck=false}
在序言中,随后
\caption{The quadruple object according to Graham Harman}
在环境内部figure
。
备注:如果环境内的标题格式table
与环境的格式不同figure
,只需(a)更改
\captionsetup{...}
到
\captionsetup[figure]{...}
(b)提供适当设计的
\captionsetup[table]{...}
指令也是如此。
这是完整的 MWE(最小工作示例)和相关的屏幕截图。
\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}