3

I am designing an inset:

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure}
  \centering
  \subfloat[item A]{%                                                                                                                                                                                      
  \includegraphics[width=0.6\textwidth]{example-image-a}}
  \caption{Figure caption}
  \label{fig:myfigure}
\end{figure}

\begin{table}
  \centering
  \begin{tabular}{ll}
    data a & data b\\
    11     & 22
  \end{tabular}
  \caption{table showing values in item A}
  \label{table:mytable}
\end{table}

\begin{figure}
  \centering
  \subfloat[item B]{%                                                                                                                                                                                      
  \includegraphics[width=0.4\textwidth]{example-image-b}}
  \subfloat[item C]{%                                                                                                                                                                                      
  \includegraphics[width=0.4\textwidth]{example-image-c}}
  \caption{Figure caption}
  \label{fig:myfigure}
\end{figure}

\end{document}

The output is:

enter image description here

Figure 2 is planned as a direct continuation of Figure 1 (the table in between displaying values in Figure 1). Therefore Figure 2 should be numbered Figure 1, and the subfigure numbering should start from b). How to best design such a split figure?

5

If this is what you want

enter image description here

This is the code

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure}
  \centering
  \subfloat[item A]{%                                                                                                                                                                                      
  \includegraphics[width=0.6\textwidth]{example-image-a}}
  \caption{Figure caption}
  \label{fig:myfigure}
\end{figure}

\begin{table}
  \centering
  \begin{tabular}{ll}
    data a & data b\\
    11     & 22
  \end{tabular}
  \caption{table showing values in item A}
  \label{table:mytable}
\end{table}

 \addtocounter{figure}{-1}    %<<<<<<
\begin{figure}
  \centering
  \subfloat[item B]{%      
    \addtocounter{subfigure}{1} % <<<<< here                                                                                                                                                                                
  \includegraphics[width=0.4\textwidth]{example-image-b}}
  \subfloat[item C]{%                                                                                                                                                                                      
  \includegraphics[width=0.4\textwidth]{example-image-c}}
  \caption{Figure caption}
  \label{fig:myfigure}
\end{figure}

\end{document}

I guess you should remove the first \caption{Figure caption}. In this case also

\addtocounter{figure}{-1} %<<<<<<

cc2

1
  • yes, this is the indended result. – Viesturs Jan 7 at 17:35
4

This variation uses the subcapton package instead of subfig. Actually, my original goal was to use \ContinuedFloat, but the table prevents that.

\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}
  \centering
  \subfloat[item A]{\includegraphics[width=0.6\textwidth]{example-image-a}}
  \caption{Figure caption}
  \label{fig:myfigure}
\end{figure}

\begin{table}
  \centering
  \begin{tabular}{ll}
    data a & data b\\
    11     & 22
  \end{tabular}
  \caption{table showing values in item A}
  \label{table:mytable}
\end{table}

\addtocounter{figure}{-1}
\begin{figure}
  \centering
  {\setcaptionsubtype\stepcounter{subfigure}}% group
  \subfloat[item B]{\includegraphics[width=0.4\textwidth]{example-image-b}}%
  \subfloat[item C]{\includegraphics[width=0.4\textwidth]{example-image-c}}
  \caption{Figure caption}
  \label{fig:myfigure}
\end{figure}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.