使用 ctable 实现表格宽度

使用 ctable 实现表格宽度

我的论文中表格的宽度有问题。这是我用 Latex 写的第一篇文档。

我有两张桌子。第一张桌子:

\ctable[
caption = {Comparison between $K_D$ values in \citet{SPM_1977} and \citet{SPM_1984} for structure trunk },
label = {tab:KD_SPM_trunk},
mincapwidth = \textwidth,
width = \textwidth,
]{Xcccccc}{
  \tnote[a]{Applicable to slopes ranging from 1:1.5 to 1:5;}
  \tnote[b]{These $K_D$ values are unsupported by test results and are only provided for preliminary design purposes;}
  \tnote[c]{Refers to no-damage criteria (<5\% displacement, rocking, etc.); if no rocking (<2\%) is desired, reduce KD by 50 percent \citep{Zwamborn_1982};}
  \tnote[d]{The use of a single layer of quarrystone armor units is not recommended for structures subject to breaking waves and only under special conditions for structures subject to nonbreaking waves. When used, the stone should be carefully placed;}
  \tnote[e]{Special placement with long axis of stone placed perpendicular to structure face;}
  \tnote[f]{Parallelepiped-shaped stone: long slab-like stone with the long dimension about 3 times the shortest dimension \citep{Markle_1979}.}
}{ \\
    \toprule
    \multirow{3}[6]{*}{Armor Units} & \multirow{3}[6]{*}{n} & \multirow{3}[6]{*}{Placement} & \multicolumn{4}{c}{Structure Trunk\tmark[a]} \\
          &       &       & \multicolumn{2}{c}{SPM 1977} & \multicolumn{2}{c}{SPM 1984} \\
          &       &       & Breaking & Nonbreaking & Breaking & Nonbreaking \\
              \midrule
    \multicolumn{3}{c}{\textbf{Quarrystone}} &       &       &       &  \\
    Smooth Rounded & 2     & Random & 2.1   & 2.4   & 1.2\tmark[b]  & 2.4 \\
    Smooth Rounded & >3    & Random & 2.8   & 3.2   & 1.6\tmark[b]  & 3.2\tmark[b] \\
    Rough Angular & 1\tmark[d]    & Random & -     & 2.9   & -     & 2.9\tmark[b] \\
    \multirow{3}[2]{*}{Rough Angular} & \multirow{3}[2]{*}{2} & \multirow{3}[2]{*}{Random} & \multirow{3}[2]{*}{3.5} & \multirow{3}[2]{*}{4.0} & \multirow{3}[2]{*}{2.0} & \multirow{3}[2]{*}{4.0} \\
          &       &       &       &       &       &  \\
          &       &       &       &       &       &  \\
    Rough Angular & >3    & Random & 3.9   & 4.5   & 2.2\tmark[b]  & 4.5\tmark[b] \\
    Rough Angular & 2     & Speciale & 4.8   & 5.5   & 5.8   & 7.0 \\
    Parallelepiped\tmark[f] & 2     & Special & -     & -     & 7.0 - 20.0 & 8.5 - 24.0\tmark[b] \\
    \multicolumn{3}{c}{\textbf{Concrete armor units}} &       &       &       &  \\
    Tetrapod and Quadripod & 2     & Random & 7.2   & 8.3   & 7.0   & 8.0 \\
    Tribar & 2     & Random & 9.0   & 10.4  & 9.0\tmark[b]  & 10.0 \\
    Dolos & 2     & Random & 22.0\tmark[c] & 25.0\tmark[c] & 15.8\tmark[c] & 31.8\tmark[c] \\
    Modified Cube & 2     & Random & 6.8   & 7.8   & 6.5\tmark[b]  & 7.5 \\
    Hexapod & 2     & Random & 8.2   & 9.5   & 8.0\tmark[b]  & 9.5 \\
    Toskane & 2     & Random & -     & -     & 11.0\tmark[b] & 22.0 \\
    Tribar & 1     & Uniform & 12.0  & 15.0  & 12.0\tmark[b] & 15.0 \\
    \bottomrule
}

在此处输入图片描述

第二张表:

