[Tex/LaTex] Change subcaption label format

cleverefmemoirsubcaptionsubfloats

I need to have subcaption labels (and references) be of the format

Fig. 1a

Instead of the default "(a)", and be able to reference them with \cref

Unfortunately, I can't seem to get any subcaption related commands change the format of the subcaption "label" (is that the correct name for this?)

This is as close as I can get (while still having \cref work for normal, non-subfigure figures).

As you can see, I'm using memoir. The problem with the below code is that the references using \cref start with the figure counter (the first "1" below), and I can't seem to get rid of it. I understand this is the wrong way to handle it (I change the counter to include a name/label instead of changing the caption format). Any proper solution is very welcome, failing that, a hack to fix my hack is welcome as well!

\documentclass{memoir}

\usepackage{hyperref}
\usepackage[nameinlink]{cleveref}

\newsubfloat{figure}

\renewcommand{\thesubfigure}{Fig. \arabic{figure}\alph{subfigure}}
\renewcommand{\thefigure}{\arabic{figure}}

\crefformat{subfigure}{#2{}#1{}#3{}}

\begin{document}
\begin{figure}
\subbottom[first subfigure \label{fig:first}]{\fbox{Numero uno}}
\subbottom[second subfigure \label{fig:second}]{\fbox{Numero dos}}
\end{figure}
\cref{fig:first}

\cref{fig:second}
\end{document}

enter image description here

EDIT it seems also that if I don't use \caption the figure number isn't incremented and a following normal figure will use the same figure number. Is there an automated way to change this behaviour? Currently, I'm adding a \addtocounter{figure}{1} in each subfig only figure, which has the desired effect.

Best Answer

This is quite an unusual request/demand. Here is one solution, but it probably will make a mess at normal use of figure referencing:

\documentclass{memoir}

\usepackage{hyperref}
\usepackage[capitalise]{cleveref}

\newsubfloat{figure}
\renewcommand{\thesubfigure}{Fig.~\arabic{figure}\alph{subfigure}}

\crefformat{subfigure}{#2#1#3}
\begin{document}
\begin{figure}[h]\centering
     \renewcommand{\thefigure}{} 
\subbottom[first subfigure  \label{fig:1}]{\fbox{figure numero uno}}
    \hfil
\subbottom[second subfigure \label{fig:2}]{\fbox{figure numero dos}}
    \stepcounter{figure}
\end{figure}
    some text
\begin{figure}[h]\centering
     \renewcommand{\thefigure}{} 
\subbottom[first subfigure  \label{fig:3}]{\fbox{figure numero uno}}
    \hfil
\subbottom[second subfigure \label{fig:4}]{\fbox{figure numero dos}}
   \stepcounter{figure}
\end{figure}
some text
\begin{figure}[h]\centering
\fbox{some "normal" figure}
    \caption{normal figure}
    \label{fig:5}
\end{figure}

\cref{fig:1} and \cref{fig:4} and also \cref{fig:5}
\end{document}

enter image description here

Edit: Desired look-out is achieved by use \renewcommand{\thefigure}{} in each float with subfigures and \stepcounter{figure} before end of figure float. Now I hope is fulfilled your requests.