我正在尝试建立一个大乳胶桌。该表有 30 列。在此代码中,我使用 latex 中的 \longtable 来制作我向您展示的表。有人能帮我重现我在 Word 横向页面上实现的图片中的大表吗?我想重复表格标题,以防表格在 latex 中继续到下一页。
\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage{pdflscape} % for 'landscape' environment
\usepackage{longtable}
\title{test-lontable}
\author{emile nana}
\date{February 2024}
\begin{document}
\maketitle
\section{Introduction}
\begin{landscape}
\begin{longtable}{|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|p{0.2cm}|}
\hline
Products & Licence & & Visualization & & Programming language & Coding & & & behavior & & & watch type & & Flow mode & & & Look & & & Area & & & Happy & & &Output data & Popularity Out of 10 & Version & Error \\
\hline
\textbf{AAAAAAAAAA} & & X & X & X & Java, Python, C++ & & X & &
X & & & X & & X & & & X & & & & & & & X & & Charts & 2 & 8.8.4 of June
19, 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & X & C++, VB, Matlab, Python &
X & & & X & & & X & X & X & & & X & & & & & & X & & & XML & 4 & 12.0.0
from March 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & X & Python, C++ & & & X & X & &
& & X & X & X & X & X & & & & X & X & X & & & Graph & 4 & 23.1.0 from
August 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & X & & X & & C++, VB, Matlab, Python & & &
X & X & & & & X & X & & & X & & & X & X & & X & & & XML & 4 & 1.18.0
from June 29, 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & X & & X & & C++, JAVA & X & & & & X & & & X
& X & & & X & & & X & X & & X & & & Text & 3 & 14.0 from June 2023 &
you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & X & & X & X & GAML & X & & & X & & & & X & X &
& X & X & & & & & & X & & & Charts, Graphs & 2 & 1.9.2 from September
2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & X & C++, VB, Matlab, Python & &
& X & X & & & & & X & & & X & & & X & X & & X & & & Graphs & 2 & 24.0.4
of August 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & X & & X & & C++, VB, Matlab, Python & &
X & X & & & X & & & X & X & & & & & & X & X & X & & & XML & 3 & 6.1.12
of December 2022 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & X & Python, C++ & & & X & & & X & X
& & & & X & X & & & X & X & & X & X & & Text, XML, CSV & 2 & 7.2 from
September 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & X & Python, C++, Java, C\# & & & X
& & & & X & X & X & & & X & & & & & & X & X & & Graph, charts & 1 &
1.2.3 from September 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & & C++, Python & X & &
& X & & & X & X & X & & & X & & & & & & X & & & Graph, charts & 1 &
16.2.3 of September 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & X & & X & & C++, Python & & X & & X & & & X & X & X &
& & X & & & & & & X & & & Graph, charts & 1 & 2.0 from August 4, 2023 &
you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & X & & X & X & Python & & X & & & & X & X &
X & & X & & X & & & & & & X & & & CSV & 2 & 3.1.0 from August 4, 2023 &
you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & X & C++, Python & X & & & X &
& & X & & X & & & X & & & & & & X & & & Graph, charts & 2 & 5.3.0 from
February 15, 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & X & & X & & Python & X & & & & & & X & X & X & & & X & &
& & & & X & & & Graph, charts & & 1.13.2 of September 21, 2023 &
you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & X & Python, C\#, VB, VBS, JS & & X
& & X & & & X & X & X & X & & X & & & & & & X & & & Graphs, Charts & 1 &
6.1.0 from August 4, 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & & Python & & X & & & & & & X & X & &
& X & & & & & & X & & & CSV, XML, JSON & 1 & 3.0.1 from Feb 28, 2023 &
you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & X & & X & & Python & & X & & & X & & & X & X & & &
X & & & X & & & X & & & Charts & 2 & 7.1.2 from Sep 15, 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & X & & X & X & C++, Python & X & & & X & & &
X & X & X & & & X & & & X & X & X & X & & & Graphs & 2 & 3.1.1 from Oct
2023 & you can still download them or view the raw for no comment \\
\hline
\textbf{AAAAAAAAAA} & X & & X & X & Python, C++, Java,
JavaScript, SQL, R & X & & & X & & & & X & & X & & X & & & & & X & & & &
Graphs, charts & 2 & 3.13.1 of Sep 19, 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & & X & Python & & & & X & & & & X
& X & & & X & & & & & & X & & & Graphs & 3 & 1.2.1 from Sep 16, 2023 &
you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & X & Python & & X & & X & & & &
X & X & & & X & & & & & & X & & & Graphs & 2 & 7.1.2
from Sep 15, 2023 & you can still download them or view the raw \\
\hline
\end{longtable}
\end{landscape}
\end{document}
当我遵循你的评论和指导时,我获得了我向你呈现的代码
\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage{pdflscape} % for 'landscape' environment
\usepackage{longtable,booktabs}
\title{test-lontable}
\author{emile nana}
\date{February 2024}
\begin{document}
\maketitle
\section{Introduction}
\begin{landscape}
\begin{longtable}
{*{30}{p{0.2cm}|}}
\caption{My longtable} \\ \toprule
\hline
Products & Licence & & Visualization & & Programming language & Coding & & & behavior & & & watch type & & Flow mode & & & Look & & & Area & & & Happy & & &Output data & Popularity Out of 10 & Version & Error \\ \midrule
\endfirsthead
\toprule
Products & Licence & & Visualization & & Programming language & Coding & & & behavior & & & watch type & & Flow mode & & & Look & & & Area & & & Happy & & &Output data & Popularity Out of 10 & Version & Error \\ \midrule
\endhead
\hline
\multicolumn{2}{c}{Continued}\\ \bottomrule
\endfoot
\bottomrule
\endlastfoot
\textbf{AAAAAAAAAA} & & X & X & X & Java, Python, C++ & & X & &
X & & & X & & X & & & X & & & & & & & X & & Charts & 2 & 8.8.4 of June
19, 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & X & C++, VB, Matlab, Python &
X & & & X & & & X & X & X & & & X & & & & & & X & & & XML & 4 & 12.0.0
from March 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & X & Python, C++ & & & X & X & &
& & X & X & X & X & X & & & & X & X & X & & & Graph & 4 & 23.1.0 from
August 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & X & & X & & C++, VB, Matlab, Python & & &
X & X & & & & X & X & & & X & & & X & X & & X & & & XML & 4 & 1.18.0
from June 29, 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & X & & X & & C++, JAVA & X & & & & X & & & X
& X & & & X & & & X & X & & X & & & Text & 3 & 14.0 from June 2023 &
you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & X & & X & X & GAML & X & & & X & & & & X & X &
& X & X & & & & & & X & & & Charts, Graphs & 2 & 1.9.2 from September
2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & X & C++, VB, Matlab, Python & &
& X & X & & & & & X & & & X & & & X & X & & X & & & Graphs & 2 & 24.0.4
of August 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & X & & X & & C++, VB, Matlab, Python & &
X & X & & & X & & & X & X & & & & & & X & X & X & & & XML & 3 & 6.1.12
of December 2022 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & X & Python, C++ & & & X & & & X & X
& & & & X & X & & & X & X & & X & X & & Text, XML, CSV & 2 & 7.2 from
September 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & X & Python, C++, Java, C\# & & & X
& & & & X & X & X & & & X & & & & & & X & X & & Graph, charts & 1 &
1.2.3 from September 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & & C++, Python & X & &
& X & & & X & X & X & & & X & & & & & & X & & & Graph, charts & 1 &
16.2.3 of September 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & X & & X & & C++, Python & & X & & X & & & X & X & X &
& & X & & & & & & X & & & Graph, charts & 1 & 2.0 from August 4, 2023 &
you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & X & & X & X & Python & & X & & & & X & X &
X & & X & & X & & & & & & X & & & CSV & 2 & 3.1.0 from August 4, 2023 &
you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & X & C++, Python & X & & & X &
& & X & & X & & & X & & & & & & X & & & Graph, charts & 2 & 5.3.0 from
February 15, 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & X & & X & & Python & X & & & & & & X & X & X & & & X & &
& & & & X & & & Graph, charts & & 1.13.2 of September 21, 2023 &
you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & X & Python, C\#, VB, VBS, JS & & X
& & X & & & X & X & X & X & & X & & & & & & X & & & Graphs, Charts & 1 &
6.1.0 from August 4, 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & & Python & & X & & & & & & X & X & &
& X & & & & & & X & & & CSV, XML, JSON & 1 & 3.0.1 from Feb 28, 2023 &
you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & X & & X & & Python & & X & & & X & & & X & X & & &
X & & & X & & & X & & & Charts & 2 & 7.1.2 from Sep 15, 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & X & & X & X & C++, Python & X & & & X & & &
X & X & X & & & X & & & X & X & X & X & & & Graphs & 2 & 3.1.1 from Oct
2023 & you can still download them or view the raw for no comment \\
\hline
\textbf{AAAAAAAAAA} & X & & X & X & Python, C++, Java,
JavaScript, SQL, R & X & & & X & & & & X & & X & & X & & & & & X & & & &
Graphs, charts & 2 & 3.13.1 of Sep 19, 2023 & you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & & X & Python & & & & X & & & & X
& X & & & X & & & & & & X & & & Graphs & 3 & 1.2.1 from Sep 16, 2023 &
you can still download them or view the raw \\
\hline
\textbf{AAAAAAAAAA} & & X & X & X & Python & & X & & X & & & &
X & X & & & X & & & & & & X & & & Graphs & 2 & 7.1.2
from Sep 15, 2023 & you can still download them or view the raw \\
\hline
\end{longtable}
\end{landscape}
\end{document}
答案1
你的表格非常大,因此要想让它变得可读起来会很难......
可能的解决方案是(i)增加\textwidth
和\textheight
,(ii)旋转列标题以使其文本更易于阅读,即表格重新设计如下:
要实现上述设计似乎很方便使用tabularray
如下包:
\documentclass{article}
\usepackage[margin=20mm]{geometry}
\usepackage{pdflscape}
\usepackage{ragged2e}
\usepackage{rotating} % needed
\usepackage{makecell} % needed
\usepackage{tabularray}
\usepackage{xcolor}
\usepackage{dingbat}
\newcommand\tcm{\textcolor{teal}{\checkmark}}% TealCheckMark
\begin{document}
\begin{landscape}
\settowidth\rotheadsize{Homogeneous} % from makecell
\begin{longtblr}[
caption = {Huge long table},
label = {tab:huge}
]{colsep = 2pt,
colspec = {X[l] *{4}{c} X[0.8, c] *{22}{c} X[l] X[1.2, l]},
cell{1}{1} = {r=2}{},
cell{1}{2,4,13} = {c=2}{},
cell{1}{7,10,15,18,21,24} = {c=3}{},
cell{1}{27-30} = {r=2}{cmd=\rotcell, font=\small},
row{1} = {c, m}, % <----
row{2} = {cmd=\rotcell, font=\small}, % <----
rowhead = 1, hlines, vlines,
}
product
& Licence
& & Visual.
& & {Program.\\ language}
& Coding
& & & behavior
& & & {watch\\ type}
& & {Flow\\ mode}
& & & Look
& &
& Area
& & & Happy
& & & {Output\\ data}
& {Popularity\\ Out of 10}
& Version
& Error \\
%
& {Open source}
& Commercial
& 2D
& 3D
& & Easy
& Average
& Difficult
& Flexible
& Limit
& Very limited
& Homogeneous
& Heterpgenus
& Mesoscopic
& Macroscopic
& Macroscopic
& Yes
& Maybe
& No
& City
& Region
& Country
& Yeas
& Maybe
& No
& & & \\
AAAAAAA BBB CCCC
& & \tcm
& \tcm
& \tcm
& Java, Python, C++
& & \tcm
& & \tcm
&
& & \tcm
& & \tcm
& & & \tcm
& & &
& & & & \tcm
& & Charts
& 2 & 8.8.4 of June 19, 2023
& you can still download them or view the raw
\\
DDD EEEEEE FF GGGGG
& & \tcm
& \tcm
& \tcm
& C++, VB, Matlab, Python
& \tcm
& & & \tcm
&
& & \tcm
& \tcm
& \tcm
& & & \tcm
& & &
& & & \tcm
& & & XML
& 4 & 12.0.0 from March 2023
& you can still download them or view the raw \\
HHH II JJJJJJ KKK
& & \tcm
& \tcm
& \tcm
& Python, C++
& & & \tcm
& \tcm
&
& & & \tcm
& \tcm
& \tcm
& \tcm
& \tcm
& &
& & \tcm
& \tcm
& \tcm
& & & Graph
& 4 & 23.1.0 from August 2023
& you can still download them or view the raw
\\
\end{longtblr}
\end{landscape}
\end{document}
上面的 MWE(最小工作示例)只是一个骨架,您可以用真实数据填充它。
如果获得的表格长度超过一页,它将自动在下一页重复列标题,并添加表格在下一页继续的信息。