子图中的子图 - 正确对齐

子图中的子图 - 正确对齐

我想放置三张(或更多)图像,以便两张(或四张/更多)图像堆叠在一起,而剩余的图像则作为单独的列放置,跨越所有堆叠的行。我最初的方法是使用subfigureinside subfigure,结果如下:

\documentclass[]{article}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{graphicx}
%opening
\title{}
\author{}

\begin{document}
\begin{figure}[ht]
    \begin{subfigure}[t]{.2\linewidth}
        \includegraphics[width=\linewidth, height=4\linewidth]{example-image-a}
        \caption{TBA}
    \end{subfigure}\hfill%
    \begin{subfigure}[t]{.78\linewidth}
        \begin{subfigure}[t]{.5\linewidth}
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{TBD}
        \end{subfigure}\hfill%
        \begin{subfigure}[t]{.45\linewidth}
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{TBD}
        \end{subfigure}\hfill%
        
        \begin{subfigure}[t]{.5\linewidth}
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{TBD}
        \end{subfigure}\hfill%
        \begin{subfigure}[t]{.45\linewidth}
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{TBD}
        \end{subfigure}
    \end{subfigure}
\end{figure}
\begin{figure}[ht]
    \begin{subfigure}[t]{.2\linewidth}
        \includegraphics[width=\linewidth, height=4\linewidth]{example-image-a}
        \caption{TBA}
    \end{subfigure}\hfill%
    \begin{subfigure}[t]{.78\linewidth}
        \begin{subfigure}[t]{.9\linewidth}
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{TBD}
        \end{subfigure}\hfill%
        
        \begin{subfigure}[t]{.9\linewidth}
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{TBD}
        \end{subfigure}\hfill%
    \end{subfigure}
\end{figure}
\end{document}

第二张图说明了一个问题:图 A 应该跨越两个示例图 B,并与上面的图 B 的标题对齐,但我宁愿让它与下面的图 B 的标题对齐。

在此处输入图片描述

我该怎么做?当将图 A 移动到子图结构的末尾时,它只会出现在由图 B 组成的块的右侧,但仍然与上部标题对齐,而不是下部标题。或者根本就不可能?

答案1

b只需将第二块子图的对齐参数更改为(底部):

\begin{subfigure}[b]{.78\linewidth}


在此处输入图片描述

\documentclass[]{article}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{graphicx}
%opening
\title{}
\author{}

\begin{document}
\begin{figure}[ht]
    \begin{subfigure}[t]{.2\linewidth}
        \includegraphics[width=\linewidth, height=4\linewidth]{example-image-a}
        \caption{TBA}
    \end{subfigure}\hfill%
    \begin{subfigure}[b]{.78\linewidth}
        \begin{subfigure}[t]{.5\linewidth}
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{TBD}
        \end{subfigure}\hfill%
        \begin{subfigure}[t]{.45\linewidth}
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{TBD}
        \end{subfigure}\hfill%
        
        \begin{subfigure}[t]{.5\linewidth}
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{TBD}
        \end{subfigure}\hfill%
        \begin{subfigure}[t]{.45\linewidth}
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{TBD}
        \end{subfigure}
    \end{subfigure}
\end{figure}
\begin{figure}[ht]
    \begin{subfigure}[t]{.2\linewidth}
        \includegraphics[width=\linewidth, height=4\linewidth]{example-image-a}
        \caption{TBA}
    \end{subfigure}\hfill%
    \begin{subfigure}[b]{.78\linewidth}
        \begin{subfigure}[t]{.9\linewidth}
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{TBD}
        \end{subfigure}\hfill%
        
        \begin{subfigure}[t]{.9\linewidth}
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{TBD}
        \end{subfigure}\hfill%
    \end{subfigure}
\end{figure}
\end{document}

答案2

我将 (a) 删除所有定位[t]说明[b]符,并 (b) 将subfigure包围四个“内部”subfigure环境的环境替换为minipage环境。(Asubfigureminipage已被告知在遇到语句时该做什么的环境\caption。)

在此处输入图片描述

\documentclass{article}
\usepackage{subcaption,graphicx}

\begin{document}
\begin{figure}[ht]
    \begin{subfigure}{.18\linewidth}
        \includegraphics[width=\linewidth, height=3.5\linewidth]{example-image-a}
        \caption{TBDa}
    \end{subfigure}\hfill%
    \begin{minipage}{0.78\textwidth}
        \begin{subfigure}{.475\linewidth}
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{TBDb}
        \end{subfigure}\hfill%
        \begin{subfigure}{.475\linewidth}
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{TBDc}
        \end{subfigure}
        
        \medskip
        \begin{subfigure}{.475\linewidth}
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{TBDd}
        \end{subfigure}\hfill%
        \begin{subfigure}{.475\linewidth}
            \includegraphics[width=\linewidth]{example-image-b}
            \caption{TBDe}
        \end{subfigure}
    \end{minipage}
\caption{Overall figure caption}
\end{figure}

\end{document}

相关内容