Bold the caption of subfigure

captionsformattingsubfloats

I have a figure with two subfigures, I want to bold the caption of the subfigure and the (a) beside the caption of that. Like the following, I want to write (a) this is bold.

\documentclass[conference]{IEEEtran}
\usepackage{authblk}
\usepackage{xcolor}
\usepackage{adjustbox}
\usepackage{textcase}
\usepackage{subfig}

\usepackage[margin=10pt,font=footnotesize,justification=centering, labelsep = period].   {caption}

\begin{document}
\begin{figure}[htb!]
\subfloat[\textbf{this is bold}]{\includegraphics[ height=2 in, width=2 in]{Images/ppt3/a.pdf}}
\subfloat[]{\includegraphics[ height=2 in, width=2 in]{Images/ppt3/b.pdf}}
\caption{Visual} 
\end{figure}

\end{document}

Best Answer

Welcome to TeX.SE!

You need to define (as option of subfig package) used font in caption:

\documentclass[conference]{IEEEtran}
\usepackage{authblk}
\usepackage{xcolor}
\usepackage{adjustbox}
\usepackage{textcase}
\usepackage[font={bf, footnotesize}]{subfig} % <---

\usepackage[margin=10pt,
            font=footnotesize,
            justification=centering, 
            labelsep = period]{caption}
            
\usepackage{lipsum}

\begin{document}
\lipsum[66]
    \begin{figure}[htb!]
    \centering
    \setkeys{Gin}{height=2in,width=2 in}
\subfloat[bold sub-caption]{\includegraphics{example-image-a}}

\medskip
\subfloat[]{\includegraphics{example-image-b}}
\end{figure}

\end{document}

enter image description here

For more details consult documentation of the subfig package.

Related Question