\ctable[
caption = {Comparison between $K_D$ values in \citet{SPM_1977} and \citet{SPM_1984} for structure head },
label = {tab:KD_SPM_head},
mincapwidth = \textwidth,
width = \textwidth,
]{Xccccccc}{
  \tnote[a]{These $K_D$ values are unsupported by test results and are only provided for preliminary design purposes;}
  \tnote[b]{Stability of dolosse on slopes steeper than 1:2 should be substantiated by site-specific model test;}
  \tnote[c]{Until more information is available on the variation of $K_D$ value with slope, the use of $K_D$ should be limited to slopes raging from 1:1.5 to 1:3. Some armor units tested on a structure head indicate a $K_D$-slope dependence;}
  \tnote[d]{The use of a single layer of quarrystone armor units is not recommended for structures subject to breaking waves and only under special conditions for structures subject to nonbreaking waves. When used, the stone should be carefully placed;}
  \tnote[e]{Special placement with long axis of stone placed perpendicular to structure face;}
  \tnote[f]{Cotagent of the slope angle that the structure wall makes with the horizontal.}
}{ \\
    \toprule
     \multirow{3}[6]{*}{Armor Units} & \multirow{3}[6]{*}{n} & \multirow{3}[6]{*}{Placement} & \multicolumn{5}{c}{Structure Head} \\
          &       &       & \multicolumn{2}{c}{SPM 1977} & \multicolumn{2}{c}{SPM 1984} & Slope \\
          &       &       & Breaking & Nonbreaking & Breaking & Nonbreaking & cot  \\
                  \midrule
    \multicolumn{3}{c}{\textbf{Quarrystone}} &       &       &       &       &  \\
    Smooth Rounded & 2     & Random & 1.7   & 1.9   & 1.1\tmark[a]  & 1.9   & 1.5 to 3.0 \\
    Smooth Rounded & >3    & Random & 2.1   & 2.3   & 1.4\tmark[a]  & 2.3\tmark[a]  & c \\
    Rough Angular & 1\tmark[d]    & Random & -     & 2.3   & -     & 2.3\tmark[a]  & \tmark[c] \\
    \cmidrule(rl){4-8}
    \multirow{3}[6]{*}{Rough Angular} & \multirow{3}[6]{*}{2} & \multirow{3}[6]{*}{Random} & 2.9   & 3.2   & 1.9\tmark[a]  & 3.2   & 1.5 \\
          &       &       & 2.5   & 2.8   & 1.6\tmark[a]  & 2.8   & 2.0 \\
          &       &       & 2.0   & 2.3   & 1.3   & 2.3   & 3.0 \\
          \cmidrule(rl){4-8}
    Rough Angular & >3    & Random & 3.7   & 4.2   & 2.1\tmark[a]  & 4.2\tmark[a]  & c\tmark[c] \\
    Rough Angular & 2     & Special\tmark[e] & 3.5   & 4.5   & 5.3\tmark[a]  & 6.4\tmark[a]  & \tmark[c] \\
    \multicolumn{3}{c}{\textbf{Concrete armor units}} &       &       &       &       &  \\
    \cmidrule(rl){4-8}
    \multirow{3}[6]{*}{Tetrapod and Quadripod} & \multirow{3}[6]{*}{2} & \multirow{3}[6]{*}{Random} & 5.9   & 6.6   & 5.0\tmark[a]  & 6.0   & 1.5 \\
          &       &       & 5.5   & 6.1   & 4.5\tmark[a]  & 5.5   & 2.0 \\
          &       &       & 3.7   & 4.1   & 3.5\tmark[a]  & 4.0   & 3.0 \\
          \cmidrule(rl){4-8}
    \multirow{3}[6]{*}{Tribar} & \multirow{3}[6]{*}{2} & \multirow{3}[6]{*}{Random} & 8.3   & 9.0   & 8.3\tmark[a]  & 9.0   & 1.5 \\
          &       &       & 7.8   & 8.5   & 7.8\tmark[a]  & 8.5   & 2.0 \\
          &       &       & 7.0   & 7.7   & 6.0\tmark[a]  & 6.5   & 3.0 \\
          \cmidrule(rl){4-8}
    \multirow{2}[4]{*}{Dolos} & \multirow{2}[4]{*}{2} & \multirow{2}[4]{*}{Random} & 15.0  & 16.5  & 8.0\tmark[a]  & 16.0\tmark[a] & 2.0\tmark[b] \\
          &       &       & 13.5  & 15.0  & 7.0\tmark[a]  & 14.0\tmark[a] & 3.0 \\
    Modified Cube & 2     & Random & -     & 5.0   & -     & 5.0   & \tmark[c] \\
    Hexapod & 2     & Random & 5.0   & 7.0   & 5.0   & 7.0   & \tmark[c] \\
    Tribar & 1     & Uniform & 7.5   & 9.5   & 7.5   & 9.5   & \tmark[c] \\
    \bottomrule
}

在此处输入图片描述

如图 2 所示,由于我在定义中使用了 {ccccccc} 而不是 {Xcccccc},因此表格太宽。如果我在第二个表格的定义中使用 {Xcccccc},则会发生以下情况: 在此处输入图片描述

有人能帮我格式化这个表格吗?

谨致问候, Diogo Silva

答案1

问题是您的表格太宽,无法在页面上显示,因此ctable需要将列挤压在一起,以使表格达到所需的宽度。如果您将表格的宽度更改为,150mm那么第一列和第二列将不再重叠。

在此处输入图片描述

也许更好的选择是尝试缩短或缩写一些列标题。一个明显的标题是Nonbreaking

在此处输入图片描述

我并不是说这Non是一个好的缩写,Nonbreaking而是表明这是解决问题的一种方法 - 并且我认为对此进行一些变化将是最好的解决方案。

这是使用以下表格破解方法完成的。请注意,我还将您的裸露 > 符号更改为$>$,并将您的\multirow's 从第一列中删除,因为它们会阻止X列说明符工作。这可能仍然不是您想要的,但希望这是朝着正确方向迈出的一步。

