[Tex/LaTex] How to reduce caption font in \subcaption for a particular figure

beamersubcaption

How to reduce a font size of a particular figure in \subfigure environment in beamer. I know how to reduce the caption font globally \usepackage[font=small]{subcaption}, but I am looking for a font size handling locally.

I am showing four subfigures in one frame using \subfigure from \subcaption package. The problem is the subfigure's individual captions, (a), (b), (c), (d), are way too big as compared to the labeling text which is used inside the sub-pictures.
So, if I increase the individual subfigure height using \begin{subfigure}{.49\textwidth} then the four pictures go out of page, if I decrease the size of it then font which is used inside the figure becomes too small as compared to the caption.
So, I want to decrease the caption font so that with respect to text used inside the picture will not look bad.

My MWE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass{beamer}

\mode<presentation> {

% The Beamer class comes with a number of default slide themes
% which change the colors and layouts of slides. Below this is a list
% of all the themes, uncomment each in turn to see what they look like.

%\usetheme{default}
%\usetheme{AnnArbor}
%\usetheme{Antibes}
%\usetheme{Bergen}
%\usetheme{Berkeley}
%\usetheme{Berlin}
%\usetheme{Boadilla}
%\usetheme{CambridgeUS}
%\usetheme{Copenhagen}
%\usetheme{Darmstadt}
%\usetheme{Dresden}
%\usetheme{Frankfurt}
%\usetheme{Goettingen}
%\usetheme{Hannover}
%\usetheme{Ilmenau}
%\usetheme{JuanLesPins}
%\usetheme{Luebeck}
% \usetheme{Madrid}
%\usetheme{Malmoe}
%\usetheme{Marburg}
%\usetheme{Montpellier}
%\usetheme{PaloAlto}
%\usetheme{Pittsburgh}
%\usetheme{Rochester}
%\usetheme{Singapore}
%\usetheme{Szeged}
\usetheme{Warsaw}

% As well as themes, the Beamer class has a number of color themes
% for any slide theme. Uncomment each of these in turn to see how it
% changes the colors of your current slide theme.
\useoutertheme{infolines}
%\usecolortheme{albatross}
%\usecolortheme{beaver}
%\usecolortheme{beetle}
%\usecolortheme{crane}
%\usecolortheme{dolphin}
%\usecolortheme{dove}
%\usecolortheme{fly}
%\usecolortheme{lily}
%\usecolortheme{orchid}
%\usecolortheme{rose}
%\usecolortheme{seagull}
%\usecolortheme{seahorse}
%%\usecolortheme{whale}
%\usecolortheme{wolverine}

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

% % % Black Background Configuration
%\setbeamercolor{normal text}{fg=white,bg=black!90}
%\setbeamercolor{structure}{fg=white}
%
%\setbeamercolor{alerted text}{fg=red!85!black}
%
%\setbeamercolor{item projected}{use=item,fg=black,bg=item.fg!35}
%
%\setbeamercolor*{palette primary}{use=structure,fg=structure.fg}
%\setbeamercolor*{palette secondary}{use=structure,fg=structure.fg!95!black}
%\setbeamercolor*{palette tertiary}{use=structure,fg=structure.fg!90!black}
%\setbeamercolor*{palette quaternary}{use=structure,fg=structure.fg!95!black,bg=black!80}
%
%\setbeamercolor*{framesubtitle}{fg=white}
%
%\setbeamercolor*{block title}{parent=structure,bg=black!60}
%\setbeamercolor*{block body}{fg=black,bg=black!10}
%\setbeamercolor*{block title alerted}{parent=alerted text,bg=black!15}
%\setbeamercolor*{block title example}{parent=example text,bg=black!15}

% % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

%\setbeamertemplate{footline} % To remove the footer line in all slides uncomment this line
%\setbeamertemplate{footline}[page number] % To replace the footer line in all slides with a simple slide count uncomment this line

%\setbeamertemplate{navigation symbols}{} % To remove the navigation symbols from the bottom of all slides uncomment this line
}

\usepackage{graphicx} % Allows including images
\usepackage{booktabs} % Allows the use of \toprule, \midrule and \bottomrule in tables
\usepackage{epstopdf}
\usepackage[font=small,skip=0pt]{caption}
\usepackage[backend=bibtex]{biblatex}

%\usepackage{IEEEtrantools.sty} %Copy file IEEEtran.sty to folder where miktek is installed i-e E:\Program Files\MiKTeX 2.9\tex\latex\IEEEtran.sty
\usepackage[retainorgcmds]{IEEEtrantools} %For TexLive

\usepackage{comment}
%\bibliography{references}
%\usepackage{bibentry}

%\usepackage{mathtools}
%\usepackage{verbatim}

\usepackage[disable,colorinlistoftodos]{todonotes}
%\usepackage[obeyDraft,colorinlistoftodos]{todonotes}

\usepackage{subcaption}

\beamertemplatenavigationsymbolsempty 
\usepackage[framemethod=tikz]{mdframed} %for slide transition
\setbeamertemplate{caption}[numbered] %To achieve numbering of figures, you need to set.



\begin{document}

