TeX 中標題和表格之間的空格

TeX 中標題和表格之間的空格

我有這個代碼

\begin{table}[h]
\caption{Numerical example geometry}
\label{tab_numerical_geo}
\begin{center}
\scalebox{0.9}{
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline
$d^A$  & $d^B$  & $d^C$  & $l^A_{12}$ & $l^C_{12}$ & $h^A$ & $h^C$ \\
\hline
-0.4434 & 0.3455 & 0.7798 & 0.1023 & 0.1523 & 0.04 & 0.023 \\
\hline
\end{tabular}
}
\end{center}
\end{table}

我用來\scalebox減小表格的大小,但它縮小了標題和表格之間的空間。不用它,就有一個空格,這對我的文章來說很好。

有誰知道如何在保持空間的同時減少桌子的大小?我嘗試過用\footnotesize而不是\reducebox,但結果是一樣的。謝謝!

答案1

一些建議:

  • 若要在標題和表格資料之間建立更多的間距,請載入caption套件並指定選項所需的值skip;在下面的範例中,我設定了skip=0.5\baselineskip.

  • 不要使用center 環境裡面一個table;相反,使用\centering

  • 由於資料行中的材料顯然可以包含負數,因此使用array環境而不是環境tabular。這樣做將使您不必$在標題行中鍵入大量符號。

  • 如果必須使用較小的字體大小,請不要使用\scalebox,因為這樣做會創建非常“細長的”輸出。相反,請使用\small(字體大小線性減小 10%)或\footnotesize(線性減小 20%)。

  • 為了在標題行和資料行中獲得更好的間距,請插入印刷支柱。

在此輸入影像描述

\documentclass{article}
\usepackage[skip=0.5\baselineskip]{caption}
%% define a few struts
%% (from code by Claudio Beccari in TeX and TUG News, Vol. 2, 1993)
\newcommand\Tstrut{\rule{0pt}{2.9ex}}         % "top" strut
\newcommand\Bstrut{\rule[-1.2ex]{0pt}{0pt}}   % "bottom" strut
\newcommand\TBstrut{\Tstrut\Bstrut}           % "top and bottom" strut

\begin{document}

\begin{table}
\caption{Numerical example geometry}
\label{tab_numerical_geo}
\small % better than \scalebox{0.9}{...}
\centering
$\begin{array}{|*{7}{c|}}
\hline
d^A\TBstrut & d^B  & d^C  & l^{A}_{12} & l^C_{12} & h^A & h^C \\
\hline
-0.4434\TBstrut & 0.3455 & 0.7798 & 0.1023 & 0.1523 & 0.04 & 0.023 \\
\hline
\end{array}$
\end{table}
\end{document}

答案2

\bigskip嘗試在標題後面添加。它將添加一個空行,以創建所需的空間。

\documentclass{article} 
\usepackage[utf8]{inputenc}
\begin{document}
\begin{table}[h]
\caption{Numerical example geometry}
\bigskip
\label{tab_numerical_geo}
\begin{center}
\scalebox{0.9}{
...

答案3

使用包caption\resizebox

\documentclass[twocolumn]{article}
\usepackage{caption}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{blindtext}
\begin{document}
    \blindtext
    \begin{table}[!htb]
    \caption{Numerical example geometry\strut}\label{tab_numerical_geo}
    \centering
    \resizebox{\linewidth}{!}{%
    \begin{tabular}{@{}ccccccc@{}}\toprule
    $d^A$  & $d^B$  & $d^C$  & $l^A_{12}$ & $l^C_{12}$ & $h^A$ & $h^C$ \\   \midrule
    $-0.4434$ & 0.3455 & 0.7798 & 0.1023 & 0.1523 & 0.04 & 0.023 \\\bottomrule
    \end{tabular}}
    \end{table}

    \blindtext
\end{document}

在此輸入影像描述

答案4

以下是一些關於排版表格的建議。如果不知道你的限制,就很難變得更具體。為了確保標題不會太靠近表格頂部,我\strut在標題末尾使用了 a 。

    \documentclass{article}
    \usepackage{booktabs}
    \begin{document}
    \begin{table}
        \caption{Numerical example geometry\strut}
        \label{tab_numerical_geo}
        \centering
        \begin{tabular}{@{}ccccccc@{}}
        \toprule
        $d^A$  & $d^B$  & $d^C$  & $l^A_{12}$ & $l^C_{12}$ & $h^A$ & $h^C$ \\
        \midrule
        $-0.4434$ & 0.3455 & 0.7798 & 0.1023 & 0.1523 & 0.04 & 0.023 \\
        \bottomrule
        \end{tabular}
    \end{table}

    \begin{table}
        \caption{Numerical example geometry\strut}
        \label{tab_numerical_geo2}
        \catcode`!=\active
        \def!{\phantom0}
        \centering
        \begin{tabular}{@{}lr@{}}
        \toprule
        $d^A$       &$-0.4434$ \\
        $d^B$       &0.3455  \\  
        $d^C$       &0.7798  \\
        $l^A_{12}$  &0.1023  \\     
        $l^C_{12}$  &0.1523  \\  
        $h^A$       &0.04!!  \\
        $h^C$       &0.023!  \\
        \bottomrule
        \end{tabular}
    \end{table}
    \begin{table}
        \caption{Numerical example geometry\strut}
        \label{tab_numerical_geo3}
        \catcode`!=\active
        \def!{\phantom0}
        \centering
        \begin{tabular}{@{}lr@{\qquad}lr@{}}
        \toprule
        $d^A$       &$-0.4434$ &
        $d^B$       &0.3455  \\  
        $d^C$       &0.7798   & 
        $l^A_{12}$  &0.1023  \\     
        $l^C_{12}$  &0.1523   & 
        $h^A$       &0.04!!  \\
        $h^C$       &0.023!  \\
        \bottomrule
        \end{tabular}
    \end{table}

    \end{document}

在此輸入影像描述

在此輸入影像描述

在此輸入影像描述

相關內容