无标签的标题

无标签的标题

我正在使用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不兼容。作为解决方案,我建议使用包:captionsubcaptionsubfig

\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

相关内容