我通常使用子图。但这次我不得不使用 minipage。但是,子图的标题似乎是图 1、图 2.....但是,我想要图 1a、1b....有人能提出解决方案吗?我也试过了,subfloat
但我收到的错误消息是Missing \endcsname inserted. \subfloat
谢谢
\begin{minipage}{.49\columnwidth}
\caption{Subfigure (\alph{figure})}
\includegraphics[width=\textwidth]{example-image-a}
\label{fig:subfig1}
\end{minipage}
\begin{minipage}{.49\columnwidth}
\caption{Subfigure (\alph{figure})}
\includegraphics[width=\textwidth]{example-image-b}
\label{fig:subfig2}
\end{minipage}
\begin{minipage}{.49\columnwidth}
\caption{Subfigure (\alph{figure})}
\includegraphics[width=\textwidth]{example-image-c}
\label{fig:subfig3}
\end{minipage}
\begin{minipage}{.49\columnwidth}
\caption{Subfigure (\alph{figure})}
\includegraphics[width=\textwidth]{example-image}
\label{fig:subfig4}
\end{minipage}
答案1
\documentclass{article}
\usepackage{subcaption}
\usepackage{pgffor}
\usepackage{alphalph}
\renewcommand\thesubfigure{1\alphalph{\value{subfigure}}}
\begin{document}
\begin{figure}
\foreach \i in {1,...,20}{
\begin{minipage}[b]{.3\linewidth}
\centering\large A\i
\subcaption{A subfigure}\label{fig:1A\i}
\end{minipage}%
\begin{minipage}[b]{.3\linewidth}
\centering\large B\i
\subcaption{A subfigure}\label{fig:1b\i}
\end{minipage}
\begin{minipage}[b]{.3\linewidth}
\centering\large C\i
\subcaption{A subfigure}\label{fig:1c\i}
\end{minipage}\\
}
\end{figure}
\end{document}
或者
\documentclass{article}
\usepackage{subcaption}
\usepackage{pgffor}
\usepackage{alphalph}
\usepackage[demo]{graphicx}
\renewcommand\thesubfigure{1\alphalph{\value{subfigure}}}
\begin{document}
\begin{figure}
\begin{minipage}[b]{.3\linewidth}
\centering \includegraphics[width=\textwidth]{example-image-a}
\subcaption{A subfigure}
\end{minipage}%
\end{figure}
\end{document}