3

I have 3 subfigures that I insert at width=0.5\textwidth, which leaves some empty space. I would like to insert the main caption in this space. How can I do this? I am using subcaption package for this but I read that floatrow might be a bit more flexible in cases like this. Solutions with either (or any other) package are welcome.

\documentclass[10pt, a4paper]{report}
\usepackage[paperheight=5.5in, paperwidth=6.267in, top=0in, bottom=0in, left=0in, right=0in]{geometry}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{uarial}
\renewcommand{\familydefault}{\sfdefault}



\usepackage{graphicx} 
\usepackage[bf]{caption}
\usepackage[singlelinecheck=false, aboveskip=-3pt]{subcaption}
\renewcommand\thesubfigure{\Alph{subfigure}} 


\begin{document}
\pagenumbering{gobble}
\setcounter{figure}{6}
\begin{figure}
        \captionsetup[subfigure]{labelformat=simple}
        %\captionsetup{font={onehalfspacing},skip=-10pt}
        \begin{subfigure}[t]{0.5\textwidth}
                \caption{}              
                \includegraphics[width=\textwidth]{dummy.png}
                \label{fig2d}
        \end{subfigure}
        \begin{subfigure}[t]{0.5\textwidth}
                \caption{}              
                \includegraphics[width=\textwidth]{dummy.png}
        \end{subfigure}\vspace{-10pt}
        \begin{subfigure}[t]{0.5\textwidth}
                \caption{}              
                \includegraphics[width=\textwidth]{dummy.png}
                \label{fig2d}
        \end{subfigure}\vspace{-15pt}
        \caption{Figure caption describes subfigures A, B and C}
\end{figure}

\end{document}

example

EDIT: sorry for not being clear, the empty space I refer to is [below subfigure B and beside subfigure C]. That is, when I have an odd number of subfigures and I'd like to not have the main caption below the whole figure but use space more efficiently by inserting it to the right of the last subfigure. I'll upload a figure soon to make this clear.

If I insert an additional subfigure (but only the legend without the actual figure), I get something close to what I want:

\begin{subfigure}[t]{0.49\textwidth}
                %\caption{}              
                \vspace{50 pt}        
                \caption{Figure caption describes subfigures A, B and C; this is a very long legendthis is a very long legendthis is a very long legendthis is a very long legendthis is a very long legendthis is a very long legendthis is a very long legendthis is a very long legendthis is a very long legendthis is a very long legendthis is a very long legend}
        \end{subfigure}

The problem with this is that the legend has subfigure numbering, whereas I need it to be main figure numbering. I suspect that there might be a way to define a new subtype of caption, maybe in subcaption.sty but I am not sure how! example2

srao
  • 647

2 Answers2

1

This was sufficient for my purpose, although I'm sure there would be a better way to do this. (Not sure about the etiquette here, should I delete my question now that I have figured out what to do? Or leave it for better answers/other users?)

\documentclass[10pt, a4paper]{report}
\usepackage[paperheight=7.5in, paperwidth=6.267in, top=0in, bottom=0in, left=0in, right=0in]{geometry}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{uarial}
\renewcommand{\familydefault}{\sfdefault}



\usepackage{graphicx} 
\usepackage[bf]{caption}
\usepackage[singlelinecheck=false, aboveskip=-3pt]{subcaption}
\renewcommand\thesubfigure{\Alph{subfigure}} 

\newcommand{\fillcaption}[1]{ %new command with the argument being the text of the caption
\textbf{Figure \arabic{figure}:} #1 %Makes main figure number, concatenates it to legend
\addtocounter {figure} {1} %increments main figure count
} 
%\newcommand{\bfillcaption}[2]{\fillcaption{\textbf{#1} #2}} %bolds first sentence of fillcaption
\begin{document}
\pagenumbering{gobble}
\setcounter{figure}{6}
\begin{figure}
        \captionsetup[subfigure]{labelformat=simple}
        %\captionsetup{font={onehalfspacing},skip=-10pt}
        \begin{subfigure}[t]{0.5\textwidth}
                \caption{}              
                \includegraphics[width=\textwidth]{dummy.png}
                \label{fig2d}
        \end{subfigure}
        \begin{subfigure}[t]{0.5\textwidth}
                \caption{}              
                \includegraphics[width=\textwidth]{dummy.png}
        \end{subfigure}\vspace{-10pt}
        \begin{subfigure}[t]{0.5\textwidth}
                \caption{}              
                \includegraphics[width=\textwidth]{dummy.png}
                \label{fig2d}
        \end{subfigure}
        \begin{subfigure}[t]{0.49\textwidth}
                \vspace{10 pt}        
                \fillcaption{Figure legend here} {A. This describes subfigure (A). B. This describes subfigure (B). C. This describes subfigure (C).  }
        \end{subfigure}
        %\caption{Figure caption describes subfigures A, B and C}
\end{figure}

\end{document}

example

srao
  • 647
  • I think it's OK to leave question and answer here. However you could mark your (favorite) answer as being accepted. – U. Windl Apr 06 '19 at 00:27
0

Thanks srao, I have improved upon your code a bit making it simpler and thus also easier to read. I added the makebox command to allow the figure to expand to larger than the page width, not really needed.

\documentclass[a4paper]{report}
\usepackage{subcaption}
\usepackage{todonotes}

\newcommand{\fillcaption}[1]{ %new command with the argument being the text of the caption
\addtocounter {figure} {1} %increments main figure count
\vspace{0pt}
Figure \arabic{figure}: #1 %Makes main figure number, concatenates it to legend
}

\begin{document}
\begin{figure}
\makebox[\textwidth][c]
{
    \begin{tabular}{p{0.7\linewidth} p{0.7\linewidth}}
        \fillcaption{Lorem ipsum dolor sit amet, consectetur adipiscing elit.}&
        \vspace{0pt}
        \subcaptionbox{About a}{\missingfigure{}}\\
        \subcaptionbox{About b}{\missingfigure{}}&
        \subcaptionbox{About c}{\missingfigure{}}
    \end{tabular}
}
\end{figure}
\end{document}