我longtable
需要扩展到 3 页。我查看了许多过去的答案,longtable
但尝试过但没有成功。我需要在这里发帖征求建议。以下是我现有的 Latex 代码:
\begin{table*}[!htbp]
\centering
\tiny
\renewcommand{\arraystretch}{1.3}
\caption{State-of-the-art based on the taxonomy.}
%\label{table}
\begin{tabular}{l|p{7.5cm}|p{1.5cm}|p{2.5cm}|p{1.5cm}}
%\hline
Item& Sota & DummyA & DummyB & DummyC\\
\hline
\hline
A & ASota & AA & AB&AC\\
\hline
B & BSota& BA & BB & BC\\
\hline
C & CSota& CA& CB &CC\\
\hline
D & DSota& DA& DB &DC \\
\hline
E & ESota& EA& EB &EC \\
\hline
F & FSota& FA& FB &FC \\
\hline
G & GSota& GA& GB &GC \\
\hline
H & HSota& HA& HB &HC \\
\hline
I & ISota& IA& IB &IC \\
\hline
J & JSota& JA& JB &JC \\
\hline
K & KSota& KA& KB &KC \\
\hline
L & LSota& LA& LB &LC \\
\hline
M & MSota& MA& MB &MC \\
\hline
\end{tabular}
\end{table*}
提前致谢。
答案1
table
从一tabular
对环境转换为一个(单一)环境时,请务必通过、、和指令longtable
定义表的页眉和页脚。\endfirsthead
\endhead
\endfoot
\endlastfoot
如果您需要更改字体大小longtable
(例如,更改为\tiny
),请将整个longtable
环境包含在一对\begingroup
and\endgroup
语句中。这将保持本地的范围\tiny
。
\documentclass{article}
\usepackage[letterpaper,margin=1in]{geometry} % set page parameters suitably
\usepackage{longtable,array}
\usepackage{caption}
\begin{document}
\begingroup
%\tiny %% is this really necessary?
%\renewcommand{\arraystretch}{1.3}
\setlength\extrarowheight{3pt}
\captionsetup{font=normalsize,skip=0.333\baselineskip}
\begin{longtable}{@{}l|p{7.5cm}|p{1.5cm}|p{2.5cm}|p{1.5cm}@{}}
%% headers and footers
\caption{State-of-the-art based on the taxonomy.}
\label{table}\\
Item & Sota & DummyA & DummyB & DummyC \\
\hline \hline
\endfirsthead
\multicolumn{5}{@{}l}{\em Table \ref{table}, continued}\\[1ex]
Item& Sota & DummyA & DummyB & DummyC\\
\hline\hline
\endhead
\multicolumn{5}{r@{}}{\em (Continued on following page)}\\
\endfoot
\hline
\endlastfoot
%% body of longtable env.
A & ASota& AA& AB &AC \\
\hline
B & BSota& BA& BB &BC \\
\hline
C & CSota& CA& CB &CC \\
\hline
D & DSota& DA& DB &DC \\
\hline
E & ESota& EA& EB &EC \\
\hline
F & FSota& FA& FB &FC \\
\hline
G & GSota& GA& GB &GC \\
\hline
H & HSota& HA& HB &HC \\
\hline
I & ISota& IA& IB &IC \\
\hline
J & JSota& JA& JB &JC \\
\hline
K & KSota& KA& KB &KC \\
\hline
L & LSota& LA& LB &LC \\
\hline
M & MSota& MA& MB &MC \\
\hline
A & ASota& AA& AB &AC \\
\hline
B & BSota& BA& BB &BC \\
\hline
C & CSota& CA& CB &CC \\
\hline
D & DSota& DA& DB &DC \\
\hline
E & ESota& EA& EB &EC \\
\hline
F & FSota& FA& FB &FC \\
\hline
G & GSota& GA& GB &GC \\
\hline
H & HSota& HA& HB &HC \\
\hline
I & ISota& IA& IB &IC \\
\hline
J & JSota& JA& JB &JC \\
\hline
K & KSota& KA& KB &KC \\
\hline
L & LSota& LA& LB &LC \\
\hline
M & MSota& MA& MB &MC \\
\hline
A & ASota& AA &AB &AC \\
\hline
B & BSota& BA &BB &BC \\
\hline
C & CSota& CA& CB &CC \\
\hline
D & DSota& DA& DB &DC \\
\hline
E & ESota& EA& EB &EC \\
\hline
F & FSota& FA& FB &FC \\
\hline
G & GSota& GA& GB &GC \\
\hline
H & HSota& HA& HB &HC \\
\hline
I & ISota& IA& IB &IC \\
\hline
J & JSota& JA& JB &JC \\
\hline
K & KSota& KA& KB &KC \\
\hline
L & LSota& LA& LB &LC \\
\hline
M & MSota& MA& MB &MC \\
\hline
F & FSota& FA& FB &FC \\
\hline
G & GSota& GA& GB &GC \\
\hline
H & HSota& HA& HB &HC \\
\hline
I & ISota& IA& IB &IC \\
\hline
J & JSota& JA& JB &JC \\
\hline
K & KSota& KA& KB &KC \\
\hline
L & LSota& LA& LB &LC \\
\hline
M & MSota& MA& MB &MC \\
\end{longtable}
\endgroup
\end{document}