考虑以下代码
\begin{figure}[h!]
\centering
\begin{minipage}{\linewidth}
\centering
\begin{subfigure}[b]{.4\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image}
\caption{}
\end{subfigure}
\centering
\begin{subfigure}[b]{.4\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image}
\caption{}
\end{subfigure}
\end{minipage}
\par\medskip
\caption{Example main caption}
\end{figure}
这使
是否有可能提高\caption{}
单个子图的?例如,得到类似
我尝试过类似的东西\vspace{-2mm}\caption{}\vspace{2mm}
,但似乎不起作用。有什么想法吗?
答案1
\captionseup
内部subfigure
环境只会影响该子标题
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\captionsetup[sub]{position=bottom}
\begin{document}
\begin{figure}[h!]
\centering
\begin{subfigure}[t]{0.48\linewidth}
\captionsetup{skip=1pt}%
\includegraphics[width=\linewidth]{example-image}
\caption{A}
\end{subfigure}%
\hfill
\begin{subfigure}[t]{.48\textwidth}
\includegraphics[width=\linewidth]{example-image}
\caption{B}
\end{subfigure}
\caption{Example main caption}
\end{figure}
\end{document}