[Tex/LaTex] Caption labelfont in uppercase, what am I doing wrong

captionsfloatrowsubcaption

I'm trying to get the subcaptions and captions in sanserif font and Uppercased. According the manual of the caption package this should be possible in the following way.However, this doesnt seem to work. Am I defining something in the wrong way here?

\documentclass{article}
\usepackage{floatrow}
\usepackage[demo]{graphicx}
\usepackage{subfig}
\usepackage{caption}
\floatsetup[figure]{subcapbesideposition = top}

\captionsetup{labelfont={sf,up}, labelsep=period, format = plain, singlelinecheck = false, textfont=rm, skip = 2pt}
\captionsetup[subfloat]{labelfont = {up,sf},format = plain,textfont = rm,labelformat = simple, labelsep = period}

\begin{document}  
\begin{figure}[h!]
  \ffigbox[\textwidth]
    {\begin{subfloatrow}
        \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{A.pdf}}%
        \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{B.pdf}}%
      \end{subfloatrow}
      \begin{subfloatrow}
        \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{C.pdf}}%
        \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{D.pdf}}%
      \end{subfloatrow}}
    {\caption{this is a caption}}
\end{figure}

\end{document}

Best Answer

To make the word "Figure" appear in uppercase, you can use the option figurename=FIGURE in the \captionsetup.

To change the subfigure letters to uppercase, you can use \renewcommand{\thesubfigure}{\Alph{subfigure}} somewhere in your preamble.

If you also want the caption text to be made uppercase, you can define a new style using \DeclareCaptionFormat{upper}{#1#2\uppercase{#3}\par}.

\documentclass{article}
\usepackage{floatrow}
\usepackage[demo]{graphicx}
\usepackage{subfig}
\usepackage{caption}
\floatsetup[figure]{subcapbesideposition = top}

\DeclareCaptionFormat{upper}{#1#2\uppercase{#3}\par}
\renewcommand{\thesubfigure}{\Alph{subfigure}}

\captionsetup{labelfont={sf}, labelsep=period, format = upper, singlelinecheck = false, textfont=sf, skip = 2pt,figurename=FIGURE}
\captionsetup[subfloat]{labelfont = {sf},format = plain,textfont = rm,labelformat = simple, labelsep = period}
\begin{document}  
\begin{figure}[h!]
  \ffigbox[\textwidth]
    {\begin{subfloatrow}
        \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{A.pdf}}%
        \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{B.pdf}}%
      \end{subfloatrow}
      \begin{subfloatrow}
        \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{C.pdf}}%
        \sidesubfloat[]{\includegraphics[width = 0.4\textwidth]{D.pdf}}%
      \end{subfloatrow}}
    {\caption{this is a caption}}
\end{figure}

\end{document}

uppercase subrow captions

Related Question