我使用以下代码在一行中列出 3 个图。如果我删除\subcaption
每个图的 ,它运行良好并显示该图。但是,当我包含 ( \subcaption
) 时,它会显示带有子标题的图,但下图中显示错误。有什么建议吗?
\begin{figure}[H]
%A
\centering
\begin{minipage}[t]{\dimexpr.355\textwidth-1em} % 0.335 represents the horizontal spacing
\centering
\includegraphics[width=\textwidth]{Fig14_VOL1_Annotated}
\subcaption{ CA $ < \ang{90}$}
\label{Fig14:A}
\end{minipage}\hfill
%B
\begin{minipage}[t]{\dimexpr.355\textwidth-1em}
\centering
\includegraphics[width=\textwidth]{Fig14_volumegreater90Annotated}
\subcaption{CA $ > \ang{90}$}
\label{Fig14:B}
\end{minipage}\hfill
%C
\begin{minipage}[t]{\dimexpr.355\textwidth-1em}
\centering
\includegraphics[width=\textwidth]{Fig14_vmiddlev1withannotation}
\subcaption{CA $=\ang{90}$}
\label{Fig14:C}
\end{minipage}\hfill
\caption{Volume and contact angle calculations according to CA value }
\label{Fig.14}
\end{figure}
答案1
请尝试以下操作:
\documentclass[12pt]{article}
\usepackage{graphicx,subcaption,mwe}
\usepackage{amsmath}
\begin{document}
\begin{figure}[htb]
\begin{minipage}[t]{0.2\textwidth}
\centering
\includegraphics[width=1cm]{example-image-A}
\subcaption{CA1}
\label{Fig14:a}
\end{minipage}\hfill
\begin{minipage}[t]{0.2\textwidth}
\centering
\includegraphics[width=1cm]{example-image-B}
\subcaption{CA2}
\label{Fig14:b}
\end{minipage}\hfill
\begin{minipage}[t]{0.2\textwidth}
\centering
\includegraphics[width=1cm]{example-image-C}
\subcaption{CA3}
\label{Fig14:c}
\end{minipage}
\end{figure}
\end{document}