
llncs 문서 클래스로 작업하면서 큰 테이블을 옆으로 배치하고 싶었습니다.
암호:
\documentclass[runningheads]{llncs}
\usepackage{graphicx} % Required for inserting images
\usepackage{tabularx}
\usepackage{rotating}
\usepackage{booktabs}
\begin{document}
\title{Paper Title Here ... }
\begin{sidewaystable}
\caption{Classification results of imbalance techniques}
\centering
\begin{tabularx}{\linewidth}{lccccccccccccccc}%
\toprule
Transportation Mode & \multicolumn{5}{c}{Precision} & \multicolumn{5}{c}{Recall} & \multicolumn{5}{l}{F1\-Score} \\
\cline{2-15}
& RF & RF-SMOTEd & AdaBoost & SMOTEBoost & DECOC & RF & RF-SMOTEd & AdaBoost & SMOTEBoost & DECOC & RF & RF-SMOTEd & AdaBoost & SMOTEBoost & DECOC \\
\midrule
Walk & 0.88 & 0.78 & 0.65 & 0.59 & 0.45 & 0.38 & 0.73 & 0.95 & 0.83 & 0.57 & 0.52 & 0.07 & 0.22 & 0.66 & 0.88 \\
Bike & 0.88 & 0.78 & 0.65 & 0.59 & 0.45 & 0.38 & 0.73 & 0.95 & 0.83 & 0.57 & 0.52 & 0.07 & 0.22 & 0.66 & 0.88 \\
\bottomrule
\end{tabularx}
\end{sidewaystable}
\end{document}
산출:
이 테이블은 추가 후에도 맞지 않습니다 \tabcolsep=0pt
.
편집하다
어떻게 될지 궁금하네요이 종이동일한 문서 클래스를 사용함에도 불구하고 다음과 같은 큰 테이블을 추가했습니다.
답변1
나는 나 자신을 도울 수 없었다: 이것은 단지 스핀 온이다에그레그의 답변약간의 미세 조정이 필요하지만 심오한 내용은 변경되지 않습니다.
- 간소화된 범례(
R: RF
대신(1) RF
) - 그에 따라 단축된 중간 규칙이 있는 그룹화된 열
\documentclass[runningheads]{llncs}
\usepackage{booktabs,siunitx}
\begin{document}
\title{Paper Title}
\begin{table}[htp]
\caption{Classification results of imbalance techniques}
\setlength{\tabcolsep}{0pt}
\begin{tabular*}{\textwidth}{
@{\extracolsep{\fill}}
l
@{\hskip 1ex}
*{5}{S[table-format=1.2]}
@{\hskip 1ex}
*{5}{S[table-format=1.2]}
@{\hskip 1ex}
*{5}{S[table-format=1.2]}
@{}
}
\toprule
TM &
\multicolumn{5}{c}{Precision} &
\multicolumn{5}{c}{Recall} &
\multicolumn{5}{c}{F1-Score} \\
\cmidrule(r{1ex}){2-6} \cmidrule(r{1ex}){7-11} \cmidrule{12-16}
& {R} & {S} & {A} & {B} & {D} & {R} & {S} & {A} & {B} & {D} & {R} & {S} & {A} & {B} & {D}\\
\midrule
Walk & 0.88 & 0.78 & 0.65 & 0.59 & 0.45 & 0.38 & 0.73 & 0.95 & 0.83 & 0.57 & 0.52 & 0.07 & 0.22 & 0.66 & 0.88 \\
Bike & 0.88 & 0.78 & 0.65 & 0.59 & 0.45 & 0.38 & 0.73 & 0.95 & 0.83 & 0.57 & 0.52 & 0.07 & 0.22 & 0.66 & 0.88 \\
\bottomrule
\end{tabular*}
\medskip
TM: Transportation mode
R: RF; S: RF-SMOTEd; A: AdaBoost; B: SMOTEBoost; D: DECOC
\end{table}
\end{document}
그리고 여기에 내 마지막 테이크가 있습니다. 비좁은 표정으로 인해 쉴 수 없었습니다.
%
단위로 전환되어 모두 삭제됨0.
- 축이 바뀌었습니다. 운송 모드와 방법이 바뀌었습니다.
- 왼쪽 상단 모서리 라벨이 '모드'에서 '방법'으로 전환되었습니다. 문맥상 명확하지 않더라도 "걷기"와 "자전거"의 의미가 캡션에서 명확해질 수 있습니다.
\documentclass[runningheads]{llncs}
\usepackage{booktabs,siunitx}
\begin{document}
\title{Paper Title}
\begin{table}[htp]
\centering
\caption{Classification results of imbalance techniques (\%)}
\begin{tabular}{
@{\extracolsep{\fill}}
l
*{2}{S[table-format=2]}
*{2}{S[table-format=2]}
*{2}{S[table-format=2]}
@{}
}
\toprule
&
\multicolumn{2}{c}{Precision} &
\multicolumn{2}{c}{Recall} &
\multicolumn{2}{c}{F1-Score} \\
\cmidrule(r{1ex}){2-3} \cmidrule(r{1ex}){4-5} \cmidrule{6-7}
Method & {Walk} & {Bike} & {Walk} & {Bike} & {Walk} & {Bike} \\
\midrule
RF & 88 & 88 & 38 & 88 & 52 & 88 \\
RF-SMOTEd & 78 & 78 & 73 & 78 & 07 & 78 \\
AdaBoost & 65 & 65 & 95 & 65 & 22 & 65 \\
SMOTEBoost & 59 & 59 & 83 & 59 & 66 & 59 \\
DECOC & 45 & 45 & 57 & 45 & 88 & 45 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
답변2
거의 모든 헤더 셀에 줄바꿈을 삽입해야 합니다. 대부분의 헤더는 두문자어로 나타나므로 강제로 줄 바꿈을 직접 수행하는 것이 가장 좋습니다. 이 작업을 수행하는 방법은 아래 코드를 참조하세요. 그러나 수동으로 줄 바꿈을 모두 만든 후에는 환경이 더 이상 필요하지 않습니다 tabularx
. 대신 tabular*
환경을 사용하고 너비를 로 설정하세요 \linewidth
. 마지막으로, 이 \centering
명령은 유용한 작업을 수행하지 않으므로 생략할 수 있습니다(반드시!).
\documentclass[runningheads]{llncs}
\usepackage{graphicx}
%\usepackage{tabularx} % no longer needed
\usepackage{rotating}
\usepackage{booktabs}
% new code:
\usepackage{amsmath} % for \smash[b] macro
% handy shortcut macros for line breaks in cells
\newcommand{\mytabL}[1]{\smash[b]{%
\begin{tabular}[t]{l} #1 \end{tabular}}}
\newcommand{\mytabC}[1]{%
\begin{tabular}[t]{c} #1 \end{tabular}}
\begin{document}
\begin{sidewaystable}
\setlength\tabcolsep{0pt} % let LaTeX figure out intercol. whitespace
\caption{Classification results of imbalance techniques\strut}
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} l *{15}{c} }
\toprule
\mytabL{Transpor-\\tation\\Mode}
& \multicolumn{5}{c}{Precision}
& \multicolumn{5}{c}{Recall}
& \multicolumn{5}{c}{F1-Score} \\
\cmidrule{2-6} \cmidrule{7-11} \cmidrule{12-16}
& RF & \mytabC{RF-\\SMOTEd} & \mytabC{Ada\\Boost} & \mytabC{SMOTE\\Boost} & \mytabC{DE\\COC}
& RF & \mytabC{RF-\\SMOTEd} & \mytabC{Ada\\Boost} & \mytabC{SMOTE\\Boost} & \mytabC{DE\\COC}
& RF & \mytabC{RF-\\SMOTEd} & \mytabC{Ada\\Boost} & \mytabC{SMOTE\\Boost} & \mytabC{DE\\COC} \\
\midrule
Walk
& 0.88 & 0.78 & 0.65 & 0.59 & 0.45 & 0.38 & 0.73 & 0.95 & 0.83 & 0.57 & 0.52 & 0.07 & 0.22 & 0.66 & 0.88 \\
Bike
& 0.88 & 0.78 & 0.65 & 0.59 & 0.45 & 0.38 & 0.73 & 0.95 & 0.83 & 0.57 & 0.52 & 0.07 & 0.22 & 0.66 & 0.88 \\
\bottomrule
\end{tabular*}
\end{sidewaystable}
\end{document}
답변3
sidewaystable
긴 반복을 피한다면 아니요 .
\documentclass[runningheads]{llncs}
\usepackage{booktabs,siunitx}
\begin{document}
\title{Paper Title Here ... }
\begin{table}[htp]
\caption{Classification results of imbalance techniques}
\setlength{\tabcolsep}{0pt}
\begin{tabular*}{\textwidth}{
@{\extracolsep{\fill}}
l
*{15}{S[table-format=1.2]}
@{}
}
\toprule
TM &
\multicolumn{5}{c}{Precision} &
\multicolumn{5}{c}{Recall} &
\multicolumn{5}{c}{F1-Score} \\
\cmidrule{2-6} \cmidrule{7-11} \cmidrule{12-16}
& {(1)} & {(2)} & {(3)} & {(4)} & {(5)}
& {(1)} & {(2)} & {(3)} & {(4)} & {(5)}
& {(1)} & {(2)} & {(3)} & {(4)} & {(5)} \\
\midrule
Walk & 0.88 & 0.78 & 0.65 & 0.59 & 0.45 & 0.38 & 0.73 & 0.95 & 0.83 & 0.57 & 0.52 & 0.07 & 0.22 & 0.66 & 0.88 \\
Bike & 0.88 & 0.78 & 0.65 & 0.59 & 0.45 & 0.38 & 0.73 & 0.95 & 0.83 & 0.57 & 0.52 & 0.07 & 0.22 & 0.66 & 0.88 \\
\bottomrule
\end{tabular*}
\medskip
TM: Transportation mode
(1) RF; (2) RF-SMOTEd; (3) AdaBoost; (4) SMOTEBoost; (5) DECOC
\end{table}
\end{document}
다른 가능성:
\documentclass[runningheads]{llncs}
\usepackage{booktabs,siunitx}
\begin{document}
\title{Paper Title Here ... }
\begin{table}[htp]
\caption{Classification results of imbalance techniques}
\begin{tabular}{
@{\quad}
l
*{5}{S[table-format=1.2]}
@{}
}
\toprule
Mode &
\multicolumn{1}{wc{6em}}{RF} &
\multicolumn{1}{wc{6em}}{RF-SMOTEd} &
\multicolumn{1}{wc{6em}}{AdaBoost} &
\multicolumn{1}{wc{6em}}{SMOTEBoost} &
\multicolumn{1}{wc{6em}}{DECOC} \\
\midrule
& \multicolumn{5}{c@{}}{Precision} \\
\cmidrule(l{2em}r{2em}){2-6}
Walk & 0.88 & 0.78 & 0.65 & 0.59 & 0.45 \\
Bike & 0.88 & 0.78 & 0.65 & 0.59 & 0.45 \\
\midrule
& \multicolumn{5}{c@{}}{Recall} \\
\cmidrule(l{2em}r{2em}){2-6}
Walk & 0.38 & 0.73 & 0.95 & 0.83 & 0.57 \\
Bike & 0.38 & 0.73 & 0.95 & 0.83 & 0.57 \\
\midrule
& \multicolumn{5}{c@{}}{F1-Score} \\
\cmidrule(l{2em}r{2em}){2-6}
Walk & 0.52 & 0.07 & 0.22 & 0.66 & 0.88 \\
Bike & 0.52 & 0.07 & 0.22 & 0.66 & 0.88 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}