改变子图的顺序,也可以在图表中改变

改变子图的顺序,也可以在图表中改变

我想创建一个包含 4 个子图形的图形,这些子图形的顺序不寻常。通常,它们以方形图案排列,如下所示

AB

光盘

但我想让他们

交流

屋宇署

我已经通过更改计数器解决了这个问题,它在图中运行良好。但是图列表没有以同样的方式更改,因此顺序错误。

我该怎么做才能解决这个问题?非常感谢!:)

以下是 MWE:

\documentclass[a4paper, 12pt, headsepline]{scrreprt}
\usepackage[utf8]{inputenc}

\usepackage{graphicx}
\usepackage[format=plain, justification=centering]{caption}
\usepackage[list=true]{subcaption}
\captionsetup[subfigure]{format=default, labelformat=simple, labelsep=colon}

\begin{document}

\listoffigures

\bigskip
------------------------------------------------------------------------------------------------------------------
\bigskip

\begin{figure}[!h]
  \hspace{10pt}
  \centering
  \begin{subfigure}[t]{.45\textwidth}
    \centering
    \includegraphics[width=.6\textwidth]{tmp.png}
    \caption{Figure 1}
  \end{subfigure}
  \hfill

  \addtocounter{subfigure}{1}
  \begin{subfigure}[t]{.45\textwidth}
    \centering
    \includegraphics[width=.6\textwidth]{tmp.png}
    \caption{Figure 3 (changed order)}
  \end{subfigure}

  \hspace{10pt}
  \par\bigskip
  \hspace{10pt}

  \addtocounter{subfigure}{-2}
  \begin{subfigure}[t]{.45\textwidth}
    \centering
    \includegraphics[width=.6\textwidth]{tmp.png}
    \caption{Figure 2 (changed order)}
  \end{subfigure}
  \hfill

  \addtocounter{subfigure}{1}
  \begin{subfigure}[t]{.45\textwidth}
    \centering
    \includegraphics[width=.6\textwidth]{tmp.png}
    \caption{Figure 4}
  \end{subfigure}
  \hspace{10pt}
  \caption{Figures in changed order}
\end{figure}

\end{document}

,

答案1

我建议使用小页面来排列图像,而不是摆弄计数器:

在此处输入图片描述

\documentclass[a4paper, 12pt, headsepline]{scrreprt}
\usepackage[utf8]{inputenc}

\usepackage[demo]{graphicx}
\usepackage[format=plain, justification=centering]{caption}
\usepackage[list=true]{subcaption}
\captionsetup[subfigure]{format=default, labelformat=simple, labelsep=colon}

\begin{document}

\listoffigures

\bigskip
------------------------------------------------------------------------------------------------------------------
\bigskip

\begin{figure}[!h]

\begin{minipage}{0.5\textwidth}
\centering
  \begin{subfigure}[t]{.9\textwidth}
    \centering
    \includegraphics[width=.6\textwidth]{tmp.png}
    \caption{Figure 1}
  \end{subfigure}

  \begin{subfigure}[t]{.9\textwidth}
    \centering
    \includegraphics[width=.6\textwidth]{tmp.png}
    \caption{Figure 2}
  \end{subfigure}
\end{minipage}%
\begin{minipage}{0.5\textwidth}
\centering
  \begin{subfigure}[t]{.9\textwidth}
    \centering
    \includegraphics[width=.6\textwidth]{tmp.png}
    \caption{Figure 3}
  \end{subfigure}

  \begin{subfigure}[t]{.9\textwidth}
    \centering
    \includegraphics[width=.6\textwidth]{tmp.png}
    \caption{Figure 4}
  \end{subfigure}
\end{minipage}
  \caption{Figures in changed order}
\end{figure}

\end{document}

相关内容