# Ltablex errors in long and wide table

Good morning everybody.

I have an issue with trying to make a multi-page table inside my thesis by using the package ltablex. The issue is that the table doesn't continue in the next pages; the code related to the table only is more or less like this:

\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}


As i pointed out, the table is very long, and I would like the middle column to take as much space as possible.

Unfortunately, there are some cases in which the description seems to be too long and the compiler returns an error, even though the table is correctly visualized; I cannot understand why, I thought this package, with the commands specified in begin{tabularx}{...}{...} were made to adjust the text inside a column of set horizontal dimension; even if errors occur though, the pdf output gives a table like nothing happened.

However, when I reach the end of the page, it seems that the table does not want to go to the next page. So, my question is, what am I doing wrong?

I am using TeXnicCenter, version 2.02 Stable (64 bit).

I apologize in advance if I omitted something, it is my first time coding in LaTeX, of course any suggestion on the matter would be greatly appreciated :D . Have a good day.

• you have it in \begin{table} a table is a float box and never breaks over a page. – David Carlisle Mar 18 at 14:30

## 1 Answer

Well, in your table are some issues:

1. With using \usepackage{ltablex} you do not have to use environment table, it brokes the possibility of ltablex or better the called longtable to span pages.
2. I deleted the \setlength{\hsize}{.7\hsize} and \setlength{\hsize}{1.3\hsize} in your definitions for columns X
3. You should better use environment booktabs to get better horizontal lines.
4. There is a \\ missing after \caption (longtable needs this!)
5. There are some $ missing in your code (see markings <======= for code changings). So with the following corrected 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}


you get the result:

and the next page:

• Thank you very much! I am sorry if I made several stupid mistakes, but since i wrote the whole table before even knowing the existence of this package, the whole thing became uncontrollable very quickly. Again, thank you very much :D – Rov Mar 19 at 11:39