%-----------------------------------------------------------

%------------------------------
\begin{frame}
\begin{figure}[h!]
    \begin{subfigure}{.49\textwidth}
        %           \centering
        \includegraphics[width=1\linewidth]{f22.eps}
        \caption{ }
        \label{fig7a}
    \end{subfigure} 
    \begin{subfigure}{.49\textwidth}
        %           \centering
        \includegraphics[width=1\linewidth]{f23.eps}
        \caption{ }
        \label{fig7b}
    \end{subfigure} \\%
    \begin{subfigure}{.49\textwidth}
%       \centering
        \includegraphics[width=1\linewidth]{f24.eps}
        \caption{ }
        \label{fig7c}
    \end{subfigure} %
    \begin{subfigure}{.49\textwidth}
        %           \centering
        \includegraphics[width=1\linewidth]{f25.eps}
        \caption{ }
        \label{fig7d}
    \end{subfigure}
    \caption{\textbf{My caption}
    \label{f7}
\end{figure}
\end{frame}

\end{document} 

Best Answer

I would add the instruction

\captionsetup[subfigure]{font=scriptsize,labelfont=scriptsize}

after \begin{figure}. That way, the setup change is local to this particular figure environment.

A full MWE:

enter image description here

\documentclass[demo]{beamer}

\mode<presentation> {
\usetheme{Warsaw}
\useoutertheme{infolines}
}
\usepackage{graphicx} % Allows including images
\usepackage{booktabs}
\usepackage{epstopdf}
\usepackage[font=small,skip=0pt]{caption}
\usepackage[backend=bibtex]{biblatex}
\usepackage[retainorgcmds]{IEEEtrantools}
\usepackage{comment}
\usepackage[disable,colorinlistoftodos]{todonotes}
\usepackage{subcaption}
\beamertemplatenavigationsymbolsempty 
\usepackage[framemethod=tikz]{mdframed} 
\setbeamertemplate{caption}[numbered]

\begin{document}

\begin{frame}
\begin{figure}[h!]
    \captionsetup[subfigure]{font=scriptsize,labelfont=scriptsize}
    \begin{subfigure}{.49\textwidth}
        \includegraphics[width=1\linewidth]{f22.eps}
        \caption{Hello World}
        \label{fig7a}
    \end{subfigure} \hspace*{\fill}
    \begin{subfigure}{.49\textwidth}
        \includegraphics[width=1\linewidth]{f23.eps}
        \caption{Good Morning}
        \label{fig7b}
    \end{subfigure} 

    \begin{subfigure}{.49\textwidth}
        \includegraphics[width=1\linewidth]{f24.eps}
        \caption{Good Night}
        \label{fig7c}
    \end{subfigure} \hspace*{\fill}
    \begin{subfigure}{.49\textwidth}
        \includegraphics[width=1\linewidth]{f25.eps}
        \caption{Goodbye World}
        \label{fig7d}
    \end{subfigure}
    \caption{\textbf{My caption}}
    \label{f7}
\end{figure}
\end{frame}

\end{document}

Addendum: If you want the overall figure caption to show up in the frame, you must reduce the sizes of the images, maybe along the lines of the following example.

enter image description here

\documentclass[demo]{beamer} % remove 'demo' option in real document

\mode<presentation> {
\usetheme{Warsaw}
\useoutertheme{infolines}
}
\usepackage{booktabs}
\usepackage[font=small,skip=0pt]{caption}
\usepackage[backend=bibtex]{biblatex}
\usepackage[retainorgcmds]{IEEEtrantools}
\usepackage{comment}
\usepackage[disable,colorinlistoftodos]{todonotes}
\usepackage{subcaption}
\beamertemplatenavigationsymbolsempty 
\usepackage[framemethod=tikz]{mdframed} 
\setbeamertemplate{caption}[numbered]

\begin{document}

\begin{frame}
\captionsetup[figure]{labelfont=scriptsize,
                      textfont={scriptsize,bf}}
\captionsetup[subfigure]{labelfont=scriptsize,
                         textfont=scriptsize}

\begin{figure}[h!]
    \centering
    \begin{subfigure}{.4\textwidth}
    \includegraphics[width=1\linewidth,height=0.2\textheight,keepaspectratio]{f22.eps}
    \caption{Hello World}
    \label{fig7a}
    \end{subfigure} \qquad
    \begin{subfigure}{.4\textwidth}
    \includegraphics[width=1\linewidth,height=0.2\textheight,keepaspectratio]{f23.eps}
    \caption{Good Morning}
    \label{fig7b}
    \end{subfigure} 

    \begin{subfigure}{.4\textwidth}
    \includegraphics[width=1\linewidth,height=0.2\textheight,keepaspectratio]{f24.eps}
    \caption{Good Night}
    \label{fig7c}
    \end{subfigure} \qquad
    \begin{subfigure}{.4\textwidth}
    \includegraphics[width=1\linewidth,height=0.2\textheight,keepaspectratio]{f25.eps}
    \caption{Goodbye World}
    \label{fig7d}
    \end{subfigure}

\caption{My caption}
\label{f7}
\end{figure}

\end{frame}

\end{document}