3

I am trying to align three figures and their three captions as the following 2x2 (four square) pattern: what I want to do

In order to solve this, I have the following code which works, but not in aesthetic appeal

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

\usepackage[]{graphicx} 
%\usepackage[scriptsize]{subfigure}
\usepackage{subcaption}
\begin{document}
    \begin{figure}

            \begin{subfigure}[]{0.50\textwidth}
                    \includegraphics[width=0.8\linewidth]{figure1.png}
                     \label{fig:networks}
            \end{subfigure}
            \begin{subfigure}[b]{0.45\textwidth}
                    \subcaption{An example of Network where $V_a=\ 
 {1,2,3,4\}, E_a=\{\{1,2\},V_b=\{5,6,7,8,9\},E_b=\{\{6,7\},\{8,9\}\}\},E_c=\ 
{\{1,5\},\{1,6\},\{2,6\},\{2,7\},\{3,5\},\{3,7\},\{4,5\},\{4,8\}\}$}
            \end{subfigure}
            \begin{subfigure}[b]{0.5\textwidth}
                    \includegraphics[width=0.5\linewidth]{figure2.png}
                    \caption{ Type 1 sub network of the Network}
                    \label{fig:pattern1}
            \end{subfigure}
            \begin{subfigure}[b]{0.45\textwidth}
                       \includegraphics[width=0.5\linewidth]{figure3.png}
                       \caption{Type 2 sub network of the Network}
                       \label{fig:pattern2}
            \end{subfigure}
    \caption{An example of a Network with type 1 and type 2 sub networks}
    \end{figure}

\end{document}

Here is the link to overleaf for this code: The above code in overleaf

However, this falls apart when I uncomment \usepackage[scriptsize]{subfigure} I am collaborating on this with some other folks in a file that has subfigure package included with scriptsize, and I cannot remove that. I am trying to work my way around, but can't see how. Any and all help will be appreciated. Thanks in advance.

PS: I don't have enough reputation to do it myself, but if a #2x2 could be created, it may help these type of questions

  • 2
    The subfigure package was marked obsolete by its author more than 15(!) years ago. – Axel Sommerfeldt Jan 26 at 8:29
2

package subfigure is obsolete and as i see you not use it in your document. it also clash with used subcaption package. so you should delete \usepackage[scriptsize]{subfigure} and set font size for for subfigures environments for example with \usepackage[font=scriptsize]{subcaption}:

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

\usepackage[demo,
            export]{adjustbox}
\usepackage[font=scriptsize]{subcaption}        % <---
\usepackage{mathtools}

\begin{document}
    \begin{figure}
\begin{subfigure}[t]{0.5\textwidth}     % <---
\includegraphics[width=\linewidth, valign=t]{figure1.png}% <---
\caption{}
\label{fig:networks}
\end{subfigure}
\hfill
\begin{subfigure}[t]{0.45\textwidth}\raggedright                % <---
An example of Network where                         % <---
$\begin{aligned}                                    % <---
V_a & = \{1,2,3,4\},    \\
E_a & = \{\{1,2\},      \\
V_b & = \{5,6,7,8,9\},  \\
E_b & = \{\{6,7\},\{8,9\}\}\},  \\
E_c & = \begin{multlined}[t]\{\{1,5\},\{1,6\},\{2,6\},\\
        \{2,7\},\{3,5\},\{3,7\},\{4,5\},\{4,8\}\}
        \end{multlined}
\end{aligned}$
\end{subfigure}

\medskip
\begin{subfigure}[t]{0.5\textwidth}
\includegraphics[width=\linewidth,]{figure2.png}
\caption{ Type 1 sub network of the Network}
\label{fig:pattern1}
\end{subfigure}
\hfill
\begin{subfigure}[t]{0.3\textwidth} % <---
\includegraphics[width=\linewidth,
                 height=0.5\linewidth]{figure3.png} % <---
\caption{Type 2 sub network of the Network}
\label{fig:pattern2}
\end{subfigure}
\caption{An example of a Network with type 1 and type 2 sub networks}
 \label{fig:networks}
    \end{figure}
\end{document}

enter image description here

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.