带有组合标题的子图?

带有组合标题的子图?

是否可以将数字分组为单个浮点数并分别引用它们,没有为每个图形创建单独的标题?

enter image description here

我知道subfloatsubfigure环境,但它们为每个图创建单独的标题。我特别想要的功能是具有子图编号(例如 (a)、(b)...),但还将标题组合成单个文本块,并通过对图像的引用((a)、(b)...)分隔。

答案1

这是一个使用 的解决方案subcaption。我认为使用 也可以获得类似的结果subfloat

只需给出\caption{}不带任何参数,这样它就会只打印标签(一),(二)...)不是标题文字。然后可以为主图提供标题,其中子图可以“子”引用。示例输出:

enter image description here

通过修改代码制作相应的 MWE另一个问题

\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\captionsetup{subrefformat=parens}

\begin{document}
\begin{figure}
    \centering
    \begin{subfigure}[b]{0.3\linewidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{}
        \label{fig:a}
    \end{subfigure}
    \begin{subfigure}[b]{0.3\linewidth}
        \includegraphics[width=\linewidth]{example-image-b}
        \caption{}
        \label{fig:b}
    \end{subfigure}
    \begin{subfigure}[b]{0.3\linewidth}
        \includegraphics[width=\linewidth]{example-image-c}
        \caption{}
        \label{fig:c}
    \end{subfigure}
    \caption{
        \subref{fig:a} first figure.
        \subref{fig:b} second figure.
        \subref{fig:c} third figure.
    }
    \label{fig:main}
\end{figure}
Figure~\ref{fig:main} has three Subfigures--- \ref{fig:a}, \ref{fig:b} and  \ref{fig:c}.
\end{document}

编辑

可以手动将标题放在左侧,然后使用\phantomsubcaption来隐藏自动标题。示例输出:

enter image description here

对应代码:

\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\captionsetup{subrefformat=parens}

\begin{document}
\begin{figure}
    \centering
        {(a)~\includegraphics[width=0.25\linewidth]{example-image-a}
        \phantomsubcaption\label{fig:a}}
        {(b)~\includegraphics[width=0.25\linewidth]{example-image-b}
        \phantomsubcaption\label{fig:b}}
        {(c)~\includegraphics[width=0.25\linewidth]{example-image-c}
        \phantomsubcaption\label{fig:c}}
    \caption{
        \subref{fig:a} first figure.
        \subref{fig:b} second figure.
        \subref{fig:c} third figure.
    }
    \label{fig:main}
\end{figure}
Figure~\ref{fig:main} has three Subfigures--- \ref{fig:a}, \ref{fig:b} and  \ref{fig:c}.
\end{document}

答案2

作为替代方案nidhin 的回答,也可以使用 subfig 包:

enter image description here

\documentclass{article}
\usepackage{subfig}
\usepackage{graphicx}
\begin{document}

\begin{figure}
  \centering
  % [] Needed for the caption label (a), (b) to be typeset.
  \subfloat[\label{fig:mytopic-blabla}]{
    \includegraphics[height=5cm]{images/graph-mytopic-blabla.png}
  }
  \subfloat[]{
    % Label can be either in caption or body.
    \label{fig:mytopic-yadayada}
    \includegraphics[height=5cm]{images/graph-mytopic-yadayada.png}
  }
  \caption{
    % Must \protect the subref command inside floats/captions.
    \protect\subref{fig:mytopic-blabla}
    Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. 
    \protect\subref{fig:mytopic-yadayada}
    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
  }
\end{figure}

\end{document}

相关内容