如何在图像网格的右下角放置标题?

如何在图像网格的右下角放置标题?

我有一个如下所示的图像网格。 Grid of images of 3 rows of 4 columns. Last row has 2 images in columns 1 and 2. The space in columns 3 and 4 is where the main caption goes.

这是使用下面的代码实现的(取自:[如何在每行/列插入固定数量的数字])2

\begin{figure}
\captionsetup{justification=centering,textfont=small}
\centering
\subcaptionbox*{A subcaption that is wider than the image above it.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic1}}\hfill
\subcaptionbox*{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic2}}\hfill
\subcaptionbox*{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic3}}\hfill
\subcaptionbox*{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic4}}\\[4mm]
\subcaptionbox*{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic5}}\hfill
\subcaptionbox*{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic6}}\hfill
\subcaptionbox*{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic7}}\hfill
\subcaptionbox*{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic8}}\\[4mm]
\subcaptionbox*{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic9}}\hfill
\subcaptionbox*{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{pic10}}\hfill
\subcaptionbox*{}[59.3mm]{}
\end{figure}

我想在右下角放置一个标题(如附图所示),并能够像普通标题一样控制它(即自动编号、格式化、垂直/水平对齐等)。如何最好地做到这一点?

答案1

像这样的标题吗?

enter image description here

只需在里面放置标题minipage或类似内容parbox,紧跟最后一个子图。

\documentclass{article}
    \usepackage{graphicx}
    \usepackage{subcaption}

    \usepackage[active,floats,tightpage]{preview}
\setlength\PreviewBorder{1em}

    \begin{document}
\begin{figure}
\centering
\subcaptionbox{A subcaption that is wider than the image above it.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\hfill
\subcaptionbox{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\hfill
\subcaptionbox{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\hfill
\subcaptionbox{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\\[4mm]
\subcaptionbox{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\hfill
\subcaptionbox{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\hfill
\subcaptionbox{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\hfill
\subcaptionbox{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\\[4mm]
\subcaptionbox{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\hfill
\subcaptionbox{Another subcaption.}[28mm]{\includegraphics[width=22mm, height=32mm]{example-image}}\hfill
\begin{minipage}[b]{59.3mm}% added for caption
    \caption{main caption. text text text text  text text text text text text text text text text text text text text text text text text text text text text text text}
\end{minipage}
\end{figure}
    \end{document}

下次请提供以\documentclas{...} and ended with\end{document} 开头的 MWE ...

答案2

您也可以使用该floatrow 包及其\RawCaption命令执行此操作:

\documentclass{article}
\usepackage{caption, subcaption}
\usepackage{floatrow}
\usepackage[demo]{graphicx}
\usepackage[showframe]{geometry}
\usepackage{ragged2e}


\DeclareFloatVCode{myrowsep}{\vskip 3.5ex}
\begin{document}

\begin{figure}
  \centering
  \floatsetup{justification =centering, rowpostcode=myrowsep, floatwidth = 28mm}
  \captionsetup{justification=centering,textfont=small}
  \ffigbox{
    \begin{subfloatrow}[4]
      \ffigbox{\includegraphics[width=22mm, height=32mm]{pic1}}{\caption{A subcaption}\label{pic1}}%A subcaption that is wider than the image above it
      \ffigbox{\includegraphics[width=22mm, height=32mm]{pic2}}{\caption{A second subcaption}\label{pic2}}
      \ffigbox{\includegraphics[width=22mm, height=32mm]{pic3}}{\caption{A third subcaption}\label{pic3}}
      \ffigbox{\includegraphics[width=22mm, height=32mm]{pic4}}{\caption{A fourth subcaption}\label{pic4}}
    \end{subfloatrow}
    \begin{subfloatrow}[4]
      \ffigbox{\includegraphics[width=22mm, height=32mm]{pic5}}{\caption{A fifth subcaption}\label{pic5}}
      \ffigbox{\includegraphics[width=22mm, height=32mm]{pic6}}{\caption{A sixth subcaption}\label{pic6}}
      \ffigbox[32mm]{\includegraphics[width=22mm, height=32mm]{pic7}}{\caption{A seventh subcaption}\label{pic7}}
      \ffigbox{\includegraphics[width=22mm, height=32mm]{pic8}}{\caption{An eighth subcaption}\label{pic8}}
    \end{subfloatrow}
    \begin{subfloatrow*}[4]
      \ffigbox{\includegraphics[width=22mm, height=32mm]{pic9}}{\subcaption{A ninth subcaption}\label{pic9}}
      \ffigbox{\includegraphics[width=22mm, height=32mm]{pic10}}{\subcaption{A tenth subcaption}\label{pic10}}%
      \ffigbox[\dimexpr56mm + 4em\relax][][t]{}{\captionsetup{justification=RaggedRight}\RawCaption{\parbox[t][32mm]{48mm}{\caption{A global caption.\\ Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah. }\label{glo}}}}
    \end{subfloatrow*}
    }{}
\end{figure}

\end{document} 

enter image description here

相关内容