垂直移动子浮动字幕

垂直移动子浮动字幕

如何垂直移动子浮点的子标题?我的子图有很多空白,子图和子标题之间出现很长的空白。因此,我想垂直移动子标题,并可能在子图上移动。以下是代码:

\documentclass{article}
\usepackage{float}
\usepackage[caption=false,font=footnotesize,captionskip=-0.01mm,farskip=0mm]{subfig}
\usepackage{graphicx}
\begin{document}
\begin{figure}[!t]
            \hspace*{-0.85cm}
            \centering 
            \captionsetup{oneside,margin={0.5cm,0cm}}
            \subfloat[]{\includegraphics [height = 34mm] {example-image-a}}
            \hfil
            \vspace{-1.5mm}
            
            \hspace*{-0.85cm}
            \subfloat[]{\includegraphics [height = 34mm] {example-image-b}}
            \hfil
            \vspace{-1.5mm}
            
            \hspace*{-0.85cm}
            \subfloat[]{\includegraphics [height = 34mm] {example-image-c}}
            \hfil
            \vspace{-1.5mm}
            
            \hspace*{-0.85cm}
            \subfloat[]{\includegraphics [height = 34mm] {example-image-d}}
            \hfil
            \vspace{-1.5mm}
            
            \hspace*{-0.85cm}
            \subfloat[]{\includegraphics [height = 34mm] {example-image-e}}
            \vspace{3mm}
            
            \caption{Caption.}\vspace{-3mm}
            \label{label}
\end{figure}
\end{document}

答案1

subcaption您可以使用控制其位置captionskip。负值将使其覆盖在子图上。

用于farskip在子图之间添加一些垂直空间。

b

\documentclass{article}

\usepackage[caption=false,font=footnotesize,captionskip=-8mm,farskip=5mm]{subfig} % changed <<<<<<<<<<<
\usepackage{graphicx}

\begin{document}
    \begin{figure}[!ht]
        \centering 
        \subfloat[]{\includegraphics [height = 34mm] {example-image-a}}     
        \hfil
        \subfloat[]{\includegraphics [height = 34mm] {example-image-b}}
        \hfil
        \subfloat[]{\includegraphics [height = 34mm] {example-image-c}}
        \hfil
        \subfloat[]{\includegraphics [height = 34mm] {example-image-a}}
        \hfil
        \subfloat[]{\includegraphics [height = 34mm] {example-image-b}}     
        \caption{Caption.}
        \label{label1}
    \end{figure}
\end{document}

\hfil填充相邻子图之间的所有水平空间。无需使用\hspace{}

相关内容