如何移动图形的整体标题以利用可用空间?

如何移动图形的整体标题以利用可用空间?

我想移动图形标题以更好地利用文档中的空间。以下是一些示例代码:

\documentclass{article}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{graphicx}
\begin{document}
    \begin{figure*}
        \begin{subfigure}{0.25\linewidth}
            \includegraphics[width=\linewidth]{example-image-a}
            \caption{one}
            \label{one}
        \end{subfigure}
        \begin{subfigure}{0.25\linewidth}
            \includegraphics[width=\linewidth]{example-image-a}
            \caption{one}
            \label{two}
        \end{subfigure}
        \begin{subfigure}{0.25\linewidth}
            \includegraphics[width=\linewidth]{example-image-a}
            \caption{one}
            \label{three}
        \end{subfigure}
            \begin{subfigure}{0.25\linewidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{four}
        \label{four}
    \end{subfigure}
    \begin{subfigure}{0.25\linewidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{fice}
        \label{five}
    \end{subfigure}
    \begin{subfigure}{0.25\linewidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{six}
        \label{six}
    \end{subfigure}
        \begin{subfigure}{0.25\linewidth}
    \includegraphics[width=\linewidth]{example-image-a}
    \caption{seven}
    \label{seven}
    \end{subfigure}
    \caption{I am a long overall caption but to save space in my paper I would like to put me in the extra space within the figure. I am a long overall caption but to save space in my paper I would like to put me in the extra space within the figure. I am a long overall caption but to save space in my paper I would like to put me in the extra space within the figure. }
    \label{}
    \end{figure*}
\end{document}

其结果为: 在此处输入图片描述

我怎样才能使这个图形看起来像这样(我用油漆制作的)。

在此处输入图片描述

答案1

您可以像这样手动进行操作:

\documentclass{article}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{graphicx}
\begin{document}
    \begin{figure*}
        \begin{subfigure}{0.25\linewidth}
            \includegraphics[width=\linewidth]{example-image-a}
            \caption{one}
            \label{one}
        \end{subfigure}
        \begin{subfigure}{0.25\linewidth}
            \includegraphics[width=\linewidth]{example-image-a}
            \caption{one}
            \label{two}
        \end{subfigure}
        \begin{subfigure}{0.25\linewidth}
            \includegraphics[width=\linewidth]{example-image-a}
            \caption{one}
            \label{three}
        \end{subfigure}
            \begin{subfigure}{0.25\linewidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{four}
        \label{four}
    \end{subfigure}
    \begin{subfigure}{0.25\linewidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{fice}
        \label{five}
    \end{subfigure}
    \begin{subfigure}{0.25\linewidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{six}
        \label{six}
    \end{subfigure}
    \begin{subfigure}{0.25\linewidth}
    \includegraphics[width=\linewidth]{example-image-a}
    \caption{seven}
    \label{seven}
    \end{subfigure}

    \vspace{-7\baselineskip}\captionsetup{margin={0.30\linewidth,0pt}}
    \caption{I am a long overall caption but to save space in my paper I would like to put me in the extra space within the figure. I am a long overall caption but to save space in my paper I would like to put me in the extra space within the figure. I am a long overall caption but to save space in my paper I would like to put me in the extra space within the figure. }
    \label{}
    \end{figure*}
\end{document}

在此处输入图片描述

答案2

由于您想要三个数字,每个数字占文本宽度的 25%,因此它们之间的间距为文本宽度的 12.5%。然后我们可以创建一个tabular设置\tabcolsep为 的0.0625\textwidth。因此,最后两列将占据文本宽度的 25%+12.5%+25%=62.5%。

将环境设置subfigure为顶部对齐,顶部留出零空间,这样我们就可以实现与图像顶部的对齐。然后就\multicolumn{2}{p{0.625\textwidth}@{}}{\caption{...}}可以解决问题了。

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

\begin{document}

\begin{figure}[htp]

\setlength{\tabcolsep}{0.0625\textwidth}
\begin{tabular}{@{} c c c @{}}
\begin{subfigure}[t]{0.25\linewidth}
  \vspace{0pt}
  \includegraphics[width=\linewidth]{example-image-a}
  \caption{one}
  \label{one}
\end{subfigure}
&
\begin{subfigure}[t]{0.25\linewidth}
  \vspace{0pt}
  \includegraphics[width=\linewidth]{example-image-a}
  \caption{one}
  \label{two}
\end{subfigure}
&
\begin{subfigure}[t]{0.25\linewidth}
  \vspace{0pt}
  \includegraphics[width=\linewidth]{example-image-a}
  \caption{one}
  \label{three}
\end{subfigure}
\\
\begin{subfigure}[t]{0.25\linewidth}
  \vspace{0pt}
  \includegraphics[width=\linewidth]{example-image-a}
  \caption{four}
  \label{four}
\end{subfigure}
&
\begin{subfigure}[t]{0.25\linewidth}
  \vspace{0pt}
  \includegraphics[width=\linewidth]{example-image-a}
  \caption{five}
  \label{five}
\end{subfigure}
&
\begin{subfigure}[t]{0.25\linewidth}
  \vspace{0pt}
  \includegraphics[width=\linewidth]{example-image-a}
  \caption{six}
  \label{six}
\end{subfigure}
\\
\begin{subfigure}[t]{0.25\linewidth}
  \vspace{0pt}
  \includegraphics[width=\linewidth]{example-image-a}
  \caption{seven}
  \label{seven}
  \end{subfigure}
&
\multicolumn{2}{p{0.625\textwidth}@{}}{%
  \caption{I am a long overall caption but to save space 
    in my paper I would like to put me in the extra space
    within the figure. I am a long overall caption but to
    save space in my paper I would like to put me in the
    extra space within the figure. I am a long overall
    caption but to save space in my paper I would like to
    put me in the extra space within the figure.}
  \label{full}}
\end{tabular}

\end{figure}

\end{document}

在此处输入图片描述

相关内容