图表网格,每行左侧有标题

图表网格,每行左侧有标题

我认为标题说明了一切:我从 3 个不同角度拍摄了 5 个物体的照片。因此每个物体都有 3 张照片。我想显示它们,这样每个物体就有一行,并且在那一行中显示该物体的 3 张图片。我知道我可以使用 subfigure\subcaption 来做到这一点,但我想要一些额外的东西,我不知道如何实现:

  1. 我想删除图形下方的标签
  2. 我希望对象的名称位于每行的左侧,垂直居中。

我怎样才能实现这个目标?

答案1

这是一个可能的解决方案,使用floatrowcaption包装:

\documentclass{article}
\usepackage{floatrow}
\usepackage{caption}
\usepackage[demo]{graphicx}

\DeclareCaptionFormat{myformat}{}
\DeclareCaptionSubType{figure}

\captionsetup[subfigure]{format=myformat}

\begin{document}

\thisfloatsetup{capbesidesep=columnsep,%
capbesideframe=yes,capbesideposition={left,center}}
\begin{figure}
\fcapside[\FBwidth]
{\begin{subfloatrow}
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image1a}}%
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image2a}}\quad
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image3a}}%
\end{subfloatrow}}
{\caption{First row of figures}}
\fcapside[\FBwidth]
{\begin{subfloatrow}
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image1b}}%
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image2b}}\quad
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image3b}}%
\end{subfloatrow}}
{\caption{Second row of figures}}
\fcapside[\FBwidth]
{\begin{subfloatrow}
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image1c}}%
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image2c}}\quad
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image3c}}%
\end{subfloatrow}}
{\caption{Third row of figures}}
\fcapside[\FBwidth]
{\begin{subfloatrow}
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image1d}}%
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image2d}}\quad
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image3d}}%
\end{subfloatrow}}
{\caption{Fourth row of figures}}
\fcapside[\FBwidth]
{\begin{subfloatrow}
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image1e}}%
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image2e}}\quad
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image3e}}%
\end{subfloatrow}}
{\caption{Fifth row of figures}}
\end{figure}

\end{document}

在此处输入图片描述

选项demographicx用黑色矩形替换实际图形;不是在实际文档中使用该选项。

如果不需要标签(图号:),则可以简单地使用\caption*

\documentclass{article}
\usepackage{floatrow}
\usepackage{caption}
\usepackage[demo]{graphicx}

\DeclareCaptionFormat{myformat}{}
\DeclareCaptionSubType{figure}

\captionsetup[subfigure]{format=myformat}

\begin{document}

\thisfloatsetup{capbesidesep=columnsep,%
capbesideframe=yes,capbesideposition={left,center}}
\begin{figure}
\fcapside[\FBwidth]
{\begin{subfloatrow}
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image1a}}%
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image2a}}\quad
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image3a}}%
\end{subfloatrow}}
{\caption*{First row of figures}}
\fcapside[\FBwidth]
{\begin{subfloatrow}
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image1b}}%
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image2b}}\quad
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image3b}}%
\end{subfloatrow}}
{\caption*{Second row of figures}}
\fcapside[\FBwidth]
{\begin{subfloatrow}
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image1c}}%
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image2c}}\quad
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image3c}}%
\end{subfloatrow}}
{\caption*{Third row of figures}}
\fcapside[\FBwidth]
{\begin{subfloatrow}
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image1d}}%
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image2d}}\quad
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image3d}}%
\end{subfloatrow}}
{\caption*{Fourth row of figures}}
\fcapside[\FBwidth]
{\begin{subfloatrow}
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image1e}}%
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image2e}}\quad
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image3e}}%
\end{subfloatrow}}
{\caption*{Fifth row of figures}}
\end{figure}

\end{document}

在此处输入图片描述

在评论中,诺姆报告上述解决方案和wrapfig包之间存在一些问题;以下示例显示包之间不存在不兼容性:

\documentclass{article}
\usepackage{floatrow}
\usepackage{caption}
\usepackage[demo]{graphicx}
\usepackage{wrapfig}
\usepackage{lipsum}% just to generate text for the example

\DeclareCaptionFormat{myformat}{}
\DeclareCaptionSubType{figure}

\captionsetup[subfigure]{format=myformat}

\begin{document}

\thisfloatsetup{capbesidesep=columnsep,%
capbesideframe=yes,capbesideposition={left,center}}
\begin{figure}
\fcapside[\FBwidth]
{\begin{subfloatrow}
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image1a}}%
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image2a}}\quad
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image3a}}%
\end{subfloatrow}}
{\caption*{First row of figures}}
\fcapside[\FBwidth]
{\begin{subfloatrow}
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image1b}}%
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image2b}}\quad
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image3b}}%
\end{subfloatrow}}
{\caption*{Second row of figures}}
\fcapside[\FBwidth]
{\begin{subfloatrow}
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image1c}}%
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image2c}}\quad
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image3c}}%
\end{subfloatrow}}
{\caption*{Third row of figures}}
\fcapside[\FBwidth]
{\begin{subfloatrow}
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image1d}}%
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image2d}}\quad
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image3d}}%
\end{subfloatrow}}
{\caption*{Fourth row of figures}}
\fcapside[\FBwidth]
{\begin{subfloatrow}
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image1e}}%
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image2e}}\quad
    \ffigbox[\FBwidth]{\caption{}}{\includegraphics[width=2cm]{image3e}}%
\end{subfloatrow}}
{\caption*{Fifth row of figures}}
\end{figure}

\begin{wrapfigure}{r}{6cm}
\centering
\includegraphics[width=5cm]{image}
\caption{text}
\end{wrapfigure}
\lipsum[1-4]

\end{document}

输出:

在此处输入图片描述

相关内容