如何为一组图分配单个图形编号?

如何为一组图分配单个图形编号?

我需要为图组分配一个字母表,因为我将创建多组图。如何在 latex (overleaf) 中执行此操作?

在此处输入图片描述

\documentclass{article}
\usepackage{svg}
\usepackage{subcaption}
\usepackage[margin=20pt, top=0.5cm, paperwidth=350px, paperheight=450px]{geometry}
\begin{document}

\begin{figure}
  \centering
  \begin{subfigure}{0.5\textwidth} % Use 0.5\textwidth to have two plots per row
    \begin{tabular}{@{} c @{}}
      \small method-1 \\
      \includesvg[width=0.9\linewidth]{test.svg} % Adjust the width for proper sizing
    \end{tabular}
    \subcaption{}
  \end{subfigure}%
  \begin{subfigure}{0.5\textwidth} % Use 0.5\textwidth to have two plots per row
    \begin{tabular}{@{} c @{}}
      \small method-2 \\
      \includesvg[width=0.9\linewidth]{test.svg} % Adjust the width for proper sizing
    \end{tabular}
    \subcaption{} % You can add a caption here
  \end{subfigure}

    \vspace{1cm} % Add vertical space between the two grids
  
  \begin{subfigure}{0.5\textwidth} % Use 0.5\textwidth to have two plots per row
    \begin{tabular}{@{} c @{}}
      \small method-2 \\
      \includesvg[width=0.9\linewidth]{test.svg} % Adjust the width for proper sizing
    \end{tabular}
    \subcaption{} % You can add a caption here
  \end{subfigure}%
  \begin{subfigure}{0.5\textwidth} % Use 0.5\textwidth to have two plots per row
  \centering
    \begin{tabular}{@{} c @{}}
      \small method-3 \\
      \includesvg[width=0.9\linewidth]{test.svg} % Adjust the width for proper sizing
    \end{tabular}
    \subcaption{} 
  \end{subfigure}

  \caption{Test}
\end{figure}

\end{document}

答案1

我很确定你的问题是重复的,但暂时我找不到它......

您应该只使用表格并删除所有subcaption环境。但是,您应该知道,此后不再可能引用图中的特定图片:

\documentclass{article}
\usepackage[skip=1ex]{caption}
\usepackage{graphicx}
\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}

\begin{document}
    \begin{figure}[htb]
{\sffamily\bfseries\huge A}

\begin{tabularx}{\textwidth}{@{} CC @{}}
 method-1    &   method-2        \\
\includegraphics[width=\linewidth]{example-image-duck}
            &   \includegraphics[width=\linewidth]{example-image-duck}
                                \\[2ex]    
method-3    &   method-4        \\
\includegraphics[width=\linewidth]{example-image-duck}
            &   \includegraphics[width=\linewidth]{example-image-duck}
\end{tabularx}
\caption*{Test}
    \end{figure}
\end{document}

在此处输入图片描述

编辑:
删除了重复的 od 代码,添加了字母A正如您所问的,位于图的左上角。

相关内容