两张图中小页面的连续标签问题

两张图中小页面的连续标签问题

问题:迷你页面在两幅图中使用。但迷你页面标签在两幅图中是连续的。

如何让图 3 中的小页面标记为 (3a) 和 (3b),而不是 (3c) 和 (3d)?

图2和图3小页面标签连续

\begin{figure}[h!]
\begin{minipage}[b]{.5\linewidth}
\centering\includegraphics[width=2cm]{logo2}% This is a *.eps file
\subcaption{A subfigure}\label{fig:2a}
\end{minipage}\\
\begin{minipage}[b]{.5\linewidth}
\centering\includegraphics[width=2cm]{logo2}% This is an *.eps file
\subcaption{Another subfigure}\label{fig:2b}
\end{minipage}
\caption{A figure}\label{fig:2b}
\end{figure}

\begin{figure}[h!]
\begin{minipage}[b]{.5\linewidth}
\centering\includegraphics[width=2cm]{logo2}% This is a *.eps file
\subcaption{A subfigure}\label{fig:2a}
\end{minipage}\\
\begin{minipage}[b]{.5\linewidth}
\centering\includegraphics[width=2cm]{logo2}% This is an *.eps file
\subcaption{Another subfigure}\label{fig:2b}
\end{minipage}
\caption{A figure}\label{fig:2b}
\end{figure}

答案1

你必须在序言中使用类似这样的内容\renewcommand\thesubfigure{\thefigure\alph{subfigure}}

\documentclass{scrartcl}
\usepackage{graphicx}
\usepackage{subcaption}

\renewcommand\thesubfigure{\thefigure\alph{subfigure}}

\begin{document}
\begin{figure}[h!]
\begin{minipage}[b]{.5\linewidth}
\centering\includegraphics[width=2cm]{logo}% This is a *.eps file
\subcaption{A subfigure}\label{fig:2a}
\end{minipage}\\
\begin{minipage}[b]{.5\linewidth}
\centering\includegraphics[width=2cm]{logo}% This is an *.eps file
\subcaption{Another subfigure}\label{fig:2b}
\end{minipage}
\caption{A figure}\label{fig:2b}
\end{figure}

\begin{figure}[h!]
\begin{minipage}[b]{.5\linewidth}
\centering\includegraphics[width=2cm]{logo}% This is a *.eps file
\subcaption{A subfigure}\label{fig:2a}
\end{minipage}\\
\begin{minipage}[b]{.5\linewidth}
\centering\includegraphics[width=2cm]{logo}% This is an *.eps file
\subcaption{Another subfigure}\label{fig:2b}
\end{minipage}
\caption{A figure}\label{fig:2b}
\end{figure}
\end{document}

相关内容