长宽表中的 Ltablex 错误

长宽表中的 Ltablex 错误

大家早上好。

我在尝试使用包在论文中创建多页表格时遇到问题ltablex。问题是表格不会在下一页继续;仅与表格相关的代码或多或少是这样的:

\documentclass[12pt,a4paper,twoside,openany]{book}
\usepackage{tabularx}
\usepackage{ltablex}
\usepackage{multirow}

\begin{document}    

\begin{table}
\scriptsize
\begin{tabularx}{\linewidth}{>{\setlength{\hsize}{.7\hsize}\arraybackslash}X>{\setlength{\hsize}{1.3\hsize}\arraybackslash}Xl}
\caption{caption}

\hline
\multicolumn{3}{c}{\textbf{General data}}   \\ 
Machine & TCV & string \\ 
Shot & Shot number & \\
t_{start,end,med.} & Initial, final and medium time interval extremes & s \\ \hline \hline
\multicolumn{3}{c}{\textbf{Parameters directly related to the fits}} \\ 
T$_{e,sep.}$ & Temperature at the separatrix    & eV \\
n$_{e,sep.,mtanh/lin.}$ & Separatrix density & m$^{-3}$ \\
p$_{e,sep.,mtanh/lin.}$ & Separatrix pressure & Pa \\
T/n/p$_{e,ped.,mtanh/lin.}$ & Pedestal temperature, density and pressure    & eV/m$^{-3}$/Pa \\
w$_{T,n,p}^{e,ped.,mtanh,lin.}$ & Pedestal width (temperature, density and pressure) & $\psi$ (adim.)\\
p$_{T,n,p}^{e,ped.,mtanh,lin.}$ & Pedestal position (temperature, density and pressure) & $\psi$ (adim.)\\
T/n/p$_{e,offset,mtanh/lin.}$ & Pedestal offset in the temperature, density and pressure profiles in the Scrape-Off Layer & eV/m$^{-3}$/Pa  \\
Core.slope.T/n/p$_{e,mtanh/lin.}$   & Temperature, density and pressure core slope  & eV/\psi, m$^{-3}$/$\psi$, Pa/$\psi$ \\
Max.Grad.T/n/p$_{e,mtanh/lin.}$ & Temperature, density and pressure pedestal maximum gradient & eV/$\psi$, m$^{-3}$/$\psi$, Pa/$\psi$ \\
Max Grad T/n/p$_{e,mtanh}$ & Temperature, density and pressure pedestal max. gradient position  & eV/$\psi$, m$^{-3}$/$\psi$, Pa/$\psi$\\
mtanh/lin parameters & Parameters related to the construction of the fit    & \\ \hline \hline
\multicolumn{3}{c}{\textbf{Other pedestal parameters}} \\
T$_i,ped$ & Pedestal ion temperature & eV \\
Z$_{eff,ped}$ & Effective charge number at the pedestal & \\
V$_{pol,ped}$ & Pedestal poloidal velocity & m/s \\
V$_{tor,ped}$ & Pedestal toroidal velocity & m/s \\ \hline \hline
\multicolumn{3}{c}{\textbf{Derived parameters}} \\
w$_{th}^{e/i,ped,mtanh/lin.}$ & Pedestal stored energy (for electrons and ions) & J \\
V$_{ped,mtanh/lin.}$ & Plasma volume at the pedestal top & m$^3$ \\
V$_{tot,mtanh/lin.}$ & Plasma total volume & m$^3$ \\
$\alpha_{max,e}$ & Max value of the normalized electron pressure gradient (in mtanh fit only) & \\
pos $\alpha_{max,e}$ & Position of $\alpha_{max,e}$ in $\psi$ space & $\psi$ \\ \hline \hline
\multicolumn{3}{c}{\textbf{Dimensionless parameters}} \\
$\beta_{pol,e,ped,avg/HFS/LFS,lin}$ $\beta_{pol,e,ped,avg/HFS/LFS,mtanh}$ & Poloidal confinement parameter of the pedestal at the HFS, the LFS and as an average over the flux surface value between both & \\
$\nu*_{ped,e,mtanh/lin.}$ & Pedestal normalized collisionality & \\
$\rho*_{ped,LFS/HFS/axis,e,mtanh/lin.}$ & Normalized Larmor radius of the pedestal at the HFS, the LFS and as an average value between both & \\
B$_{pol,avg,mtanh/lin.}$ & Poloidal magnetic field at the pedestal top averaged over the flux surface & T \\
B$_{pol/tor/tot,HFS/LFS,mtanh/lin.}$ & Poloidal, toroidal and total magnetic field at the HFS, LFS at the pedestal top & T \\
log($\Lambda_{mtanh/lin}$) & Small angle collision contribution & \\
$\epsilon$ & Inverse aspect ratio & \\
q$_{95}$ & Safety factor at $psi$=0.95 & \\
R & Major radius & \\
B$_{axis}$ & Magnetic field value at the magnetic axis & \\ \hline \hline
\multicolumn{3}{c}{\textbf{ELMs}} \\
f$_{ELM}$ & ELM frequency & Hz \\
ELM type & ELM type & \\
W$_{ELM}$ & ELM energy loss & J \\
$\tau_{ELM}$ & Time length for the ELM to collapse & s \\ \hline \hline
\multicolumn{3}{c}{\textbf{Global parameters to store}} \\
I$_p$ & Plasma current & A \\
B$_t$ & Toroidal field & T \\
P$_{NBI}$ & NBI power & W \\
P$_{ICRH}$ & Ion Cyclotron Resonance Heating (not available at TCV) & W \\
P$_{ECRH}$ & Electron Cyclotron Resonance Heating & W \\
P$_\Omega$ & Ohmic power & W \\
P$_{tot}$ & (Total power)-(NBI shine through(complex to calculate)) - (dW/dt) & W \\
P$_{rad}$ & Radiative power & W \\
W$_{MHD}$ & MHD energy & J \\
W$_{dia}$ & Diamagnetic energy & J \\
$\beta_{N/p,global,MHD/dia}$ & Global confinement parameter both normal (N) and poloidal (p) from MHD or diamagnetic calculations & \\
L$_{i,MHD,dia}$ & Internal inductance form MHD or diamagnetic calculations & H \\
$\tau_e$ & Energy confinement time & s \\
ngw & Greenwald density & \\
n$_{e.l.a}$ & Line averaged electron density & m$^{-3}$ \\
H$_{98}$ & H$_{98}$IPB(y,2) & \\
$\tau_e{e,IPB98(y,2)}$ & Energy confinement time from the scaling law IPB98(y,2) & s \\
Main ion & Main ion (H,D,T,He,H-D,D-T) & string \\
M$_{eff}$ & effective mass & \\
H$_{rate}$ & Hydrogen puff rate & e/s \\
D$_{rate}$ & Dueterium puff rate & e/s \\
He$_{rate}$ & Helium puff rate & e/s \\
T$_{rate}$ & Tritium puff rate & e/s \\
Imp$_{seeding1}$ & Seeded specie 1 & string \\
Imp$_{seeding2}$ & Seeded specie 2 & string \\
Imp$_{seeding1}$ rate & Specie 1 puff rate & string \\
Imp$_{seeding2}$ rate & Specie 2 puff rate & string \\
Z$_{eff,line}$ & Line integrated Z$_{eff}$ & \\
W$_{th,tot}$ & Total thermal store energy & J \\
W$_{fast}$ & Fast particle enrgy & J \\
$\beta_{N,th}$ & total thermal $\beta_N$ & \\ \hline \hline
\multicolumn{3}{c}{\textbf{Equilibrium}} \\
$\psi_{pol,norm,r}$ & Normalized flux coordinate $\psi$ vs radius at z=Z$_{mag}$ & \\
r$_{zmag}$ & radial basis for $\psi_{pol,norm,r}$ & \\
r$_{mid,profile}$ & Midplane radius vs normalized $\psi_{pol}$ & \\
V$_{profile}$ & Volume vs normalized $\psi_{pol}$ & \\
FF'$_{profile}$ & FF' vs normalized $\psi_{pol}$ & \\
p'$_{profile}$ & p' vs normalized $\psi_{pol}$ & \\
q$_{profile}$ & q vs normalized $\psi_{pol}$ & \\
shear profile & shear profile & \\
q$_{min}$ & min value of the safety factor & \\
$\psi_{axis}$ & $\psi_{pol}$ value at the axis & \\
$\psi_{sep}$ & $\psi_{pol}$ value at the separatrix & \\
$\delta_{upper}$ & Upper triangularity & \\
$\delta_{lower}$ & Lower triangularity & \\
$\kappa$ & Elongation & \\
Divertor Geometry & Divertor geometry (In this thesis, LSN) & string \\
Strike point & Position of the strike point & string \\
r$_{outer}$ & r coordinate of the outer strike point & m \\
z$_{outer}$ & z coordinate of the outer strike point & m \\
r$_{inner}$ & r coordinate of the inner strike point & m \\
z$_{inner}$ & z coordinate of the inner strike point & m \\
R$_{mag}$ & r coordinate of the magnetic axis & m \\
Z$_{mag}$ & z coordinate of the magnetic axis & m \\
R$_{geo}$ & r coordinate of the geometric axis & m \\
Z$_{geo}$ & z coordinate of the geometric axis & m \\
a & Minor radius & m \\
$\psi_{grid}$ & Matrix for the $\psi$ grid & m$\times$m\\
r$_{\psi,grid}$ & r for the $\psi$ grid & m \\
z$_{\psi,grid}$ & z for the $\psi$ grid & m \\
\hline

\end{tabularx}
\label{label}
\end{table}
\end{document}

正如我指出的那样,表格很长,我希望中间一列占据尽可能多的空间。

不幸的是,在某些情况下,即使表格被正确可视化,描述似乎也太长,编译器也会返回错误;我不明白为什么我认为这个包使用`begin{tabularx}{...}{...}`中指定的命令来调整设置水平尺寸的列内的文本;即使出现错误,pdf 输出也会给出一个像什么都没发生一样的表格。

但是,当我到达页面末尾时,表格似乎不想转到下一页。所以,我的问题是,我做错了什么?

我正在使用 TeXnicCenter,版本 2.02 Stable(64 位)。

如果我遗漏了什么,我提前道歉,这是我第一次用 LaTeX 编码,当然,任何关于此事的建议都会非常感激 :D。祝你有美好的一天。

答案1

嗯,您的表格中存在一些问题:

  1. 通过使用,\usepackage{ltablex}您不必使用环境table,它打破了跨页面的可能性,ltablex或者更好地调用longtable了跨页面。
  2. 我删除了列定义中的\setlength{\hsize}{.7\hsize}\setlength{\hsize}{1.3\hsize}X
  3. 您最好利用环境booktabs来获得更好的水平线。
  4. \\后面缺少一个\captionlongtable需要这个!)
  5. $您的代码中缺少一些内容(请参阅<=======代码更改的标记)。

因此,使用以下更正后的代码

\documentclass[12pt,a4paper,twoside,openany]{book}

\usepackage{ltablex}
\usepackage{booktabs} % <===============================================
\usepackage{multirow}


\begin{document}

\scriptsize
\begin{tabularx}{\linewidth}{%
  >{\arraybackslash}X% \setlength{\hsize}{.7\hsize} % <=================
  >{\arraybackslash}X% \setlength{\hsize}{1.3\hsize} % <================
  l}
\caption{caption} \\ % <================================================
\toprule % <============================================================
\multicolumn{3}{c}{\textbf{General data}}   \\ 
Machine & TCV         & string \\ 
Shot    & Shot number & \\
t$_{start,end,med.}$ & Initial, final and medium time interval extremes & s \\ % <================
\midrule % <============================================================
\multicolumn{3}{c}{\textbf{Parameters directly related to the fits}} \\ 
T$_{e,sep.}$            & Temperature at the separatrix    & eV \\
n$_{e,sep.,mtanh/lin.}$ & Separatrix density & m$^{-3}$ \\
p$_{e,sep.,mtanh/lin.}$ & Separatrix pressure & Pa \\
T/n/p$_{e,ped.,mtanh/lin.}$ & Pedestal temperature, density and pressure    & eV/m$^{-3}$/Pa \\
w$_{T,n,p}^{e,ped.,mtanh,lin.}$ & Pedestal width (temperature, density and pressure) & $\psi$ (adim.)\\
p$_{T,n,p}^{e,ped.,mtanh,lin.}$ & Pedestal position (temperature, density and pressure) & $\psi$ (adim.)\\
T/n/p$_{e,offset,mtanh/lin.}$ & Pedestal offset in the temperature, density and pressure profiles in the Scrape-Off Layer & eV/m$^{-3}$/Pa  \\
Core.slope.T/n/p$_{e,mtanh/lin.}$   & Temperature, density and pressure core slope  & eV/$\psi$, m$^{-3}$/$\psi$, Pa/$\psi$ \\ % <=======================
Max.Grad.T/n/p$_{e,mtanh/lin.}$ & Temperature, density and pressure pedestal maximum gradient & eV/$\psi$, m$^{-3}$/$\psi$, Pa/$\psi$ \\
Max Grad T/n/p$_{e,mtanh}$ & Temperature, density and pressure pedestal max. gradient position  & eV/$\psi$, m$^{-3}$/$\psi$, Pa/$\psi$\\
mtanh/lin parameters & Parameters related to the construction of the fit    & \\ 
\midrule
\multicolumn{3}{c}{\textbf{Other pedestal parameters}} \\
T$_i,ped$     & Pedestal ion temperature & eV \\
Z$_{eff,ped}$ & Effective charge number at the pedestal & \\
V$_{pol,ped}$ & Pedestal poloidal velocity & m/s \\
V$_{tor,ped}$ & Pedestal toroidal velocity & m/s \\ 
\midrule
\multicolumn{3}{c}{\textbf{Derived parameters}} \\
w$_{th}^{e/i,ped,mtanh/lin.}$ & Pedestal stored energy (for electrons and ions) & J \\
V$_{ped,mtanh/lin.}$ & Plasma volume at the pedestal top & m$^3$ \\
V$_{tot,mtanh/lin.}$ & Plasma total volume & m$^3$ \\
$\alpha_{max,e}$ & Max value of the normalized electron pressure gradient (in mtanh fit only) & \\
pos $\alpha_{max,e}$ & Position of $\alpha_{max,e}$ in $\psi$ space & $\psi$ \\ 
\midrule
\multicolumn{3}{c}{\textbf{Dimensionless parameters}} \\
$\beta_{pol,e,ped,avg/HFS/LFS,lin}$ $\beta_{pol,e,ped,avg/HFS/LFS,mtanh}$ & Poloidal confinement parameter of the pedestal at the HFS, the LFS and as an average over the flux surface value between both & \\
$\nu*_{ped,e,mtanh/lin.}$ & Pedestal normalized collisionality & \\
$\rho*_{ped,LFS/HFS/axis,e,mtanh/lin.}$ & Normalized Larmor radius of the pedestal at the HFS, the LFS and as an average value between both & \\
B$_{pol,avg,mtanh/lin.}$ & Poloidal magnetic field at the pedestal top averaged over the flux surface & T \\
B$_{pol/tor/tot,HFS/LFS,mtanh/lin.}$ & Poloidal, toroidal and total magnetic field at the HFS, LFS at the pedestal top & T \\
log($\Lambda_{mtanh/lin}$) & Small angle collision contribution & \\
$\epsilon$ & Inverse aspect ratio & \\
q$_{95}$ & Safety factor at $psi$=0.95 & \\
R & Major radius & \\
B$_{axis}$ & Magnetic field value at the magnetic axis & \\ 
\midrule
\multicolumn{3}{c}{\textbf{ELMs}} \\
f$_{ELM}$    & ELM frequency & Hz \\
ELM type     & ELM type & \\
W$_{ELM}$    & ELM energy loss & J \\
$\tau_{ELM}$ & Time length for the ELM to collapse & s \\ 
\midrule
\multicolumn{3}{c}{\textbf{Global parameters to store}} \\
I$_p$      & Plasma current & A \\
B$_t$      & Toroidal field & T \\
P$_{NBI}$  & NBI power & W \\
P$_{ICRH}$ & Ion Cyclotron Resonance Heating (not available at TCV) & W \\
P$_{ECRH}$ & Electron Cyclotron Resonance Heating & W \\
P$_\Omega$ & Ohmic power & W \\
P$_{tot}$  & (Total power)-(NBI shine through(complex to calculate)) - (dW/dt) & W \\
P$_{rad}$  & Radiative power & W \\
W$_{MHD}$  & MHD energy & J \\
W$_{dia}$  & Diamagnetic energy & J \\
$\beta_{N/p,global,MHD/dia}$ & Global confinement parameter both normal (N) and poloidal (p) from MHD or diamagnetic calculations & \\
L$_{i,MHD,dia}$ & Internal inductance form MHD or diamagnetic calculations & H \\
$\tau_e$ & Energy confinement time & s \\
ngw & Greenwald density & \\
n$_{e.l.a}$ & Line averaged electron density & m$^{-3}$ \\
H$_{98}$ & H$_{98}$IPB(y,2) & \\
$\tau_e{e,IPB98(y,2)}$ & Energy confinement time from the scaling law IPB98(y,2) & s \\
Main ion & Main ion (H,D,T,He,H-D,D-T) & string \\
M$_{eff}$ & effective mass & \\
H$_{rate}$ & Hydrogen puff rate & e/s \\
D$_{rate}$ & Dueterium puff rate & e/s \\
He$_{rate}$ & Helium puff rate & e/s \\
T$_{rate}$ & Tritium puff rate & e/s \\
Imp$_{seeding1}$ & Seeded specie 1 & string \\
Imp$_{seeding2}$ & Seeded specie 2 & string \\
Imp$_{seeding1}$ rate & Specie 1 puff rate & string \\
Imp$_{seeding2}$ rate & Specie 2 puff rate & string \\
Z$_{eff,line}$ & Line integrated Z$_{eff}$ & \\
W$_{th,tot}$ & Total thermal store energy & J \\
W$_{fast}$ & Fast particle enrgy & J \\
$\beta_{N,th}$ & total thermal $\beta_N$ & \\ 
\midrule
\multicolumn{3}{c}{\textbf{Equilibrium}} \\
$\psi_{pol,norm,r}$ & Normalized flux coordinate $\psi$ vs radius at z=Z$_{mag}$ & \\
r$_{zmag}$ & radial basis for $\psi_{pol,norm,r}$ & \\
r$_{mid,profile}$ & Midplane radius vs normalized $\psi_{pol}$ & \\
V$_{profile}$    & Volume vs normalized $\psi_{pol}$ & \\
FF'$_{profile}$  & FF' vs normalized $\psi_{pol}$ & \\
p'$_{profile}$   & p' vs normalized $\psi_{pol}$ & \\
q$_{profile}$    & q vs normalized $\psi_{pol}$ & \\
shear profile    & shear profile & \\
q$_{min}$        & min value of the safety factor & \\
$\psi_{axis}$    & $\psi_{pol}$ value at the axis & \\
$\psi_{sep}$     & $\psi_{pol}$ value at the separatrix & \\
$\delta_{upper}$ & Upper triangularity & \\
$\delta_{lower}$ & Lower triangularity & \\
$\kappa$         & Elongation & \\
Divertor Geometry & Divertor geometry (In this thesis, LSN) & string \\
Strike point & Position of the strike point & string \\
r$_{outer}$ & r coordinate of the outer strike point & m \\
z$_{outer}$ & z coordinate of the outer strike point & m \\
r$_{inner}$ & r coordinate of the inner strike point & m \\
z$_{inner}$ & z coordinate of the inner strike point & m \\
R$_{mag}$ & r coordinate of the magnetic axis & m \\
Z$_{mag}$ & z coordinate of the magnetic axis & m \\
R$_{geo}$ & r coordinate of the geometric axis & m \\
Z$_{geo}$ & z coordinate of the geometric axis & m \\
a         & Minor radius & m \\
$\psi_{grid}$ & Matrix for the $\psi$ grid & m$\times$m\\
r$_{\psi,grid}$ & r for the $\psi$ grid & m \\
z$_{\psi,grid}$ & z for the $\psi$ grid & m \\
\bottomrule % <=========================================================
\end{tabularx}
\label{label}

\end{document}

得到结果:

在此处输入图片描述

下一页:

在此处输入图片描述

相关内容