# Subtitle for figure (subfloat)

how to add a subtitle to my figure which consists of two separate figures? I want the subtitle to be under each of the two figures. many thanks for your help in advance!

\begin{figure}[ht]
\caption{XX}
\centering
\subfloat[XXX1]{\includegraphics[width=0.5\textwidth]{Figure1a.jpg}\label{fig:f1}}
\hfill
\subfloat[XXX2]{\includegraphics[width=0.5\textwidth]{Figure1b.jpg}\label{fig:f2}}
\end{figure}

• Welcome to TeX SX! What do you mean exactly with a ‘subtitle’? You already have subcaptions. – Bernard Feb 25 '17 at 22:29
• Hi Bernard, many thanks for your reply! I want the title of each figure on top of it and want to write "Source: xyz" underneath each figure. – Helena Feb 25 '17 at 22:40

Like this?

it is obtained by use of package stackengine:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{stackengine}% for put note about sorce below image
\usepackage{graphicx}
\usepackage[font=small]{caption}
\usepackage{url}
\usepackage{tabularx}

\begin{document}
\begin{figure}[hb]
\centering
\def\stackalignment{r}
\begin{tabularx}{\hsize}{*2{>{\centering\arraybackslash}X}}
\caption{Left figure}
\label{fig:left}
\stackunder{\includegraphics[width=\linewidth]{example-image-a}}%
{\scriptsize%
Source: \url{http://tex.stackexchange.com/}}
&
\caption{Right figure}
\label{fig:right}
\stackunder{\includegraphics[width=\linewidth]{example-image-b}}%
{\scriptsize%
Source: \url{http://tex.stackexchange.com/}}
\end{tabularx}
\end{figure}
\end{document}


Or with use of package \copyrightbox:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}

\usepackage[font=small]{caption}
\usepackage{url}

\usepackage{tabularx}

\begin{document}
\begin{figure}[hb]
\centering
\begin{tabularx}{\hsize}{*2{>{\centering\arraybackslash}X}}
\caption{Left figure}
\label{fig:left}
{Source: \url{http://tex.stackexchange.com/}}
&
\caption{Right figure}
\label{fig:right}
{Source: \url{http://tex.stackexchange.com/}}
\end{tabularx}
\end{figure}

\end{document}


Addedndum: in case that image has two sub-figures. With use of \copyrightbox[b]{...}{...} and option position=top for subfig package:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}

\usepackage[font=small]{caption}
\usepackage{url}

\usepackage[position=top]{subfig}

\begin{document}
\begin{figure}[hb]
\centering
\caption{Figure caption}
\subfloat[Left sub-figure   \label{fig:left}]{
{Source: \url{http://tex.stackexchange.com/}}
}
\hfil
\subfloat[Right sub-figure  \label{fig:right}]{
{Source: \url{http://tex.stackexchange.com/}}
}
\end{figure}
\end{document}


Addedndum (2): it seems that package \copyrightbox not enable to center text with source information below the image. Use of stackengine haven't this limitation. An example with it and option position=top for subfig package is below:

The right image has text below image in gray color (for comparison only). MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[table]{xcolor}
\usepackage{graphicx}
\usepackage{stackengine}% for put note about sorce below image
\usepackage[font=small]{caption}
\usepackage[position=top]{subfig}
\usepackage{url}

\begin{document}
\begin{figure}[hb]
\centering
\def\stackalignment{c}% <-- define alignment of stack
\caption{Figure caption}
\subfloat[Left sub-figure   \label{fig:left}]{
\stackunder{\includegraphics[width=0.45\linewidth]{example-image-a}}%
{\scriptsize%
Source: \url{http://tex.stackexchange.com/}}
}
\hfil
\subfloat[Right sub-figure  \label{fig:right}]{
\stackunder{\includegraphics[width=0.45\linewidth]{example-image-b}}%
{\scriptsize\color{gray}% <-- if you prefer to have text in gray
Source: \url{http://tex.stackexchange.com/}}
}
\end{figure}
\end{document}

• +1 for the use of copyrightbox. Note the O.P. has subfigures, I think. – Bernard Feb 25 '17 at 23:52
• @Bernard, in the first place I thing the same (MWE indicate this), but, where is than if figure caption? I have problems with understanding of question. – Zarko Feb 26 '17 at 0:00
• There aren't many details, I know. Personally, I would have placed the subcaptions as they are, and the global caption at the bottom. – Bernard Feb 26 '17 at 0:18
• This change should be easy, OP only need to move \caption{...} below of sub figures (till before \end{figure}). Well, this is well known to you :-) – Zarko Feb 26 '17 at 0:36
• Thanks a lot! I chose your last version, but the Source is not centered underneath the figure. Is there a chance to put each source in the middle of the related figure? – Helena Feb 26 '17 at 8:56
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9001753926277161, "perplexity": 4328.315047579463}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-10/segments/1581875145960.92/warc/CC-MAIN-20200224132646-20200224162646-00011.warc.gz"}