现在我用的是这个:
\begin{figure}
\centerline{
\begin{subfigure}{0.6\textwidth}
\includegraphics[scale=0.5]{images/mesh12}
\caption{The acoustic pressure field of a finely meshed 2D model according to equation~\ref{eq:numberofelements} (12 mesh elements per wavelength).}
\label{fig:mesh1}
\end{subfigure}
\begin{subfigure}{0.6\textwidth}
\includegraphics[scale=0.5]{images/mesh4}
\caption{The acoustic pressure field of a 2D model with 4 mesh elements per wavelength. }
\label{fig:mesh2}
\end{subfigure}
}
\caption{Two 2D simulations of the acoustic pressure field with different mesh resolutions. The slit in the middle of the circle is the smartphone and the outer ring is the PML. A single speaker is used. The axes are in meters.}
\label{fig:mesh4and12}
\end{figure}
我的问题在于图 (a) 和 (b) 的子标题彼此太近,看起来像长句子。如何在这两个标题之间添加空格?
谢谢!
答案1
减小环境尺寸subfigure
,例如0.47\textwidth
,将图形放置在\hfill
与图像尺寸之间,并用以下方法确定with=\linewidth
:
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subcaption}
\usepackage[font={it,footnotesize}]{caption}
\begin{document}
\begin{figure}
\centerline{
\begin{subfigure}[t]{0.47\textwidth}
\includegraphics[width=\linewidth]{images/mesh12}
\caption{The acoustic pressure field of a finely meshed 2D model according to equation~\ref{eq:numberofelements} (12 mesh elements per wavelength).}
\label{fig:mesh1}
\end{subfigure}
\hfill
\begin{subfigure}[t]{0.47\textwidth}
\includegraphics[width=\linewidth]{images/mesh4}
\caption{The acoustic pressure field of a 2D model with 4 mesh elements per wavelength. }
\label{fig:mesh2}
\end{subfigure}
}
\caption{Two 2D simulations of the acoustic pressure field with different mesh resolutions. The slit in the middle of the circle is the smartphone and the outer ring is the PML. A single speaker is used. The axes are in meters.}
\label{fig:mesh4and12}
\end{figure}
\end{document}
答案2
使用该floatrow
包,您可以选择包含(子)图形及其(子)标题的框的宽度。下面是一个例子,我选择了图形对象的自然宽度:
\documentclass{article}
\usepackage{caption, subcaption}
\usepackage{floatrow}
\usepackage[demo]{graphicx}
\usepackage[showframe]{geometry}
\DeclareFloatSeparators{qqquad}{\hspace{3em}}
\begin{document}
\begin{figure}
\floatsetup{subfloatrowsep =qqquad}
\ffigbox[\FBwidth]{\begin{subfloatrow}
\ffigbox[\FBwidth]{\includegraphics[width=0.4\textwidth]{images/mesh12}}
{\caption{The acoustic pressure field of a finely meshed 2D model according to equation~\ref{eq:numberofelements} (12 mesh elements per wavelength).}
\label{fig:mesh1}}
\ffigbox[\FBwidth]{ \includegraphics[width=0.4\textwidth]{images/mesh4}}
{\caption{The acoustic pressure field of a 2D model with 4 mesh elements per wavelength. }
\label{fig:mesh2}}
\end{subfloatrow}} {\caption{Two 2D simulations of the acoustic pressure field with different mesh resolutions. The slit in the middle of the circle is the smartphone and the outer ring is the PML. A single speaker is used. The axes are in meters.}
\label{fig:mesh4and12}}
\end{figure}
\end{document}