如何在没有共同标题的子图中获取图号?

如何在没有共同标题的子图中获取图号?

我怎样才能得到“图 2a)”、“图 2b)”而不是仅仅“a)”和“b)”?我不想为两者都添加标题,就像这样,只在 a) 和 b) 前面加上数字。子图

\begin{figure}
\centering
  \begin{subfigure}{0.4\linewidth}
    \centering\includegraphics[width=0.7\linewidth]{Figures/Fig13.22a_layer_structure.png}
    \caption{Layer structure of CIGS solar cell. The \textit{pn}-junction is also referred to as a \textit{buried junction}, because the separation of electron-hole pairs happens one layer above. Image source: \cite[p.193]{smets-2016}}
    \label{fig:CIGS-layer-structure}
  \end{subfigure}
\hspace{1cm}
\centering
  \begin{subfigure}{0.4\linewidth}
    \centering\includegraphics[width=0.7\linewidth]{Figures/Fig13.22b_band_diagram.png}
    \caption{Band diagram of CIGS solar cell. Image source: \cite[p.193]{smets-2016}}
    \label{fig:CIGS-band-diagram}
  \end{subfigure}
\end{figure}

答案1

尝试组合subcaption并对类型\subref进行了重新定义:labelformatsub

在此处输入图片描述

\documentclass{article}

\usepackage{graphicx,subcaption}

\renewcommand{\thesubfigure}{\thefigure\alph{subfigure})}
\captionsetup[sub]{labelformat=simple}

\begin{document}

See Figure~\subref{fig:example-image-a}.

\begin{figure}
  \centering
  \begin{subfigure}{0.4\linewidth}
    \centering
    \includegraphics[width=0.7\linewidth]{example-image-a}
    \caption{First figure}
    \label{fig:example-image-a}
  \end{subfigure}%
  \hspace{1cm}%
  \begin{subfigure}{0.4\linewidth}
    \centering
    \includegraphics[width=0.7\linewidth]{example-image-b}
    \caption{Second figure}
    \label{fig:example-image-b}
  \end{subfigure}
\end{figure}

\end{document}

相关内容