단 하나의 행으로 이 테이블을 개선하는 방법은 무엇입니까?

단 하나의 행으로 이 테이블을 개선하는 방법은 무엇입니까?
\documentclass{memoir}

\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}

\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{amsmath}

\begin{document}
\begin{table*}[h!]
    \centerfloat
    \ra{1.3}
    \scalebox{0.7}{
    \begin{tabular}{@{}ccccccccccccccccccc@{}}\toprule
    \multicolumn{3}{c}{$w = 8$} & \phantom{abc}& \multicolumn{3}{c}{$w = 16$} &
    \phantom{abc} & \multicolumn{3}{c}{$w = 32$}&
    \phantom{abc} & \multicolumn{3}{c}{$w = 32$}&
    \phantom{abc} & \multicolumn{3}{c}{$w = 32$}\\
    \cmidrule{1-3} \cmidrule{5-7} \cmidrule{9-11} \cmidrule{13-15}\cmidrule{17-19}
    \text{$\mathrm{ABCD}^\dag$} & \text{$X^2 \ (\%)$} & FGH && \text{$\mathrm{ABCD}^\dag$} & \text{$X^2 \ (\%)$} & FGH && \text{$\mathrm{ABCD}^\dag$} & \text{$X^2 \ (\%)$} & FGH && \text{$\mathrm{ABCD}^\dag$} & \text{$X^2 \ (\%)$} & FGH && \text{$\mathrm{ABCD}^\dag$} & \text{$X^2 \ (\%)$} & FGH\\ \midrule
     0 & 0 & 0 && 0 & 0 & 0 && 0 & 0 & 0 && 0 & 0 & 0 && 0 & 0 & 0\\
    \bottomrule
    \end{tabular}}
    \caption{Caption}
\end{table*}
\end{document}

매우 넓고 행이 하나만 있는 테이블이 있습니다. 개인적으로 테이블은 이렇게 매우 '얇아'(수직 공간을 차지하는 측면에서) 보이고, 또한 너무 넓다고 생각합니다. 누구든지 이것을 개선할 수 있는 팁이 있습니까? 테이블을 개선할 수 있는 일반적인 개선에 대한 다른 제안도 높이 평가됩니다!

답변1

몇 가지 가능성:

여기에 이미지 설명을 입력하세요

\documentclass{memoir}

\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}

\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{amsmath}

\begin{document}

\begin{table*}[htp]% never this: [h!]
    \centerfloat
    \ra{1.3}
% avoid scaling tables and if you do 
% you need a % after the {
%     \scalebox{0.7}{
\tiny
\setlength\tabcolsep{1pt}
    \begin{tabular}{@{}ccccccccccccccccccc@{}}\toprule
    \multicolumn{3}{c}{$w = 8$} & \phantom{abc}& \multicolumn{3}{c}{$w = 16$} &
    \phantom{abc} & \multicolumn{3}{c}{$w = 32$}&
    \phantom{abc} & \multicolumn{3}{c}{$w = 32$}&
    \phantom{abc} & \multicolumn{3}{c}{$w = 32$}\\
    \cmidrule{1-3} \cmidrule{5-7} \cmidrule{9-11} \cmidrule{13-15}\cmidrule{17-19}
% \text doing nothing
    $\mathrm{ABCD}^\dag$&
$X^2 \ (\%)$ & FGH &&
$\mathrm{ABCD}^\dag$ &
$X^2 \ (\%)$ & FGH &&
$\mathrm{ABCD}^\dag$ &
$X^2 \ (\%)$ & FGH &&
$\mathrm{ABCD}^\dag$ &
$X^2 \ (\%)$ & FGH &&
$\mathrm{ABCD}^\dag$ &
$X^2 \ (\%)$ & FGH\\ \midrule
     0 & 0 & 0 && 0 & 0 & 0 && 0 & 0 & 0 && 0 & 0 & 0 && 0 & 0 & 0\\
    \bottomrule
    \end{tabular}
    \caption{Caption}
\end{table*}


\begin{table*}[htp]% never this: [h!]
    \centerfloat
    \ra{1.3}
    \begin{tabular}{@{}cccc@{}}\toprule
&$\mathrm{ABCD}^\dag$ &
$X^2 \ (\%)$ & FGH \\
\midrule
$w=8$&0&0&0\\
$w=16$&0&0&0\\
$w=32$&0&0&0\\
$w=64$&0&0&0\\
$w=128$&0&0&0\\
    \bottomrule
\end{tabular}


    \caption{Caption}
\end{table*}

\end{document}

답변2

대안으로 다음과 같이 각 부분을 자체 테이블로 만들 수 있습니다.

\documentclass{memoir}

\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}

\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{amsmath}
\usepackage[margin=1in]{geometry}

\usepackage{pgfkeys}

\makeatletter

\def\ae@small@table@w{}
\def\ae@small@table@abcd{0}
\def\ae@small@table@xx{0}
\def\ae@small@table@fgh{0}

\pgfkeys{/ae/small/table/.cd,
  w/.store in=\ae@small@table@w,
  abcd/.store in=\ae@small@table@abcd,
  xx/.store in=\ae@small@table@xx,
  fgh/.store in=\ae@small@table@fgh,
}

\newcommand\mysmalltable[1][]{%%
  \bgroup
    \pgfkeys{/ae/small/table/.cd,#1}%%
    \begin{tabular}{ccc}\toprule
    \multicolumn{3}{c}{$w=\ae@small@table@w$} \\\midrule
    $\mathrm{ABCD}^\dag$ & $X^{2}\ (\%)$
                         & FGH \\\midrule
    $\ae@small@table@abcd$ & $\ae@small@table@xx$ 
                           & $\ae@small@table@fgh$ \\\bottomrule
    \end{tabular}%%
  \egroup}
\makeatother

\begin{document}

\begin{table*}[h!]
\begin{minipage}[t]{\columnwidth}
                             \hspace*{\fill}%%
\mysmalltable[w=8,abcd=0.945]\hspace*{\fill}%%
\mysmalltable[w=16,]\hspace*{\fill}%%
\mysmalltable[w=32,xx=0.004]\par\vspace{0.5cm}%%
                    \hspace*{\fill}%%
\mysmalltable[w=32,]\hspace*{\fill}%%
\mysmalltable[w=32,]\hspace*{\fill}%%
\end{minipage}
    \caption{Caption}
\end{table*}

\end{document}

여기에 이미지 설명을 입력하세요

키를 추가하면 값을 입력하기가 좀 더 쉬워지고 값이 올바르게 배치되는지 알 수 있습니다.

관련 정보