I have a giant document based on memoir class and tightly integrated with its subfigure infrastructure - i.e. adding packages like subfloat/subfig/subcaption is extremely undesirable (AFAIK it’s possible to solve my problem with subcaption).

The publisher SUDDENLY demanded me to make all subfigures and their reference labels to look like this: example i.e. subcaptions consist of an italicized letter only, and the reference inside text has said letter separated from the figure’s number with a comma and a space.

The best I could come up with is to redefine thesubfigure, but it messes up the subcaptions.

I read the cleveref documentation, being sure that there is some hook to define how the in-text reference label is rendered, but couldn't find anything.




% Figure settings - just in case some of the solutions you might want to offer conflict with these
    \renewcommand{\figurename}{Fig.} % changed for simplicity
    \captiondelim{. }
    \SCFigFont % turn on the needed font for everything that happens to be in the figure
    \renewcommand{\baselinestretch}{1} % ditto for line spacing

% Subfigure settings

% The closest thing to a solution that I could find


\chapter{Chapter name}

    \caption{Example images: \subcaptionref{img:image-a} --- image A; \subcaptionref{img:image-b} --- image B}

We can see the A image in~\cref{img:image-a};
the B image in~\cref{img:image-b};
and both images in~\cref{img:images}.

%We can see the A image in~\cref{img:images},~\textit{a};
%the B image in~\cref{img:images},~\textit{b};
%and both images in~\cref{img:images}.


Following your last commented-out text, something along these lines?

We can seen the A image in~\cref{img:images},~\subcaptionref{img:image-a};
the B image in~\cref{img:images},~\subcaptionref{img:image-b};
and both images in~\cref{img:images}.
  • Thanks, but I would expect LaTeX to be able to automate this. The whole point of using it to me is being able to solve problems like these by editing a couple lines in the preamble, instead of walking through hundreds of pages and replacing brief \cref commands with cumbersome, error-prone, and rigid manual ones. – ScumCoder Nov 24 '19 at 19:36

Forget it, I'm just dumb. While reading the very answer I myself have linked, for some reason I thought that the \p@subfigure macro is part of the subcaption package (which I don't want to use) - as opposed to an utterly normal LaTeX macro. So, here's all that I needed to do in order to achieve desired result:


Thanks again to Mico for explaining me how the \p@-counters work.

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.