
내 원고에 다음 표(Excel로 작성)를 만들려고 합니다.
저는 두 개의 컨퍼런스 템플릿(IEEE 및 SPLNCS)을 사용하여 작업하고 있으므로 작업을 다음과 같이 구성합니다.
├── IEEEtran.cls
├── llncs.cls
├── mainIEEE.tex
├── mainLNCS.tex
├── Introdoction.tex
└── # ... other sections' tex
그래서 회의 형식 사이를 탐색 mainEEE.tex
하고 편집할 수 있습니다.mainLNCS.tex
그러나 이 테이블을 이 탐플레이트의 열에 맞게 정렬하는 데 어려움이 있습니다(내 문서의 다른 테이블은 잘 작동합니다).
MWE: IEEEtran.cls그리고 llncs.cls
%%% Introduction.tex
\section{Introduction}
\lipsum[1]
\begin{table}[ht]
\caption{Some results}
\label{tab:my_label}
\centering
\begin{tabularx}{\linewidth}{l|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\toprule
Mode & \multicolumn{5}{l|}{Precision} & \multicolumn{5}{l|}{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
cat &1&2&3&4&5 &1&2&3&4&5 &1&2&3&4&5\\
\bottomrule
\end{tabularx}
\end{table}
mainLNCS.tex
산출:
\documentclass[runningheads]{llncs}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{booktabs}
\usepackage{tabularx,ragged2e}
\usepackage{lipsum}
\begin{document}
\title{Manuscript Title (SPLNCS) }
\maketitle
\begin{abstract}
The abstract in 150--250 words.
\keywords{keyword1 \and keyword2}
\end{abstract}
\input{Introduction}
%\bibliographystyle{splncs04}
%\bibliography{Bib/references}
\end{document}
mainIEEE.tex
산출:
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{booktabs}
\usepackage{lipsum}
\usepackage{tabularx,ragged2e}
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\begin{document}
\title{Conference Paper Title (IEEEtran)}
\begin{abstract}
This document is a model and instructions for \LaTeX.
This and the IEEEtran.cls ...
\end{abstract}
\begin{IEEEkeywords}
keyword1, keyword2
\end{IEEEkeywords}
\input{Introduction}
\end{document}
답변1
회전된 헤더를 사용하는 방법을 보여줍니다. 기둥을 정확히 맞추려면 tabular*
과 를 사용하는 것을 참고하세요 .\extracolsep
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{table}[ht]
\caption{Some results}
\label{tab:my_label}
%\centering
\tabcolsep=0pt
\begin{tabular*}{\linewidth}{@{\extracolsep{0pt plus 1fil}}lccccccccccccccc}
\toprule
Mode & \multicolumn{5}{l}{Precision} & \multicolumn{5}{l}{Recall} & \multicolumn{5}{l}{F1\-score} \\
\midrule
& \rotatebox{90}{RF} & \rotatebox{90}{RF-SMOTEd} & \rotatebox{90}{AdaBoost} &
\rotatebox{90}{SMOTEBoost} & \rotatebox{90}{DECOC} & \rotatebox{90}{RF} &
\rotatebox{90}{RF-SMOTEd} & \rotatebox{90}{AdaBoost} & \rotatebox{90}{SMOTEBoost} &
\rotatebox{90}{DECOC} & \rotatebox{90}{RF} & \rotatebox{90}{RF-SMOTEd} &
\rotatebox{90}{AdaBoost} & \rotatebox{90}{SMOTEBoost} & \rotatebox{90}{DECOC} \\
\midrule
cat &1&2&3&4&5 &1&2&3&4&5 &1&2&3&4&5\\
\bottomrule
\end{tabular*}
\end{table}
\lipsum[2-6]
\end{document}
답변2
테이블의 내용이 무엇인지 완전히 명확하지 않습니다. 한 자리 숫자= 아니면 한 글자 기호인가요?
위와 같은 경우 @John Kormylo 답변에 표시된 대로 열 머리글을 회전할 수 있습니다.
tabularray
그의 답변에 대한 보충으로 지원되는 패키지rotating
와 패키지를 사용하는 제안이 있습니다makecell
.- With
ieetran` 문서 클래스 사용 :
\documentclass[runningheads]{llncs}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{rotating}
\usepackage{makecell}
\usepackage{ragged2e}
\usepackage{tabularray}
\begin{document}
\title{Manuscript Title (SPLNCS) }
\maketitle
\begin{abstract}
The abstract in 150--250 words.
%\keywords{keyword1 \and keyword2}
\end{abstract}
\section{Introduction}
\lipsum[11]
\begin{table}[ht]
\caption{Some results}
\label{tab:my_label}
\centering
\settowidth\rotheadsize{SMOTEBoost}
\renewcommand\theadfont{}
\begin{tblr}{hlines, vlines,
colspec = { l *{15}{X[c]} },
cell{2}{2-Z} = {cmd=\rothead}
}
\SetCell[r=2]{c} Mode
& \SetCell[c=5]{c} Precision
& & & & & \SetCell[c=5]{c} Recall
& & & & & \SetCell[c=5]{c} F1\-score
& & & & \\
& RF
& RF-SMOTEd
& AdaBoost
& SMOTEBoost
& DECOC
& RF
& RF-SMOTEd
& AdaBoost
& SMOTEBoost
& DECOC
& RF
& RF-SMOTEd
& AdaBoost
& SMOTEBoost
& DECOC \\
cat & 1 & 2 & 3 & 4 & 5
& 1 & 2 & 3 & 4 & 5
& 1 & 2 & 3 & 4 & 5 \\
\end{tblr}
\end{table}
\end{document}
- 문서 클래스 사용
ieeetran
:
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
%\usepackage[T1]{fontenc}
% ...
\begin{tblr}{hlines, vlines,
colspec = { l *{15}{X[c]} },
colsep=3pt, % <---
cell{2}{2-Z} = {cmd=\rothead}
}
% rest is the same as before