子图无序放置/编号

子图无序放置/编号

我有一张图,展示了一个 3 步流程,我为此使用了子图。所需的输出如下所示(请原谅我的绘画技巧):

期望输出

现在可以放置子图/图像了使用小页面或多列:

\begin{figure}
\begin{minipage}[c][8cm][c]{0.5\textwidth}
\centering
\vspace*{\fill}
\includegraphics[height=3cm]{step1}
\subcaption{Step 1}
\label{fig:process11}

\includegraphics[height=3cm]{step3}
\subcaption{Step 3}
\label{fig:process13}
\end{minipage}
\begin{minipage}[c][8cm][t]{0.5\textwidth}
\vspace*{\fill}
\centering
\includegraphics[height=7cm]{step2}
\subcaption{Step 2}
\label{fig:process12}
\end{minipage}
\caption{Process 1}
\label{fig:process1}
\end{figure}

但是,这会导致步骤 2 具有 c 编号,而步骤 3 具有 b 编号。我该如何修复编号?

答案1

您可以手动调整它们:

\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\begin{minipage}[c][8cm][c]{0.5\textwidth}
\centering
\vspace*{\fill}
\includegraphics[height=3cm]{step1}
\subcaption{Step 1}
\label{fig:process11}

\addtocounter{subfigure}{1}
\includegraphics[height=3cm]{step1}
\subcaption{Step 3}
\label{fig:process13}
\end{minipage}
\begin{minipage}[c][8cm][t]{0.5\textwidth}
\vspace*{\fill}
\centering
\includegraphics[height=7cm]{step2}
\addtocounter{subfigure}{-2}
\subcaption{Step 2}
\label{fig:process12}

\end{minipage}
\caption{Process 1}
\label{fig:process1}
\end{figure}

Step 3 (Figure~\ref{fig:process13}).
\end{document}

答案2

\savebox您可以按照正确的顺序将它们装入es,然后按照任何顺序排列框。

保存箱

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

\newsavebox{\tempboxa}
\newsavebox{\tempboxb}
\newsavebox{\tempboxc}

\begin{document}
\begin{figure}
% firat step
\savebox{\tempboxa}{\begin{minipage}[b]{0.5\textwidth}
\centering
\includegraphics[height=3cm]{example-image-a}
\subcaption{Step 1}
\label{fig:process11}
\end{minipage}}
% second step
\savebox{\tempboxb}{\begin{minipage}[b]{0.5\textwidth}
\centering% redundant in this case
\includegraphics[height=7cm,width=\textwidth]{example-image-b}
\subcaption{Step 2}
\label{fig:process12}
\end{minipage}}
% third step
\savebox{\tempboxc}{\begin{minipage}[b]{0.5\textwidth}
\centering
\includegraphics[height=3cm]{example-image-c}
\subcaption{Step 3}
\label{fig:process13}
\end{minipage}}
% arrange boxes
\parbox[b][\ht\tempboxb][s]{0.5\textwidth}{%
\usebox{\tempboxa}
\vfill
\usebox{\tempboxc}}%
\usebox{\tempboxb}
\caption{Process 1}
\label{fig:process1}
\end{figure}

Step 1 (Figure~\ref{fig:process11}).\par
Step 2 (Figure~\ref{fig:process12}).\par
Step 3 (Figure~\ref{fig:process13}).
\end{document}

答案3

另一种可能性是将图形放在multirow第二列的表格中。然后(手动调整图像位置后)您可以获得:

在此处输入图片描述

梅威瑟:

\documentclass[12pt]{article}
    \usepackage{multirow}
    \usepackage{subcaption}
    \usepackage{graphicx}

    \begin{document}
\begin{figure}
    \begin{tabular}{p{0.48\textwidth}p{0.48\textwidth}}
\includegraphics[height=3cm,width=\hsize]{example-image-a}
\captionof{subfigure}{Step 1}
\label{fig:process11}
&   \multirow{2}{\hsize}[32mm]{
    \includegraphics[height=7cm,width=\hsize]{example-image-b}
     \captionof{subfigure}{Step 2}
    \label{fig:process12} 
                        }
    \\[-4mm]
\includegraphics[height=3cm,width=\hsize]{example-image-c}
\captionof{subfigure}{Step 3}
\label{fig:process11}
    &    
    \end{tabular}
\caption{Process 1}
\label{fig:process1}
\end{figure}
    \end{document}

如果图形占用的宽度小于文本宽度,则可以相应地减少列的宽度,然后\begin{figure}添加\centering}

相关内容