\documentclass{article}

\usepackage{ctable,multirow}
\usepackage[sort&compress,square,comma,authoryear]{natbib}
\begin{document}

\ctable[
caption = {Comparison between $K_D$ values in \citet{SPM_1977} and \citet{SPM_1984} for structure head\hss },
label = {tab:KD_SPM_head},
mincapwidth = \textwidth,
width = \textwidth,
]{@{}Xccccccc}{
  \tnote[a]{These $K_D$ values are unsupported by test results and are only provided for preliminary design purposes;}
  \tnote[b]{Stability of dolosse on slopes steeper than 1:2 should be substantiated by site-specific model test;}
  \tnote[c]{Until more information is available on the variation of $K_D$ value with slope, the use of $K_D$ should be limited to slopes raging from 1:1.5 to 1:3. Some armor units tested on a structure head indicate a $K_D$-slope dependence;}
  \tnote[d]{The use of a single layer of quarrystone armor units is not recommended for structures subject to breaking waves and only under special conditions for structures subject to nonbreaking waves. When used, the stone should be carefully placed;}
  \tnote[e]{Special placement with long axis of stone placed perpendicular to structure face;}
  \tnote[f]{Cotagent of the slope angle that the structure wall makes with the horizontal.}
}{ \\
    \toprule
     \multirow{3}[6]{*}{Armor Units} & \multirow{3}[6]{*}{n} & \multirow{3}[6]{*}{Placement} & \multicolumn{5}{c}{Structure Head} \\
          &       &       & \multicolumn{2}{c}{SPM 1977} & \multicolumn{2}{c}{SPM 1984} & Slope \\
          &       &       & Breaking & Non& Breaking & Non& cot  \\
                  \midrule
    \multicolumn{3}{c}{\textbf{Quarrystone}} &       &       &       &       &  \\
    Smooth Rounded & 2     & Random & 1.7   & 1.9   & 1.1\tmark[a]  & 1.9   & 1.5 -- 3.0 \\
    Smooth Rounded & ${>}3$    & Random & 2.1   & 2.3   & 1.4\tmark[a]  & 2.3\tmark[a]  & c \\
    Rough Angular & 1\tmark[d]    & Random & -     & 2.3   & -     & 2.3\tmark[a]  & \tmark[c] \\
    \cmidrule(rl){4-8}
    Rough Angular & \multirow{3}[6]{*}{2} & \multirow{3}[6]{*}{Random} & 2.9   & 3.2   & 1.9\tmark[a]  & 3.2   & 1.5 \\
          &       &       & 2.5   & 2.8   & 1.6\tmark[a]  & 2.8   & 2.0 \\
          &       &       & 2.0   & 2.3   & 1.3   & 2.3   & 3.0 \\
          \cmidrule(rl){4-8}
          Rough Angular &${>}3$   & Random & 3.7   & 4.2   & 2.1\tmark[a]  & 4.2\tmark[a]  & c\tmark[c] \\
    Rough Angular & 2     & Special\tmark[e] & 3.5   & 4.5   & 5.3\tmark[a]  & 6.4\tmark[a]  & \tmark[c] \\
    \multicolumn{3}{c}{\textbf{Concrete armor units}} &       &       &       &       &  \\
    \cmidrule(rl){4-8}
    Tetrapod& \multirow{3}[6]{*}{2} & \multirow{3}[6]{*}{Random} & 5.9   & 6.6   & 5.0\tmark[a]  & 6.0   & 1.5 \\
    and   &       &       & 5.5   & 6.1   & 4.5\tmark[a]  & 5.5   & 2.0 \\
   Quradripod&       &       & 3.7   & 4.1   & 3.5\tmark[a]  & 4.0   & 3.0 \\
          \cmidrule(rl){4-8}
    \multirow{3}[6]{*}{Tribar} & \multirow{3}[6]{*}{2} & \multirow{3}[6]{*}{Random} & 8.3   & 9.0   & 8.3\tmark[a]  & 9.0   & 1.5 \\
          &       &       & 7.8   & 8.5   & 7.8\tmark[a]  & 8.5   & 2.0 \\
          &       &       & 7.0   & 7.7   & 6.0\tmark[a]  & 6.5   & 3.0 \\
          \cmidrule(rl){4-8}
    \multirow{2}[4]{*}{Dolos} & \multirow{2}[4]{*}{2} & \multirow{2}[4]{*}{Random} & 15.0  & 16.5  & 8.0\tmark[a]  & 16.0\tmark[a] & 2.0\tmark[b] \\
          &       &       & 13.5  & 15.0  & 7.0\tmark[a]  & 14.0\tmark[a] & 3.0 \\
    Modified Cube & 2     & Random & -     & 5.0   & -     & 5.0   & \tmark[c] \\
    Hexapod & 2     & Random & 5.0   & 7.0   & 5.0   & 7.0   & \tmark[c] \\
    Tribar & 1     & Uniform & 7.5   & 9.5   & 7.5   & 9.5   & \tmark[c] \\
    \bottomrule
}

\end{document}

相关内容