![Ltablex-Fehler in langen und breiten Tabellen](https://rvso.com/image/392349/Ltablex-Fehler%20in%20langen%20und%20breiten%20Tabellen.png)
Guten Morgen zusammen.
Ich habe ein Problem beim Versuch, mithilfe des Pakets eine mehrseitige Tabelle in meiner Abschlussarbeit zu erstellen ltablex
. Das Problem besteht darin, dass die Tabelle auf den nächsten Seiten nicht fortgesetzt wird. Der Code, der sich nur auf die Tabelle bezieht, sieht mehr oder weniger so aus:
\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}
Wie ich bereits erwähnt habe, ist die Tabelle sehr lang und ich möchte, dass die mittlere Spalte möglichst viel Platz einnimmt.
Leider gibt es einige Fälle, in denen die Beschreibung zu lang zu sein scheint und der Compiler einen Fehler zurückgibt, obwohl die Tabelle korrekt visualisiert wird. Ich kann nicht verstehen, warum. Ich dachte, dieses Paket mit den in `begin{tabularx}{...}{...}` angegebenen Befehlen wurde erstellt, um den Text innerhalb einer Spalte mit festgelegter horizontaler Dimension anzupassen. Selbst wenn Fehler auftreten, gibt die PDF-Ausgabe eine Tabelle aus, als wäre nichts passiert.
Wenn ich jedoch das Ende der Seite erreiche, scheint die Tabelle nicht auf die nächste Seite wechseln zu wollen. Meine Frage ist also: Was mache ich falsch?
Ich verwende TeXnicCenter, Version 2.02 stabil (64 Bit).
Ich entschuldige mich im Voraus, wenn ich etwas ausgelassen habe. Es ist mein erstes Mal, dass ich in LaTeX programmiere. Natürlich wäre ich für jeden Vorschlag diesbezüglich sehr dankbar :D. Ich wünsche Ihnen einen schönen Tag.
Antwort1
Nun, in Ihrer Tabelle sind einige Probleme:
- Bei Verwendung
\usepackage{ltablex}
müssen Sie die Umgebung nicht verwendentable
, da dies die Möglichkeit unterbrichtltablex
oder besser noch die aufgerufenenlongtable
Seiten überspannt. - Ich habe das „
\setlength{\hsize}{.7\hsize}
und“\setlength{\hsize}{1.3\hsize}
in Ihren Definitionen für Spalten gelöschtX
- Sie sollten die Umgebung besser nutzen,
booktabs
um bessere horizontale Linien zu erhalten. - Es fehlt ein
\\
Nachher\caption
(longtable
dieses wird benötigt!) $
In Ihrem Code fehlen einige Elemente (siehe Markierungen<=======
für Codeänderungen).
Mit dem folgenden korrigierten Code
\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}
Sie erhalten das Ergebnis:
und die nächste Seite: