LaTeX 表格无法延伸到下一页

LaTeX 表格无法延伸到下一页

我有一张很长的表格,它不会延伸到下一页。我正在使用日记模板。我尝试使用,longtable但没有用。我尝试了tabletabularxlongtable,但没有用,因为它不能正确调整宽度。表格停留在一页上,一半的表格消失了。

请检查我的代码并告诉我错误是什么。提前谢谢您。

\begin{longtable}{\fulllength}{CCCCCCCC}
%\begin{table}[H]
    \begin{adjustwidth}{-\extralength}{0cm}
        \newcolumntype{C}{>{\centering\arraybackslash}X}
        %\begin{tabularx}{\fulllength}{CCCCCCCC}
            \toprule
            \textbf{Sensing material}   & \textbf{Structure type}   & \textbf{Fabrication technique}     & \textbf{Temperature (\textdegree C)} & \textbf{VOCs detected}    & \textbf{Detection range}     & \textbf{Data analysis technique}     & \textbf{Ref.}\\
            \midrule
SnO\textsubscript{2} and WO\textsubscript{3}    & Villi-like nano structure         & Electron beam evaporation         & 212   & nitrogen oxide, ammonia, ethanol, acetone, toluene, benzene, carbon monoxide,         & 899 ppt – 10 ppm          & PCA           & \cite{RN5229}\\
                   \midrule
MOS (NiO, CuO, Cr\textsubscript{2}O\textsubscript{3}, SnO\textsubscript{2} and WO\textsubscript{3}) & Nano pattern of multi-array sensing           & Lithography           & 380   & toluene, nitrogen oxide, ammonia, ethanol, acetone, hexane, propanol          & 5 ppm         & PCA           & \cite{RN5230}\\
                   \midrule
SnO\textsubscript{2}    & Nanowire gradient         & Vapor solid method            & 326   & isopropyl alcohol, ethanol, carbon monoxide           & 2 – 10 ppm            & LDA           & \cite{RN5133}\\
                  \midrule
Pd/SnO\textsubscript{2} & Nanowire sensor array         & Vapor solid           & 150   & isopropyl alcohol         & 1 – 50 ppm            & LDA           & \cite{RN5134}\\
            \midrule
TiO\textsubscript{2}, SnO\textsubscript{2}, ITO, WO\textsubscript{3}    & Nanorod array         & Oblique angle deposition          & 250   & hydrogen, carbon monoxide, nitrogen dioxide           & 10 – 200 ppm          & -         & \cite{RN5132}\\
                   \midrule
Si-SiO\textsubscript{2}, Pd-SiO\textsubscript{2}, Pt-SiO\textsubscript{2}, Ti-SiO\textsubscript{2}  & Microwire sensor chip         & Flexible flame spray pyrolysis            & 400  & formaldehyde, acetone, ethanol, ammonia            & 3 ppb         & -         & \cite{RN483}\\
                   \midrule
WO\textsubscript{3} & Nanofibers        & Electrospinning           & 350   & hydrogen sulfide, acetone         & 1 – 5 ppm         & PCA           & \cite{RN5131}\\
                  \midrule
Cu\textsubscript{2}O    & Nanospheres           & silanization          & 180   & ethanol, ethylacetate, toluene, hexane, tetrahydrofuran           & 25 – 200 ppm          & PCA           & \cite{RN5231}\\
            \midrule
Gold    & Nano-islands          & In-situ iterative seeding and growth          & RT   & acetone, ethanol, propionaldehyde, acetophenone, benzyl alcohol, benzaldehyde & 1 – 1000 ppm           & PCA           & \cite{RN5232}\\
                   \midrule
Pt, Pd-doped SnO\textsubscript{2}/RGO   & Nanohybrids           & Hydrothermal          & 180   & hydrogen, hydrogen sulfide, nitrogen dioxide          & 0.04 – 40 ppm         & PCA, LDA, Hierarchical Cluster Analysis           & \cite{RN5233}\\
                   \midrule
Thermo-cycled MOS sensors   & MOS films         & Thermal deposition            & 260 - 290   & hexane, butyl acetate           & 50 – 175 ppm          & -         & \cite{RN287}\\
                  \midrule
Commercial PEN3, CAPINose   & TGS sensors           & -         & RT   & ethanol            & 10 vol.\%         & Average resistance            & \cite{RN286}\\
            \midrule
SnO\textsubscript{2}, WO\textsubscript{3}, ZnO, In\textsubscript{2}O\textsubscript{3}   & Nanofilms         & Screen printing           & 26 - 426   & formaldehyde, carbon monoxide, nitrogen dioxide, toluene, ammonia        & 0.6 – 1000 ppm            & -         & \cite{RN276}\\
                   \midrule
ZnTiO\textsubscript{3}  & Nanoarrays            & Hydrothermal, CVD         & 350   & acetone           & 1.2 – 12.5 ppm            & -         & \cite{RN296}\\
                  \midrule
Au/SnO\textsubscript{2}, Pt/SnO\textsubscript{2}, Ni/SnO\textsubscript{2}, ITO/SnO\textsubscript{2} & Multiplexed nanotube arrays           & Spray pyrolysis           & RT   & hydrogen, benzene, nitrogen dioxide            & 50 – 4000 ppm         & LVA           & \cite{RN5224}\\
                   \midrule
Warwick OLFaction (WOLF) E-nose & MEMS MOS-based commercial thick and thin film sensors     & -         & RT   & acetone, 1-propanol, iso-propanol, iso-butylene            & 2 – 10 ppm            & PCA           & \cite{RN120}\\
                   \midrule
Pt, Cu, and Ag decorated TiO\textsubscript{2} and ZnO functionalized GaN    & Nanowire          & Lithography, CVD, Chemical Etching            & RT   & nitrogen dioxide, sulfur dioxide, hydrogen, ethanol            & 0.1 – 10000 ppm           & PCA, SVM, k-NN, Decision Tree         & \cite{RN5237}\\
                  \midrule
Au decorated WO\textsubscript{3}, SnO\textsubscript{2} and NiO  & Thin films, nanostructures            & electron-beam evaporation         & 100 – 300   & acetone, toluene, ammonia, hydrogen sulfide         & 10 ppm            & PCA           & \cite{RN5238}\\
                   \midrule
Commercial MOS sensors  & TGS sensors           & -         & RT   & ethanol, acetone           & -         & partial least squares discriminant analysis           & \cite{RN5239}\\
                   \midrule
Commercial MOS sensors  & TGS Sensors           & -         & RT   & nitrogen dioxide, carbon monoxide          & 0 – 50 ppm            & PCA, C-means clustering, back propagation neural network          & \cite{RN5240}\\
                  \midrule
Pure and Fe-doped In\textsubscript{2}O\textsubscript{3} & nanofibers            & Electrospinning           & 250 – 450    & benzene, xylene, toluene, ethanol, formaldehyde            & 0.1 – 1000 ppm            & PCA           & \cite{RN5137}\\
            \bottomrule
        %\end{tabularx}
    \end{adjustwidth}
    %\noindent{\footnotesize{* Tables may have a footer.}}
%\end{table}
\end{longtable}

答案1

我强烈建议你加载板状的longtable包并使用其同名环境,该环境结合了和环境的功能tabularx。并且,一定要加载如下包化学工程并开始以精简易读的方式编写化合物名称。例如,\ce{Cr2O3}而不是Cr\textsubscript{2}O\textsubscript{3}。最后,我认为没有必要使用所有这些笨拙的\midrule指令;通过指令进行视觉分离\addlinespace至少同样有效。

您没有指出您使用的文档类或文本块的宽度和高度。因此,以下代码使用基本article文档类的默认值。请指出您使用的文档类。

在此处输入图片描述

在此处输入图片描述

\documentclass{article} % or some other suitable document class
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
%% define some additional hyphenation points:
\hyphenation{di-oxide hydro-thermal mon-oxide micro-wire 
nano-arrays nano-fi-bers nano-films nano-hybrids 
nano-spheres nano-struc-tures nano-tube nano-wire nano-wires
prop-anol}
\usepackage{amsmath}  % for '\nobreakdash' macro
\usepackage{mhchem}   % for '\ce' macro
\usepackage{xltabular,ragged2e,booktabs}
% column type that suppresses full justificaiton, but allows hyphenation:
\newcolumntype{L}{>{\RaggedRight\hspace{0pt}}X} 

\begin{document}

\setlength\tabcolsep{2.5pt} % default: 6pt

\begin{xltabular}{\textwidth}{@{} LLLL LLL l @{}}

%% headers and footers
\toprule
Sensing material & 
Structure type & 
Fabrication technique & 
Temperature (\textdegree C) & 
VOCs detected & 
Detection range & 
Data analysis technique & 
Ref.\\
\midrule
\endhead

\midrule
\multicolumn{8}{r@{}}{\footnotesize (\textit{cont'd on following page})}\\
\endfoot

\bottomrule
\endlastfoot

%% body of table
\ce{SnO3} and \ce{WO3} & Villi-like nano structure & Electron beam evaporation & 212 & nitrogen oxide, ammonia, ethanol, acetone, toluene, benzene, carbon monoxide, & 899 ppt--10 ppm & PCA & \cite{RN5229}\\
\addlinespace
MOS (\ce{NiO}, \ce{CuO}, \ce{Cr2O3}, \ce{SnO3} and \ce{WO3}) & Nano pattern of multi-array sensing & Lithography & 380 & toluene, nitrogen oxide, ammonia, ethanol, acetone, hexane, propanol & 5 ppm & PCA & \cite{RN5230}\\
\addlinespace
\ce{SnO3} & Nanowire gradient & Vapor solid method & 326 & isopropyl alcohol, ethanol, carbon monoxide & 2--10 ppm & LDA & \cite{RN5133}\\
\addlinespace
\ce{Pd}\slash \ce{SnO3} & Nanowire sensor array & Vapor solid & 150 & isopropyl alcohol & 1--50 ppm & LDA & \cite{RN5134}\\
\addlinespace
\ce{TiO2}, \ce{SnO3}, ITO, \ce{WO3} & Nanorod array & Oblique angle deposition & 250 & hydrogen, carbon monoxide, nitrogen dioxide & 10--200 ppm & -- & \cite{RN5132}\\
\addlinespace
\ce{Si}-\ce{SiO2}, \ce{Pd}-\ce{SiO2}, \ce{Pt}-\ce{SiO2}, \ce{Ti}-\ce{SiO2} & Microwire sensor chip & Flexible flame spray pyrolysis & 400 & formaldehyde, acetone, ethanol, ammonia & 3 ppb & -- & \cite{RN483}\\
\addlinespace
\ce{WO3} & Nanofibers & Electrospinning & 350 & hydrogen sulfide, acetone & 1--5 ppm & PCA & \cite{RN5131}\\
\addlinespace
\ce{Cu2O} & Nanospheres & silanization & 180 & ethanol, ethylacetate, toluene, hexane, tetrahydrofuran & 25--200 ppm & PCA & \cite{RN5231}\\
\addlinespace
Gold & Nano-islands & In-situ iterative seeding and growth & RT & acetone, ethanol, propionaldehyde, acetophenone, benzyl alcohol, benzaldehyde & 1--1000 ppm & PCA & \cite{RN5232}\\
\addlinespace
\ce{Pt}, \ce{Pd}-doped \ce{SnO3}\slash RGO & Nanohybrids & Hydrothermal & 180 & hydrogen, hydrogen sulfide, nitrogen dioxide & 0.04--40 ppm & PCA, LDA, Hierarchical Cluster Analysis & \cite{RN5233}\\
\addlinespace
Thermo-cycled MOS sensors & MOS films & Thermal deposition & 260--290 & hexane, butyl acetate & 50--175 ppm & -- & \cite{RN287}\\
\addlinespace
Commercial PEN3, CAPINose & TGS sensors & -- & RT & ethanol & 10 vol.\% & Average resistance & \cite{RN286}\\
\addlinespace
\ce{SnO3}, \ce{WO3}, \ce{ZnO}, \ce{In2O3} & Nanofilms & Screen printing & 26--426 & formaldehyde, carbon monoxide, nitrogen dioxide, toluene, ammonia & 0.6--1000 ppm & -- & \cite{RN276}\\
\addlinespace
\ce{ZiTiO3} & Nanoarrays & Hydrothermal, CVD & 350 & acetone & 1.2--12.5 ppm & -- & \cite{RN296}\\
\addlinespace
\ce{Au}\slash \ce{SnO3}, \ce{Pt}\slash \ce{SnO3}, \ce{Ni}\slash \ce{SnO3}, ITO\slash \ce{SnO3} & Multiplexed nanotube arrays & Spray pyrolysis & RT & hydrogen, benzene, nitrogen dioxide & 50--4000 ppm & LVA & \cite{RN5224}\\
\addlinespace
Warwick OLFaction (WOLF) E-nose & MEMS MOS-based commercial thick and thin film sensors & -- & RT & acetone, 1\nobreakdash-\hspace{0pt}propanol, iso-propanol, iso-butylene & 2--10 ppm & PCA & \cite{RN120}\\
\addlinespace
\ce{Pt}, \ce{Cu}, and \ce{Ag} decorated \ce{TiO2} and \ce{ZnO} functionalized \ce{GaN} & Nanowire & Lithography, CVD, Chemical Etching & RT & nitrogen dioxide, sulfur dioxide, hydrogen, ethanol & 0.1--10000 ppm & PCA, SVM, k-NN, Decision Tree & \cite{RN5237}\\
\addlinespace
Au decorated \ce{WO3}, \ce{SnO3} and \ce{NiO} & Thin films, nanostructures & electron-beam evaporation & 100--300 & acetone, toluene, ammonia, hydrogen sulfide & 10 ppm & PCA & \cite{RN5238}\\
\addlinespace
Commercial MOS sensors & TGS sensors & -- & RT & ethanol, acetone & -- & partial least squares discriminant analysis & \cite{RN5239}\\
\addlinespace
Commercial MOS sensors & TGS Sensors & -- & RT & nitrogen dioxide, carbon monoxide & 0--50 ppm & PCA, \mbox{C-means} clustering, back propagation neural network & \cite{RN5240}\\
\addlinespace
Pure and \ce{Fe}-doped \ce{In2O3} & Nanofibers & Electrospinning & 250--450 & benzene, xylene, toluene, ethanol, formaldehyde & 0.1--1000 ppm & PCA & \cite{RN5137}\\

\end{xltabular}
\end{document} 

答案2

  • 不幸的是,您没有提供 MWE(Minimqal 工作示例),这是一个很小但完整的文档。因此,页面布局和使用的文档类别是未知的。
  • 如果您参考使用“经典”包来编写长表格,使用该xltabular包是一个不错的选择,但也存在tabularray基于 LaTeX3 的较新的、用途广泛的包,它提供了编写表格的新功能(有关详细信息,请参阅包文档)。
  • 您的表格很宽,因此为了好看,需要更宽的˙\textwidth (which can be defined bygeometry package or you may consider to write your table in the landscape page orientation. Beside this, for better spacing text in table cells, I would recommend to use\small` 字体大小。
  • 对于单位和数量,我建议使用˙siunitx`包。
  • 为了使一些列标题变窄,我将使用缩写并在表格注释中解释它们的含义。
  • 通过将表格中的行数减少约 10%,可以将表格放在两页上。
  • 因此,您的表格的可能解决方案也可能如下:
\documentclass{article} 
\usepackage[margin=25mm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
%% define some additional hyphenation points:
\hyphenation{electro-spinning di-oxide hydro-thermal mon-oxide micro-wire
             nano-arrays nano-fi-bers nano-films nano-hybrids
             nano-spheres nano-struc-tures nano-tube nano-wire nano-wires
             prop-anol}
\usepackage[version=4]{mhchem}   % for '\ce' macro

\usepackage{ragged2e}
\usepackage{tabularray}
\UseTblrLibrary{amsmah, booktabs, siunitx}

\begin{document}

\begingroup
\sisetup{range-units = single, range-phrase = --}
\begin{longtblr}[
    entry=none,     % <---
    label=none,     % <---
note{a} = {T: Temperature},
note{b} = {DAT: Data Analysis Techniques},
                ]{colsep  = 3pt,     
                  colspec = {@{} *{3}{X[l]} c X[1.8, l] *{2}{X[l]} l @{}},
                  cells   = {font=\small\linespread{0.9}\selectfont},
                  row{3-Z}= {rowsep=5pt},
                  row{1}  = {font=\footnotesize\bfseries,m}, 
                  rowhead = 1, 
                  }
%%  table body
    \toprule
{Sensing\\ material} 
    &   {Structure\\ type}
        &   {Fabrication\\ technique}
            &   {T\TblrNote{a}\\ (\unit{\degreeCelsius})}
                &   {VOCs\\ detected}
                    &   Detection range
                        &   DAT\TblrNote{b}
                            &   Ref.     \\
    \midrule
\ce{SnO3} and \ce{WO3} & Villi-like nano structure & Electron beam evaporation & 212 & nitrogen oxide, ammonia, ethanol, acetone, toluene, benzene, carbon monoxide, & \qty{899}{ppt} -- \qty{10}{ppm} & PCA & \cite{RN5229}\\

MOS (\ce{NiO}, \ce{CuO}, \ce{Cr2O3}, \ce{SnO3} and \ce{WO3}) & Nano pattern of multi-array sensing & Lithography & 380 & toluene, nitrogen oxide, ammonia, ethanol, acetone, hexane, propanol & \qty{5}{ppm} & PCA & \cite{RN5230}\\

\ce{SnO3} & Nanowire gradient & Vapor solid method & 326 & isopropyl alcohol, ethanol, carbon monoxide & \qtyrange{2}{10}{ppm} & LDA & \cite{RN5133}\\

\ce{Pd}\slash \ce{SnO3} & Nanowire sensor array & Vapor solid & 150 & isopropyl alcohol & \qtyrange{1}{50}{ppm} & LDA & \cite{RN5134}\\

\ce{TiO2}, \ce{SnO3}, ITO, \ce{WO3} & Nanorod array & Oblique angle deposition & 250 & hydrogen, carbon monoxide, nitrogen dioxide & \qtyrange{10}{200}{ppm} & -- & \cite{RN5132}\\

\ce{Si}-\ce{SiO2}, \ce{Pd}-\ce{SiO2}, \ce{Pt}-\ce{SiO2}, \ce{Ti}-\ce{SiO2} & Microwire sensor chip & Flexible flame spray pyrolysis & 400 & formaldehyde, acetone, ethanol, ammonia & \qty{3}{ppm} & -- & \cite{RN483}\\

\ce{WO3} & Nanofibers & Electro\-spinning & 350 & hydrogen sulfide, acetone & \qtyrange{1}{5}{ppm} & PCA & \cite{RN5131}\\

\ce{Cu2O} & Nanospheres & silanization & 180 & ethanol, ethylacetate, toluene, hexane, tetrahydrofuran & \qtyrange{25}{200}{ppm} & PCA & \cite{RN5231}\\

Gold & Nano-islands & In-situ iterative seeding and growth & RT & acetone, ethanol, propionaldehyde, acetophenone, benzyl alcohol, benzaldehyde & \qtyrange{1}{1000}{ppm} & PCA & \cite{RN5232}\\

\ce{Pt}, \ce{Pd}-doped \ce{SnO3}\slash RGO & Nanohybrids & Hydro\-thermal & 180 & hydrogen, hydrogen sulfide, nitrogen dioxide & \qtyrange{0.04}{40}{ppm} & PCA, LDA, Hierarchical Cluster Analysis & \cite{RN5233}\\

Thermo-cycled MOS sensors & MOS films & Thermal deposition & 260--290 & hexane, butyl acetate & \qtyrange{50}{175}{ppm} & -- & \cite{RN287}\\

Commercial PEN3, CAPINose & TGS sensors & -- & RT & ethanol & 10 vol.\% & Average resistance & \cite{RN286}\\

\ce{SnO3}, \ce{WO3}, \ce{ZnO}, \ce{In2O3} & Nanofilms & Screen printing & 26--426 & formaldehyde, carbon monoxide, nitrogen dioxide, toluene, ammonia & \qtyrange{0.6}{1000}{ppm} & -- & \cite{RN276}\\

\ce{ZiTiO3} & Nanoarrays & Hydro\-thermal, CVD & 350 & acetone & \qtyrange{1.2}{12.5}{ppm} & -- & \cite{RN296}\\

\ce{Au}\slash \ce{SnO3}, \ce{Pt}\slash \ce{SnO3}, \ce{Ni}\slash \ce{SnO3}, ITO\slash \ce{SnO3} & Multiplexed nanotube arrays & Spray pyrolysis & RT & hydrogen, benzene, nitrogen dioxide & \qtyrange{50}{4000}{ppm} & LVA & \cite{RN5224}\\

Warwick OLFaction (WOLF) E-nose & MEMS MOS-based commercial thick and thin film sensors & -- & RT & acetone, 1\nobreakdash-\hspace{0pt}propanol, iso-propanol, iso-butylene & \qtyrange{2}{10}{ppm} & PCA & \cite{RN120}\\

\ce{Pt}, \ce{Cu}, and \ce{Ag} decorated \ce{TiO2} and \ce{ZnO} functionalized \ce{GaN} & Nanowire & Lithography, CVD, Chemical Etching & RT & nitrogen dioxide, sulfur dioxide, hydrogen, ethanol & \qtyrange{0.1}{10000}{ppm} & PCA, SVM, k-NN, Decision Tree & \cite{RN5237}\\

Au decorated \ce{WO3}, \ce{SnO3} and \ce{NiO} & Thin films, nanostructures & electron-beam evaporation & 100--300 & acetone, toluene, ammonia, hydrogen sulfide & \qty{10}{ppm} & PCA & \cite{RN5238}\\

Commercial MOS sensors & TGS sensors & -- & RT & ethanol, acetone & -- & partial least squares discriminant analysis & \cite{RN5239}\\

Commercial MOS sensors & TGS Sensors & -- & RT & nitrogen dioxide, carbon monoxide & \qtyrange{0}{50}{ppm} & PCA, \mbox{C-means} clustering, back propagation neural network & \cite{RN5240}\\

Pure and \ce{Fe}-doped \ce{In2O3} & Nanofibers & Electro\-spinning & 250--450 & benzene, xylene, toluene, ethanol, formaldehyde & \qtyrange{0.1}{1000}{ppm} & PCA & \cite{RN5137} \\
    \bottomrule
    \end{longtblr}
\endgroup
\end{document} 

在此处输入图片描述

相关内容