Graphics, Figures & TablesMove Subfigures Captions into the Main Caption Automatically

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
adin
Posts: 5
Joined: Wed Nov 17, 2010 9:46 am

Move Subfigures Captions into the Main Caption Automatically

Post by adin »

Hi all,

I'm wondering whether it is possible to automatically move the captions from the subfigures to the main caption.
In the example below, I would like to have in the main caption, something like, "Main Caption. (a) Subfigure 1. (b) Subfigure 2.", instead of having each caption individually, and in each subfigure that only appears the identifier "(a)" or "(b)".

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage{subfig}

\begin{document}

  \begin{figure}[!ht]
    \centering
    \subfloat[Subfigure 1]{
      \rule{6.4cm}{3.6cm}
    }
    \subfloat[Subfigure 2]{
      \rule{6.4cm}{3.6cm}
    }
    \caption{Main Caption}
    \label{fig:dummy}
  \end{figure}

\end{document}

Thanks,

adin
Last edited by adin on Fri Dec 17, 2010 11:41 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Move Subfigures Captions into the Main Caption Automatically

Post by gmedina »

Hi,

I know that you said "automatically", but I'm afraid that you'll have to do it manually:

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage{subfig}

\begin{document}

  \begin{figure}[!ht]
    \centering
    \subfloat[]{
      \rule{6.4cm}{3.6cm}
    }
    \subfloat[]{
      \rule{6.4cm}{3.6cm}
    }
    \caption{Main Caption. (a) Subfigure 1. (b) Subfigure 2.}
    \label{fig:dummy}
  \end{figure}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
adin
Posts: 5
Joined: Wed Nov 17, 2010 9:46 am

Re: Move Subfigures Captions into the Main Caption Automatic

Post by adin »

That's what I was afraid of. Any way, thanks.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Move Subfigures Captions into the Main Caption Automatically

Post by localghost »

Now that the problem is solved, please be so kind and mark the topic accordingly as written in Section 3 of the Board Rules (to be read before posting). Please keep that in mind for the future so that further reminders will not be necessary.


Thorsten
adin
Posts: 5
Joined: Wed Nov 17, 2010 9:46 am

Re: Move Subfigures Captions into the Main Caption Automatic

Post by adin »

Hi,

Sorry for that, actually I didn't mark it because I was waiting for others to came up with another solution. However, if that is the case I would do it next time, even if the answer is not entirely satisfactory.
Post Reply