# Capitalise letter when using cref (cleveref) for subfig

Is it possible to have cleveref capitalise the letter when cross referencing a subfigure?

Currently my subfigures are configured to capitalise the letter in a subfig (i.e A B C D E) but when i use the \cref command it will generated Fig. 1a.

Here is MWE:

\documentclass[a4paper]{article}
\usepackage{subcaption}
\usepackage{caption}
\captionsetup{justification=centerlast,font=small,labelfont=sc,margin=50pt}
\usepackage[capitalise]{cleveref}

\begin{document}

\begin{figure}
\centering
\subcaptionbox{\label{subfig:Test1}}[0.49\textwdith]{\includegraphics[width=0.49\textwidth]{Fig.png}}
\subcaptionbox{}[0.49\textwdith]{\includegraphics[width=0.49\textwidth]{Fig2.png}}

I would like this cross reference to show a capital 'A' rather than a lower case: \cref{subfig:Test1}.

\end{document

• Can you please add a minimal example of what you're doing up to now? Dec 18 '19 at 16:56
• @egreg I have added the MWE Dec 19 '19 at 10:16

The problem is that you are not labelling the subfigures with a capital letter, but labelling with a small letter and then printing it in the caption with the small caps font. If you wish to use the small caps font for this label then rather than (or in addition to) setting the labelfont you should redefine the printing of the subfigure label via

\renewcommand{\thesubfigure}{\scshape\alpha{subfigure}}


so this formatting is used elsewhere when you reference the label.

\documentclass[a4paper]{article}

\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{caption}
\captionsetup{justification=centerlast,font=small,margin=50pt}
\renewcommand{\thesubfigure}{\scshape\alph{subfigure}}
\usepackage[capitalise]{cleveref}

\begin{document}

\begin{figure}
\centering
\subcaptionbox{\label{subfig:Test1}}[0.49\textwidth]{\includegraphics[width=0.49\textwidth]{example-image-a}}
\subcaptionbox{}[0.49\textwidth]{\includegraphics[width=0.49\textwidth]{example-image-b}}
\end{figure}

I would like this cross reference to show a capital 'A' rather than a
lower case: \cref{subfig:Test1}.

\end{document}


On the other hand if you really want to label by capital letters, then the appropriate redefinition is

\renewcommand{\thesubfigure}{\Alph{subfigure}}


regardless of the caption font.

• Yes of course. I see now. thanks for the help! Dec 19 '19 at 12:14