在两张桌子之间留出空间

在两张桌子之间留出空间

在此处输入图片描述

我们如何在两个按列排列的表格之间留出空间,其中每个表格包含四列?

我有两个表格,每个表格有三列,但想要四列。

答案1

我大概知道你想实现什么,但在猜测之前,这里有一些代码可以排版上面的表格。请注意,代码显示了 3 个表格进行比较:Vanilla LaTeX、带有threeparttable和带有floatrow。标题的格式化由包完成caption

\documentclass{article}

\usepackage{erewhon}
\usepackage[utopia]{newtxmath}
\usepackage[T1]{fontenc}

\usepackage{caption,floatrow,booktabs,siunitx,threeparttable}

\captionsetup[table]{%
  labelsep  = newline,
  labelfont = {footnotesize,bf},
  textfont  = footnotesize}

\floatsetup{%
  font        = small,
  floatrowsep = qquad,
  captionskip = 5pt
}

\floatsetup[table]{%
  style = Plaintop
}

\begin{document}

\begin{table}[!t]
  \RawFloats
  \centering
  \caption{Vanilla \LaTeX\ -- Eigenvalues $\omega^2_0$ and
    $\omega^2_1$ of Eq. (26) for $r_0=1.1$ and varying, for the two
    strings configurations}
  \label{tab:vanill-latex}
  \begin{tabular}{@{}*{2}{%
    S[table-format=1.1]
    S[table-format={$-$}1.3]
    S[table-format=1.3]%
    }%
    @{}}
    \toprule
    \multicolumn{3}{@{}l}{$x_1$ configuration}
    & \multicolumn{3}{l@{}}{$x_3$ configuration} \\%
    \cmidrule(r){1-3}\cmidrule(l){4-6}
    \multicolumn{1}{@{}l}{B}
    & \multicolumn{1}{l}{$\omega^2_0$}
    & \multicolumn{1}{l}{$\omega^2_1$}
    & \multicolumn{1}{l}{B}
    & \multicolumn{1}{l}{$\omega^2_0$}
    & \multicolumn{1}{l}{$\omega^2_1$} \\
    \midrule
    0   & -1.370 & 7.638 & 0   & -1.370 & 7.638 \\
    0.3 & -1.327 & 7.531 & 0.3 & -1.317 & 7.548 \\
    \bottomrule
  \end{tabular}
\end{table}

\begin{table}[!h]
  \RawFloats
  \centering
  \begin{threeparttable}
    \caption{With \texttt{threeparttable} -- Eigenvalues $\omega^2_0$
      and $\omega^2_1$ of Eq. (26) for $r_0=1.1$ and varying, for the
      two strings configurations}
    \label{tab:threeparttab}
    \begin{tabular}{@{}*{2}{%
      S[table-format=1.1]
      S[table-format={$-$}1.3]
      S[table-format=1.3]%
      }%
      @{}}
      \toprule
      \multicolumn{3}{@{}l}{$x_1$ configuration}
      & \multicolumn{3}{l@{}}{$x_3$ configuration} \\%
      \cmidrule(r){1-3}\cmidrule(l){4-6}
      \multicolumn{1}{@{}l}{B}
      & \multicolumn{1}{l}{$\omega^2_0$}
      & \multicolumn{1}{l}{$\omega^2_1$}
      & \multicolumn{1}{l}{B}
      & \multicolumn{1}{l}{$\omega^2_0$}
      & \multicolumn{1}{l}{$\omega^2_1$} \\
      \midrule
      0   & -1.370 & 7.638 & 0   & -1.370 & 7.638 \\
      0.3 & -1.327 & 7.531 & 0.3 & -1.317 & 7.548 \\
      \bottomrule
    \end{tabular}
  \end{threeparttable}
\end{table}

\begin{table}[!h]
  \begin{floatrow}
    \ttabbox{%
      \sisetup{table-number-alignment=left}
      \begin{tabular}{@{}*{2}{%
        S[table-format=1.1]
        S[table-format={$-$}1.3]
        S[table-format=1.3]%
        }%
        @{}}
        \toprule
        \multicolumn{3}{@{}l}{$x_1$ configuration}
        & \multicolumn{3}{l@{}}{$x_3$ configuration}\\%
        \cmidrule(r){1-3}\cmidrule(l){4-6}
        \multicolumn{1}{@{}l}{B}
        & \multicolumn{1}{l}{$\omega^2_0$}
        & \multicolumn{1}{l}{$\omega^2_1$}
        & \multicolumn{1}{l}{B}
        & \multicolumn{1}{l}{$\omega^2_0$}
        & \multicolumn{1}{l}{$\omega^2_1$}\\
        \midrule
        0   & -1.370 & 7.638 & 0   & -1.370 & 7.638 \\
        0.3 & -1.327 & 7.531 & 0.3 & -1.317 & 7.548 \\
        \bottomrule
      \end{tabular}%
    }{%
      \caption{With \texttt{floatrow} -- Eigenvalues $\omega^2_0$ and
        $\omega^2_1$ of Eq. (26) for $r_0=1.1$ and varying, for the
        two strings configurations}%
      \label{tab:with-floatrow}%
    }
  \end{floatrow}
\end{table}

\end{document}

看起来像这样: 在此处输入图片描述

请注意,没有两个表格,这只是一个通过命令添加列间空格的表格。\cmidrule(r){1-3}\cmidrule(l){4-6}我建议您查看caption、、、、floatrow的手册,以了解宏的作用。booktabssiunitxthreeparttable

最后,以后提问时请提供代码。根据图片输入内容很麻烦。

相关内容