如何调整/操作子浮点中的标签

如何调整/操作子浮点中的标签

给出以下代码使用subfloat

\documentclass[12pt,a4paper]{article}   
\usepackage[utf8]{inputenc}

\usepackage{caption}
\captionsetup[table]{font=sf, labelformat=empty}
\captionsetup[figure]{font=sf}

\usepackage{graphicx,txfonts}
\usepackage{subfig}

\begin{document}

\begin{figure}[ht]
\centering
    \subfloat[]{\label{subfig:w1}\includegraphics[width=0.245\textwidth]{w1.png}}
    \subfloat[]{\label{subfig:s1}\includegraphics[width=0.245\textwidth]{s1.png}}
    \subfloat[]{\label{subfig:o1}\includegraphics[width=0.245\textwidth]{o1.png}}
    \subfloat[]{\label{subfig:d1}\includegraphics[width=0.245\textwidth]{d1.png}}\\

    \subfloat[]{\label{subfig:w2}\includegraphics[width=0.245\textwidth]{w2.png}}
    \subfloat[]{\label{subfig:s2}\includegraphics[width=0.245\textwidth]{s2.png}}
    \subfloat[]{\label{subfig:o2}\includegraphics[width=0.245\textwidth]{o2.png}}
    \subfloat[]{\label{subfig:d2}\includegraphics[width=0.245\textwidth]{d2.png}}\\

\caption{Example of Challenging Conditions:
\protect\subref{subfig:w1} Weather1, 
\protect\subref{subfig:s1} Season1, 
\protect\subref{subfig:o1} Occlusion1, 
\protect\subref{subfig:d1} DayNigh1, 
and
\protect\subref{subfig:w2} Weather2, 
\protect\subref{subfig:s2} Season2, 
\protect\subref{subfig:o2} Occlusion2, 
\protect\subref{subfig:d2} DayNigh2, 
}
\label{fig:challenges}
\end{figure}
    
\end{document}

我得到下图: 得到

但是,我想操纵标签,以便摆脱顶部的标签(因为它们属于同一类别)并得到类似于该图的内容: 期望

@Simon 建议添加以下代码并使用表格:

\begin{table}[hb!]
    \centering
        \setlength{\tabcolsep}{0pt}\sffamily
        \begin{tabular}{cccc}
            \includegraphics[width=0.245\textwidth]{example-image}&
            \includegraphics[width=0.245\textwidth]{example-image}& 
            \includegraphics[width=0.245\textwidth]{example-image}&
            \includegraphics[width=0.245\textwidth]{example-image}\\    
            \includegraphics[width=0.245\textwidth]{example-image}&
            \includegraphics[width=0.245\textwidth]{example-image}& 
            \includegraphics[width=0.245\textwidth]{example-image}&
            \includegraphics[width=0.245\textwidth]{example-image}\\
                a) Weather & b) Season & c) Occlusion  & d) Day/Night
        \end{tabular}
        \caption{Example of Challenging Conditions}\label{tab:challenges}   
    \end{table} 

结果如下: 推荐

其中Figure 1:标题未提及。

是否有任何可行的办法subfloat可以解决这个问题?

干杯,

答案1

更新以匹配更新的问题

除了使用,您figuresubfloats可以使用tabular

d

这是代码:

\documentclass[12pt,a4paper]{article}   

\usepackage{graphicx}
\usepackage{subcaption}

\usepackage{caption}
\captionsetup[figure]{font=sf}

\begin{document}
    
    \begin{figure}
        \centering
        \subfloat[]{\label{subfig:w1}\includegraphics[width=0.245\textwidth]{example-image}}
        \subfloat[]{\label{subfig:s1}\includegraphics[width=0.245\textwidth]{example-image}}
        \subfloat[]{\label{subfig:o1}\includegraphics[width=0.245\textwidth]{example-image}}
        \subfloat[]{\label{subfig:d1}\includegraphics[width=0.245\textwidth]{example-image}}\\
        
        \subfloat[]{\label{subfig:w2}\includegraphics[width=0.245\textwidth]{example-image}}
        \subfloat[]{\label{subfig:s2}\includegraphics[width=0.245\textwidth]{example-image}}
        \subfloat[]{\label{subfig:o2}\includegraphics[width=0.245\textwidth]{example-image}}
        \subfloat[]{\label{subfig:d2}\includegraphics[width=0.245\textwidth]{example-image}}\\
                    
        \caption{Example of Challenging Conditions:
            (\subref{subfig:w1}) Weather1, 
            (\subref{subfig:s1}) Season1, 
            (\subref{subfig:o1}) Occlusion1, 
            (\subref{subfig:d1}) DayNigh1, 
            and
            (\subref{subfig:w2}) Weather2, 
            (\subref{subfig:s2}) Season2, 
            (\subref{subfig:o2}) Occlusion2, 
            (\subref{subfig:d2}) DayNigh2, 
        }
        \label{fig:challenges}
    \end{figure}

    

    \begin{figure}[hb!]
        \centering
        \setlength{\tabcolsep}{0pt}\sffamily
        \begin{tabular}{cccc}
            \includegraphics[width=0.245\textwidth]{example-image}&
            \includegraphics[width=0.245\textwidth]{example-image}& 
            \includegraphics[width=0.245\textwidth]{example-image}&
            \includegraphics[width=0.245\textwidth]{example-image}\\    
            \includegraphics[width=0.245\textwidth]{example-image}&
            \includegraphics[width=0.245\textwidth]{example-image}& 
            \includegraphics[width=0.245\textwidth]{example-image}&
            \includegraphics[width=0.245\textwidth]{example-image}\\
                a) Weather & b) Season & c) Occlusion  & d) Day/Night
        \end{tabular}
        \caption{Example of Challenging Conditions}\label{fig:challenges2}  
    \end{figure}    

See the first column of figure \ref{fig:challenges2}.
    
\end{document}

相关内容