我正在使用subcaption
,但即使我从互联网上复制粘贴代码,结果也没有子标签(a),(b)等。
\documentclass[a4paper]{jpconf}
\usepackage{graphicx}
%\usepackage{subfigure}
%\usepackage{subfig}
%\usepackage{subcaption}
\usepackage{subcaption}
\captionsetup{subrefformat=parens}
\usepackage{placeins}
\begin{document}
\begin{figure}
\captionsetup[subfigure]{labelformat = simple}
\centering
\begin{subfigure}[t]{.3\linewidth}
\centering\includegraphics[width=.5\linewidth]{example-image-a}
\caption{This is a sub-caption. This is a sub-caption. This is a sub-caption}
\end{subfigure}
\begin{subfigure}[t]{.3\linewidth}
\centering\includegraphics[width=.5\linewidth]{example-image-b}
\caption{This is a sub-caption.}
\end{subfigure}
\begin{subfigure}[t]{.3\linewidth}
\centering\includegraphics[width=.5\linewidth]{example-image-c}
\caption{This is a sub-caption. This is a sub-caption.}
\end{subfigure}
\end{figure}
\end{document}
答案1
不幸的是,您使用的文档类别不公开。
编辑:
由于您同时提供了文档类的链接,我使用它测试了我的解决方案。不幸的是,此文档类与包jpconf
不兼容。作为解决方案,我建议使用包:caption
subcaption
subfig
\documentclass[a4paper]{jpconf}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure}
\subfloat[This is a sub-caption. This is a sub-caption. This is a sub-caption]{
\includegraphics[width=0.3\linewidth]{example-image-a}}
\hfill% <---
\subfloat[This is a sub-caption.]{
\includegraphics[width=0.3\linewidth]{example-image-b}}
\hfill% <---
\subfloat[This is a sub-caption. This is a sub-caption]{
\includegraphics[width=0.3\linewidth]{example-image-c}}
\caption{Common caption}
\end{figure}
\end{document}
其结果如下:
与您的 MWE 相比,我将图像宽度增加到 0.3\linewidth,然后删除\centering
命令。subfloats
我插入了\hfill
推开的命令subfloats
。