1

I have 3 big figures and the corresponding captions, which are long and uncompensated (some longer than others). I want to arrange them in a 2x2 fashion, so that I have subfigs a and b in the first row and in the second row the subfig c and captions occupying the space left by subfig c. So far I managed to achieve this with:

\documentclass[pra,aps,onecolumn,eqsecnum,notitlepage]{revtex4-1}
\usepackage{epsf}
\usepackage{epsfig}
\usepackage{psfrag}
\usepackage{color}
\usepackage{graphicx}
\usepackage{lmodern,bm}
\usepackage{subcaption}
\usepackage[inline]{enumitem}

\begin{document}    
\begin{figure*}[ht!]

\begin{subfigure}[b]{.495\textwidth}
\includegraphics[width=\linewidth]{./subfig_a.png}
\caption{}
\end{subfigure}
\hfill
\begin{subfigure}[b]{.495\textwidth}
\includegraphics[width=\linewidth]{./subfig_b.png}
\caption{}
\end{subfigure}

\begin{subfigure}[b]{.495\textwidth}
\includegraphics[width=\linewidth]{./subfig_c.png}    
\caption{}
\end{subfigure}
\hfill
\begin{minipage}[b]{.495\textwidth}
\captionsetup{singlelinecheck=off}
\caption{\label{wholefig} \footnotesize 
(a) Long text caption for subfig a.
(b) Not so long text caption for subfig b.   
(c) More text caption for subfig c.}
\end{minipage}

\end{figure*}
\end{document}

In this way I get only (a)(b)(c) behind the subfigs and manually write the subcaptions in the minipage that would go in the lower right corner. What is extremely annoying is that I am unable to justify the text in there, and since it is quite long it looks very ugly to me. I tried with the \captionsetup{singlelinecheck=off} but this did not help.

EDIT: as said below, it seems that part of the issue is that Revtex is not intended to work well with the caption or subcaption package. I add the Revtex tag here.

Has someone faced a similar issue? Thanks!

0

2 Answers 2

0

Revtex4 defines \@makecaption which is used unchanged by the caption package. This definition uses \unhbox on the formatted caption, which removes the formatting.

This solution replaces \@makecaption with \caption@makecaption provided by the caption package.

\documentclass[pra,aps,onecolumn,eqsecnum,notitlepage]{revtex4-1}
%\documentclass{article}
\usepackage{epsf}
\usepackage{epsfig}
\usepackage{psfrag}
\usepackage{color}
\usepackage{graphicx}
\usepackage{lmodern,bm}
\usepackage[inline]{enumitem}

\usepackage{subcaption}
\makeatletter
\let\@makecaption=\caption@makecaption
\makeatother

\begin{document}  
\begin{figure*}[ht!]

\begin{subfigure}[b]{.495\textwidth}
\includegraphics[width=\linewidth]{example-image-a}
\caption{}
\end{subfigure}
\hfill
\begin{subfigure}[b]{.495\textwidth}
\includegraphics[width=\linewidth]{example-image-b}
\caption{}
\end{subfigure}

\begin{subfigure}[b]{.495\textwidth}
\includegraphics[width=\linewidth]{example-image-c}    
\caption{}
\end{subfigure}
\hfill
\begin{minipage}[b]{.495\textwidth}
%\captionsetup{justification=justified}
\caption{\footnotesize 
(a) Long text caption for subfig a.
(b) Not so long text caption for subfig b.
(c) More text caption for subfig c.}
\label{wholefig}
\end{minipage}

\end{figure*}
\end{document}

demo

0
0

You can do that with the floatrow package: it defines a \RawCaption command which be used to place caption as a floatbox:

\documentclass{article}%
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[demo]{graphicx}
\usepackage{caption,subcaption}
\usepackage[inline]{enumitem}
\usepackage{floatrow}
\captionsetup[subfigure]{singlelinecheck=off, labelfont={bf}}
\captionsetup[figure]{font={footnotesize}}

\begin{document}

\begin{figure}[!htb]
\ffigbox{}{%
\begin{subfloatrow*}
\ffigbox[.495\textwidth]{\subcaption{}\label{subf:a}}{\includegraphics[width=\linewidth]{./subfig_a.png}}
\ffigbox[.495\textwidth]{\subcaption{}\label{subf:b}}{\includegraphics[width=\linewidth]{./subfig_b.png}}%
\end{subfloatrow*}%
\renewlengthtocommand\settowidth\Mylen{\subfloatrowsep}\vskip\Mylen
\CenterFloatBoxes\floatsetup[subfigure]{heightadjust=object}%none
\begin{subfloatrow*}
\ffigbox[.495\textwidth]{\subcaption{}\label{subf:c}}{\includegraphics[width=\linewidth]{./subfig_c.png}}
\ffigbox[][][b]{}{\captionsetup{justification=RaggedRight}\RawCaption{\caption{\label{wholefig}\footnotesize
(a) Long text caption for subfig a.
(b) Not so long text caption for subfig b.
(c)~More text caption for subfig c. \vspace{\baselineskip}
}}}
\end{subfloatrow*}
}%
\end{figure}

\end{document} 

enter image description here

1
  • This works great, but I just found out that my issues are a bit more complex: it happens that I am not using article documentclass but revtex, which it seems is not compatible with caption or subcaption packages (it does compile, but they interfere with the caption justification of revtex and the result is that the caption can not be fully justified).
    – Daniel M
    Oct 6, 2017 at 16:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .