正确给题注过长的subfig子图排版

361 阅读1分钟

在写论文的时候发现了一个很麻烦的事情,其中有个子图的题注过长,导致默认情况下subfloat的子图的题注变得竖着了。具体的情况如下展示:

\begin{figure}[!htbp]
    \centering
    \subfloat[a caption of a caption of a caption of a caption] {\label{Fig:G1}}
    \begin{minipage}[h]{0.22\textwidth}
        \includegraphics[width=\textwidth]{images/fig1.png}
    \end{minipage}
    \subfloat[a long pic]{\label{Fig:G2}}
    \begin{minipage}[h]{0.22\textwidth}
        \centering
        \includegraphics[width=\textwidth]{images/fig1.png}
    \end{minipage}
    \caption{Caption: a very "very" \protect\subref{Fig:G1} and a very "long" \protect\subref{Fig:G2}}
    \label{fig:enter-label}
\end{figure}

然后此时的图片展示效果:

image.png

然后需要配合minipage对其进行修改,在这里记录一下:

\begin{figure}[!htbp]
    \centering
    \begin{minipage}{0.22\textwidth}
           \subfloat[a caption of a caption of a caption of a caption of a caption a caption of a caption of a caption of a caption of a caption a caption of a caption of a caption of a caption of a caption]{%
        \includegraphics[width=\textwidth]{images/fig1.png}%
        \label{Fig:G1}
    } 
    \end{minipage}
\quad
    \begin{minipage}{0.22\textwidth}
            \subfloat[a long pic a caption of a caption of a caption of a caption of a caption a caption of a caption of a caption of a caption of a caption a caption of a caption of a caption of a caption of a caption]{%
        \includegraphics[width=\textwidth]{images/fig1.png}%
        \label{Fig:G2}
    }
    \end{minipage}

    \caption{Caption: a very "very" \protect\subref{Fig:G1} and a very "long" \protect\subref{Fig:G2}}
    \label{fig:enter-label}
\end{figure}

image.png