表格與標題之間的間隙* 表格內

表格與標題之間的間隙* 表格內

我在圖 A 和 B中插入兩個tabulars 。tabletablecaptiontabularcaption*

\documentclass{article}
\usepackage{caption}
\begin{document}
\begin{table}
\centering
\caption{SHORT TITLE}
\caption*{Panel A. LONG DESCRIPTION}
\begin{tabular}{*5c} \hline
0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 \\ \hline
\end{tabular}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%             I ALSO NEED A GAP HERE             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\caption*{Panel B. LONG DESCRIPTION}
\begin{tabular}{*5c} \hline
0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 \\ \hline
\end{tabular}
\end{table}
\end{document}

而且我發現第一tabular和第二之間的差距caption*太小了。其他三個間隙 ( caption- caption*, caption*- tabular, caption*- tabular) 都可以。為什麼他們有不同的差距?

我也嘗試瞭subtable如下,但緊密的間隙看起來仍然很難看。

\documentclass{article}
\usepackage{caption,subcaption}
\begin{document}
\begin{table}
\centering
\caption{SHORT TITLE}
\begin{subtable}{\textwidth}
\centering
\subcaption{Panel A. LONG DESCRIPTION}
\begin{tabular}{*5c} \hline
0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 \\ \hline
\end{tabular}
\end{subtable}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%              STILL NO GAP APPLIED              %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{subtable}{\textwidth}
\centering
\subcaption{Panel B. LONG DESCRIPTION}
\begin{tabular}{*5c} \hline
0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 \\ \hline
\end{tabular}
\end{subtable}
\end{table}
\end{document}

在這裡我添加了我的版本(\vspace{10pt}for\caption*\vspace{6pt}for \subcaption*)但不知道是否最好。

\documentclass{article}
\usepackage{caption}
\begin{document}
\begin{table}
\centering
\caption{SHORT TITLE}
\caption*{Panel A. LONG DESCRIPTION}
\begin{tabular}{*5c} \hline
0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 \\ \hline
\end{tabular}\vspace{10pt}

\caption*{Panel B. LONG DESCRIPTION}
\begin{tabular}{*5c} \hline
0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 \\ \hline
\end{tabular}
\end{table}
\end{document}

答案1

也許這個例子會有所幫助。

\documentclass{article}

\RequirePackage{float}
\RequirePackage{caption}

\begin{document}
    
\centerline{SHORT TITLE}

    \begin{table}[H]
        \centering      
        \caption*{Panel A. LONG DESCRIPTION}
        \begin{tabular}{*5c} \hline
            0 & 0 & 0 & 0 & 0 \\
            0 & 0 & 0 & 0 & 0 \\ \hline
        \end{tabular}
    \end{table}     
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                     I ALSO NEED A GAP HERE             %
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \begin{table}[H]    
            \centering
        \caption*{Panel B. LONG DESCRIPTION}
        \begin{tabular}{*5c} \hline
            0 & 0 & 0 & 0 & 0 \\
            0 & 0 & 0 & 0 & 0 \\ \hline
        \end{tabular}
    \end{table}

\end{document}

在此輸入影像描述

或這個:(你也可以使用\subcaption*{⟨heading⟩}

\documentclass{article}
\usepackage{subcaption}
\begin{document}

\begin{table}
    \caption{FULL CAPTION}
    \begin{subtable}[t]{.5\linewidth}
      \centering
     \subcaption{    Panel A. LONG DESCRIPTION \\LONG DESCRIPTION }
        \begin{tabular}{*5c} \hline
            0 & 0 & 0 & 0 & 0 \\
            0 & 0 & 0 & 0 & 0 \\ \hline
        \end{tabular}
    \end{subtable}%
    \begin{subtable}[t]{.5\linewidth}
      \centering
    \subcaption{  Panel B. LONG DESCRIPTION \\ LONG DESCRIPTION}
      \begin{tabular}{*5c} \hline
        0 & 0 & 0 & 0 & 0 \\
        0 & 0 & 0 & 0 & 0 \\ \hline
      \end{tabular}
    \end{subtable} 
\end{table}

\end{document}

在此輸入影像描述

更新評論後。將所有內容放在表格環境中。

\documentclass{article}

\RequirePackage{float}
\RequirePackage{caption}

\begin{document}

\begin{table}
      
\caption{SHORT TITLE 1}

    \begin{table}[H]
        \centering      
        \caption*{Panel A. LONG DESCRIPTION}
        \begin{tabular}{*5c} \hline
            0 & 0 & 0 & 0 & 0 \\
            0 & 0 & 0 & 0 & 0 \\ \hline
        \end{tabular}
    \end{table}     
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                 I ALSO NEED A GAP HERE             %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \begin{table}[H]    
        \centering
        \caption*{Panel B. LONG DESCRIPTION}
        \begin{tabular}{*5c} \hline
            0 & 0 & 0 & 0 & 0 \\
            0 & 0 & 0 & 0 & 0 \\ \hline
        \end{tabular}
    \end{table}

\end{table}

\noindent ANOTHER GAP HERE    

\begin{table}[H] 
  
    \caption{SHORT TITLE 2}
    
    \begin{table}[H]
        \centering      
        \caption*{Panel C. LONG DESCRIPTION}
        \begin{tabular}{*5c} \hline
            0 & 0 & 0 & 0 & 0 \\
            0 & 0 & 0 & 0 & 0 \\ \hline
        \end{tabular}
    \end{table}     
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PLUS ANOTHER GAP HERE               %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \begin{table}[H]    
        \centering
        \caption*{Panel D. LONG DESCRIPTION}
        \begin{tabular}{*5c} \hline
            0 & 0 & 0 & 0 & 0 \\
            0 & 0 & 0 & 0 & 0 \\ \hline
        \end{tabular}
    \end{table}
    
\end{table}

\end{document}

在此輸入影像描述

相關內容