I need to get Figure 1.1 (a) when i put \Cref{fig:NiceImage1}
.
I have to use \Cref{fig:NiceImage}\subref{fig:NiceImage1}
for getting same result.
\documentclass{scrbook}
\usepackage[demo]{graphicx}
\usepackage{subcaption}
\captionsetup{subrefformat=parens}
\usepackage{cleveref}
\setcounter{chapter}{1}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}{0.31\textwidth}
\includegraphics[width=\textwidth]{image1}
\caption{Nice image1}
\label{fig:NiceImage1}
\end{subfigure}
\begin{subfigure}{0.31\textwidth}
\includegraphics[width=\textwidth]{image1}
\caption{Nice image 2}
\label{fig:NiceImage2}
\end{subfigure}
\begin{subfigure}{0.31\textwidth}
\includegraphics[width=\textwidth]{image1}
\caption{Nice image 3}
\label{fig:NiceImage3}
\end{subfigure}
\caption{
\label{fig:NiceImage}
Three images}
\end{figure}
Figure \ref{fig:NiceImage}
Figure \ref{fig:NiceImage} \subref{fig:NiceImage1}
\Cref{fig:NiceImage}
\Cref{fig:NiceImage1}
\end{document}
Best Answer
Add the following lines to your preamble and
\Cref{fig:NiceImage1}
will display "Figure 1.1(a)"The complete code is below: