0

For one of our journal submissions, the editorial office has sent us the following remark:

The singular "Fig" should be used when citing panels of the same figure, e.g. "Fig 3A and 3B" or "Fig 3A, 3B, 3C and 3D". The plural "Figs" should be used when the panels belong to different figures e.g. "Figs 3A and 4B", or "Figs 3A, 4B, 5C, and 5D".

We're using cleveref in the document, and the "panels" in the figures are different subfigures. This is what we're currently using to set up cleveref:

\usepackage[capitalise]{cleveref}
\crefformat{figure}{#2Fig~#1#3}
\Crefformat{figure}{#2Fig~#1#3}
\crefmultiformat{figure}{Figs~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}
\Crefmultiformat{figure}{Figs~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}
\crefmultiformat{subfigure}{Fig~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}
\Crefmultiformat{subfigure}{Fig~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}

Whatever is specified in the last two commands ("Fig" or "Figs") applies to all lists of subfigures, irrespective of whether they are from the same figure or not. Would someone know if it is possible to implement the convention required by the publishers? I did look at the cleveref documentation but couldn't figure out if this could be done simply by updating the cleveref configuration above.

Here's the MWE:

\documentclass{article}

\usepackage{csquotes}
\usepackage[aboveskip=1pt,labelfont=bf,labelsep=period,justification=raggedright,singlelinecheck=off]{caption}
\renewcommand{\figurename}{Fig}
\usepackage{subcaption}
\renewcommand{\thesubfigure}{\Alph{subfigure}}
\captionsetup[subfigure]{labelfont={sf,bf},labelsep=space,labelformat=simple,margin=-15pt,skip=-10pt,position=top}
\captionsetup[figure]{skip=5pt,labelfont={bf},position=bottom}
\usepackage[capitalise]{cleveref}
\crefformat{figure}{#2Fig~#1#3}
\Crefformat{figure}{#2Fig~#1#3}
\crefmultiformat{figure}{Figs~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}
\Crefmultiformat{figure}{Figs~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}
\crefmultiformat{subfigure}{Fig~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}
\Crefmultiformat{subfigure}{Fig~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}
\usepackage{graphicx}
\usepackage{mwe}


\begin{document}
\begin{figure}[!t]
  \centering
  \begin{subfigure}[c]{0.53\textwidth}
    \subcaption{}\label{fig:1a}%
    \includegraphics[width=\textwidth]{example-image}% Image from the mwe package
    \end{subfigure}\quad%
    \begin{subfigure}[c]{0.40\textwidth}
      \subcaption{}\label{fig:1b}%
      \includegraphics[width=\textwidth]{example-image}% Image from the mwe package
      \end{subfigure}
      \caption{Test figure 1}\label{fig:1}
\end{figure}

\begin{figure}[!t]
  \centering
  \begin{subfigure}[c]{0.53\textwidth}
    \subcaption{}\label{fig:2a}
    \includegraphics[width=\textwidth]{example-image}% Image from the mwe package
    \end{subfigure}\quad%
    \begin{subfigure}[c]{0.40\textwidth}
      \subcaption{}\label{fig:2b}%
      \includegraphics[width=\textwidth]{example-image}% Image from the mwe package
      \end{subfigure}\vspace{0.2cm}
      \caption{Test figure 2}\label{fig:2}
\end{figure}
\Cref{fig:1a,fig:1b} or \cref{fig:2a,fig:2b} should say \enquote{Fig} but \cref{fig:1a,fig:1b,fig:2a,fig:2b} should use \enquote{Figs}.

\end{document}

and here's the output:

enter image description here

3
  • 1
    The nuclear option is to use the syntax \cref[typeA]{fig1a,fig2b,fig3c}. See section 6 of the doc.
    – Symbol 1
    Commented May 14, 2021 at 16:11
  • @Symbol1 I get an error when I try this, do I need to load another package for this to work? The optional argument [type] seems only to work for the \label[type]{label} not \cref[type]{label} based on section 6 of the cleveref documentation Commented Nov 16, 2022 at 10:03
  • I have no idea what I was saying. I probably mean that you can \label[subfig]{fig1a} so cleveref knows it is a subfigure.
    – Symbol 1
    Commented Nov 17, 2022 at 3:37

1 Answer 1

1

You can resort to defining two languages, English, as the default, and another (I choose Dutch), and then change the caption by selecting the secondary language.

b

Add to the preamble

%% ***************************************** added
\usepackage[dutch, english]{babel}
\makeatletter
\addto\captionsdutch{%
\crefmultiformat{subfigure}{Figs~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}
\Crefmultiformat{subfigure}{Figs~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}
}
\addto\captionsenglish{%
\crefmultiformat{subfigure}{Fig~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}
\Crefmultiformat{subfigure}{Fig~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}
}
\makeatother    

\newcommand{\crefx}[1]{% <<<<<<<<
    \selectlanguage{dutch}%
        \cref{#1}%
    \selectlanguage{english}% 
}
%% ***************************************** added

and use the command \crefx

This is the complete code.

\documentclass{article}

\usepackage{csquotes}
\usepackage[aboveskip=1pt,labelfont=bf,labelsep=period,justification=raggedright,singlelinecheck=off]{caption}
\renewcommand{\figurename}{Fig}
\usepackage{subcaption}
\renewcommand{\thesubfigure}{\Alph{subfigure}}
\captionsetup[subfigure]{labelfont={sf,bf},labelsep=space,labelformat=simple,margin=-15pt,skip=-10pt,position=top}
\captionsetup[figure]{skip=5pt,labelfont={bf},position=bottom}

\usepackage[capitalise, english]{cleveref}% <<<<<<<<<<<<<<

\crefformat{figure}{#2Fig~#1#3}
\Crefformat{figure}{#2Fig~#1#3}
\crefmultiformat{figure}{Figs~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}
\Crefmultiformat{figure}{Figs~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}
\crefmultiformat{subfigure}{Fig~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}
\Crefmultiformat{subfigure}{Fig~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}

\usepackage{graphicx}
\usepackage{mwe}

%% ***************************************** added
\usepackage[dutch, english]{babel}
\makeatletter
\addto\captionsdutch{%
\crefmultiformat{subfigure}{Figs~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}
\Crefmultiformat{subfigure}{Figs~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}
}
\addto\captionsenglish{%
\crefmultiformat{subfigure}{Fig~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}
\Crefmultiformat{subfigure}{Fig~#2#1#3}{ and~#2#1#3}{, #2#1#3}{, and~#2#1#3}
}
\makeatother    

\newcommand{\crefx}[1]{% <<<<<<<<
    \selectlanguage{dutch}%
        \cref{#1}%
    \selectlanguage{english}% 
}
%% ***************************************** added

\begin{document}
\begin{figure}[!t]
    \centering
    \begin{subfigure}[c]{0.53\textwidth}
        \subcaption{}\label{fig:1a}%
        \includegraphics[width=\textwidth]{example-image}% Image from the mwe package
    \end{subfigure}\quad%
    \begin{subfigure}[c]{0.40\textwidth}
        \subcaption{}\label{fig:1b}%
        \includegraphics[width=\textwidth]{example-image}% Image from the mwe package
    \end{subfigure}
    \caption{Test figure 1}\label{fig:1}
\end{figure}

\begin{figure}[!t]
    \centering
    \begin{subfigure}[c]{0.53\textwidth}
        \subcaption{}\label{fig:2a}
        \includegraphics[width=\textwidth]{example-image}% Image from the mwe package
    \end{subfigure}\quad%
    \begin{subfigure}[c]{0.40\textwidth}
        \subcaption{}\label{fig:2b}%
        \includegraphics[width=\textwidth]{example-image}% Image from the mwe package
    \end{subfigure}\vspace{0.2cm}
    \caption{Test figure 2}\label{fig:2}
\end{figure}

\Cref{fig:1a,fig:1b} or \cref{fig:2a,fig:2b} should say \enquote{Fig}       

\crefx{fig:1a,fig:1b,fig:2a,fig:2b} should use \enquote{Figs}. % <<<<<<<<<<<<<< changed     

But not \enquote{Fig} like in  \cref{fig:1a,fig:1b,fig:2a,fig:2b}       
    
\end{document}

NOTE cleveref needs to be tell the default language when using babel:

\usepackage[capitalise, english]{cleveref}%

1
  • Thanks @simon-dispa. I was hoping to figure out a way where one didn't need to use different commands and remember where they need to be used but this seems to be the best/simplest workaround at the moment.
    – FranciscoD
    Commented May 17, 2021 at 10:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .