0

While transforming a simple table into a supertabuler, the compiler kept working for long minutes. After investigating, I find out that \tabcolsep into p{} might be the problem... Could you guys explain to me why it does this behaviour? Maybe it is a bad habit aswell, so tell me otherwise.

Thanks in advance!

MWE:

\documentclass{article}
\usepackage{supertabular, booktabs}

%%These packaged should not interfer imo but I let them in case it has something to do with my problem
\newcommand{\tabitem}{~~\llap{\textbullet}~~}

\usepackage{array} %% Array m option in particular (center and sized)
\usepackage{diagbox} %% Array diagonal box
\usepackage{multirow} %for multi row in table


\begin{document}
    \begin{center}    
    \tablefirsthead{%
    \toprule{}
    AI/ML Models & Prediction & Optimisation/ Automation & Analysis & Modelling/
    Simulation \\
    \midrule{}
    }
    \tablehead{%
    %\hline\multicolumn{4}{|l|}{\small\sl continued from previous page}\\
    \toprule{}
    AI/ML Models & Prediction & Optimisation/ Automation & Analysis & Modelling/
    Simulation \\
    \midrule{}
    }
    \tabletail{%
    \bottomrule{}
    }
    \tablelasttail{%
    \bottomrule{}
    }
    %%Notworking
    %\begin{supertabular}{@{}p{0.20\textwidth-\tabcolsep}p{0.22\textwidth-2\tabcolsep}p{0.20\textwidth-2\tabcolsep}p{0.18\textwidth-2\tabcolsep}p{0.20\textwidth-\tabcolsep}@{}}
    %%Working
    \begin{supertabular}{@{}p{0.20\textwidth}|r@{\hspace{5.5mm}}|r|r|r|}
    1   &     1  &        1  &           1    \\
    2   &     4  &       16  &           2    \\
    3   &     9  &       81  &           6    \\
    4   &    16  &      256  &          24    \\
    [5mm]...19  &   361  &   130321  &  1.21645100E+17\\
    20  &   400  &   160000  &  2.43290200E+18\\
    \end{supertabular}
    \end{center}
\end{document}

EDIT:

thanks to David Carlisle and this post, i updated the first MWE as follow:

\documentclass{article}
    \usepackage{supertabular, booktabs}
\newcommand{\tabitem}{~~\llap{\textbullet}~~}

\usepackage{array} %% Array m option in particular (center and sized)
\usepackage{diagbox} %% Array diagonal box
\usepackage{multirow} %for multi row in table

\begin{document}



\begin{center}
\tablefirsthead{%
\toprule{}
AI/ML Models & Prediction & Optimisation/ Automation & Analysis & Modelling/
Simulation \\ \midrule{} \\
}
\tablehead{%
%\hline\multicolumn{4}{|l|}{\small\sl continued from previous page}\\
\toprule{}
AI/ML Models & Prediction & Optimisation/ Automation & Analysis & Modelling/
Simulation \\ \midrule{} \\
}
\tabletail{%
\bottomrule{}
\multicolumn{5}{}{\small continued on next page} \\
\bottomrule{} \\
}
\tablelasttail{%
\bottomrule{} \\
}

\tablecaption{Publication Distribution with the Design Space}
\label{tab: designSpace} 

\begin{supertabular}{@{}p{\dimexpr 0.20\textwidth-\tabcolsep \relax}p{\dimexpr 0.22\textwidth-2\tabcolsep \relax}p{\dimexpr 0.20\textwidth-2\tabcolsep \relax}p{\dimexpr 0.18\textwidth-2\tabcolsep \relax}p{\dimexpr 0.20\textwidth-\tabcolsep\relax }@{}}
%\begin{supertabular}{lllll}


%\endhead
Multi-Agent System (MAS) 
&
& 
&  
& 
\\  


Evolutionary Algorithm (EA) 
&  
& 
& 
& \\

Simulated Annealing (SA) 
& 
& 
& 
& \\  

Tabu search 
& 
&  
& 
& \\  

Particle Swarm Optimisation 
& 
&  
& 
& \\  

Ant Colony Algorithm 
& 
&  
& 
& \\  

Bee Colony Algorithm
&
& 
&
& \\


Neural Network (NN) 
& 
& 
& 
& \\  

Deep Deterministic Policy Gradient (DDPG) 
& 
& 
& 
& \\  

Convolutional Neural Networks (CNN)
& 
&
&
& \\

Deep Q-Network (DQN) 
& 
&  
& 
& \\  

Deep Learning
& 
&
&
& \\
Autoencoder
& 
&
&
&  \\

Random Forest (RF) 
& 
&
& 
& \\  

Quantile Regression Forest 
&  
& 
& 
& \\   

Gradient Boosting Machine (GBM) 
& 
& 
& 
& \\  

Support Vector Machine (SVM) 
& 
&  
& 
& \\  

Decision Tree 
& 
& 
& 
&  \\  

Fuzzy Logic 
&  
& 
& 
& \\  

Linear Regression 
& 
&  
& 
&  \\  

Linear Functional Regression 
& 
& 
& 
& \\  

Linear Discriminant Analysis (LDA)
&  
& 
& 
& \\

Quadratic Discriminant Analysis (QDA)
&  
& 
& 
& \\

Logistic regression
& 
& 
& 
& \\  

Binary logistic regression models 
& 
& 
&  
& \\  

Gaussian Mixture Model 
& 
& 
& 
& \\  

Bayesian Network 
& 
& 
& 
&  \\  

Recursive Bayesian estimation 
& 
&  
& 
& \\  

k-nearest neighbor (k-NN)
& 
&
&
&\\

Genetic algorithm 
&
& 
&
& \\

Hierarchical clustering
&
&
&
& \\

Dynamic Bayesian Belief Network 
&  
& 
& 
&  \\  

BIRCH 
& 
& 
&  
& \\  

DBSCAN
& 
& 
&  
& \\  

OPTIC 
& 
& 
&  
& \\  

K-means 
& 
& 
&   
& \\  

Non Negative Matrix Factorisation (NMF) 
& 
&  
& 
& \\  

A* 
& 
& 
& 
& \\  

Multi-Layer Perceptron (MLP)
& 
& 
& 
& \\ 

Deep Reinforcement Learning
& 
& 
& 
& \\ 

Recurrent neural network \& LSTM
& 
&
&
& \\

Reinforcement Learning
& 
& 
& 
& \\ 

k-nearest neighbours (kNN)
& 
& 
& 
& \\ 

Principal Component Analysis (PCA)
& 
&
&
& \\

OPTICS clustering
&
&
&
& \\

Not referenced 
&  
&  
& 
& \\  



\end{supertabular}
\end{center}
\end{document}
7
  • 1
    p{0.20\textwidth-\tabcolsep} is a syntax error p{\dimexpr 0.20\textwidth-\tabcolsep \relax} (not related to tabcolsep in particular; the same would be true of any length expression. Commented Jul 15, 2021 at 10:30
  • So apparently, supertabular need every line to end with \\so i replaced some lines (see edit in the post). Nonetheless, with your comment i still have an error "Misplaced \noalign" on the lign \begin{supertabular}{@{}p{\dimexpr 0.20\textwidth-\tabcolsep \relax} p{\dimexpr 0.22\textwidth-2\tabcolsep \relax} p{\dimexpr 0.20\textwidth-2\tabcolsep \relax} p{\dimexpr 0.18\textwidth-2\tabcolsep \relax} p{\dimexpr 0.20\textwidth-\tabcolsep\relax }@{}}. Any idea?
    – Nitsugua
    Commented Jul 15, 2021 at 12:24
  • please do not edit solutions or partial solutions in to the question. simply make the example code in your questions be a complete small document that shows the problem. then someone can debug it for you. Commented Jul 15, 2021 at 12:29
  • To be more precise, the error happens at the begin of the supertabular, and every time the supertabular is splitted across two pages
    – Nitsugua
    Commented Jul 15, 2021 at 12:30
  • Sorry about that, not sure i understood you, did you meant having a full edited MWE after my original question or edit the first exemple completly?
    – Nitsugua
    Commented Jul 15, 2021 at 12:34

1 Answer 1

1

You have two errors the missing c column spec here

  \multicolumn{5}{}{\small continued on next page}

and the spurious {} after \toprule and friends.

This runs without error.

\documentclass{article}
    \usepackage{supertabular, booktabs}
\newcommand{\tabitem}{~~\llap{\textbullet}~~}

\usepackage{array} %% Array m option in particular (center and sized)
\usepackage{diagbox} %% Array diagonal box
\usepackage{multirow} %for multi row in table

\begin{document}



\begin{center}
\tablefirsthead{%
\toprule
AI/ML Models & Prediction & Optimisation/ Automation & Analysis & Modelling/
Simulation \\ \midrule \\
}
\tablehead{%
%\hline\multicolumn{4}{|l|}{\small\sl continued from previous page}\\
\toprule
AI/ML Models & Prediction & Optimisation/ Automation & Analysis & Modelling/
Simulation \\ \midrule \\
}
\tabletail{%
\bottomrule
\multicolumn{5}{c}{\small continued on next page} \\
\bottomrule \\
}
\tablelasttail{%
\bottomrule \\
}

\tablecaption{Publication Distribution with the Design Space}
\label{tab: designSpace} 

\begin{supertabular}{@{}p{\dimexpr 0.20\textwidth-\tabcolsep \relax}p{\dimexpr 0.22\textwidth-2\tabcolsep \relax}p{\dimexpr 0.20\textwidth-2\tabcolsep \relax}p{\dimexpr 0.18\textwidth-2\tabcolsep \relax}p{\dimexpr 0.20\textwidth-\tabcolsep\relax }@{}}
%\begin{supertabular}{lllll}


%\endhead
Multi-Agent System (MAS) 
&
& 
&  
& 
\\  


Evolutionary Algorithm (EA) 
&  
& 
& 
& \\

Simulated Annealing (SA) 
& 
& 
& 
& \\  

Tabu search 
& 
&  
& 
& \\  

Particle Swarm Optimisation 
& 
&  
& 
& \\  

Ant Colony Algorithm 
& 
&  
& 
& \\  

Bee Colony Algorithm
&
& 
&
& \\


Neural Network (NN) 
& 
& 
& 
& \\  

Deep Deterministic Policy Gradient (DDPG) 
& 
& 
& 
& \\  

Convolutional Neural Networks (CNN)
& 
&
&
& \\

Deep Q-Network (DQN) 
& 
&  
& 
& \\  

Deep Learning
& 
&
&
& \\
Autoencoder
& 
&
&
&  \\

Random Forest (RF) 
& 
&
& 
& \\  

Quantile Regression Forest 
&  
& 
& 
& \\   

Gradient Boosting Machine (GBM) 
& 
& 
& 
& \\  

Support Vector Machine (SVM) 
& 
&  
& 
& \\  

Decision Tree 
& 
& 
& 
&  \\  

Fuzzy Logic 
&  
& 
& 
& \\  

Linear Regression 
& 
&  
& 
&  \\  

Linear Functional Regression 
& 
& 
& 
& \\  

Linear Discriminant Analysis (LDA)
&  
& 
& 
& \\

Quadratic Discriminant Analysis (QDA)
&  
& 
& 
& \\

Logistic regression
& 
& 
& 
& \\  

Binary logistic regression models 
& 
& 
&  
& \\  

Gaussian Mixture Model 
& 
& 
& 
& \\  

Bayesian Network 
& 
& 
& 
&  \\  

Recursive Bayesian estimation 
& 
&  
& 
& \\  

k-nearest neighbor (k-NN)
& 
&
&
&\\

Genetic algorithm 
&
& 
&
& \\

Hierarchical clustering
&
&
&
& \\

Dynamic Bayesian Belief Network 
&  
& 
& 
&  \\  

BIRCH 
& 
& 
&  
& \\  

DBSCAN
& 
& 
&  
& \\  

OPTIC 
& 
& 
&  
& \\  

K-means 
& 
& 
&   
& \\  

Non Negative Matrix Factorisation (NMF) 
& 
&  
& 
& \\  

A* 
& 
& 
& 
& \\  

Multi-Layer Perceptron (MLP)
& 
& 
& 
& \\ 

Deep Reinforcement Learning
& 
& 
& 
& \\ 

Recurrent neural network \& LSTM
& 
&
&
& \\

Reinforcement Learning
& 
& 
& 
& \\ 

k-nearest neighbours (kNN)
& 
& 
& 
& \\ 

Principal Component Analysis (PCA)
& 
&
&
& \\

OPTICS clustering
&
&
&
& \\

Not referenced 
&  
&  
& 
& \\  



\end{supertabular}
\end{center}
\end{document}
3
  • Thanks a lot, it have been really helpfull. Two questions, 1) why \toprule{} is provoking errors, and 2) in twocolum what would be the best way to have the supertable not be break between the twocolumns? For tabular, it would be tabular*, but here supertabular* have a strange behaviour for me...
    – Nitsugua
    Commented Jul 15, 2021 at 13:25
  • 1
    the {} is coming in front of \multicolumn which never works, \multicolumn must be the first thing in its cell. @adegas Commented Jul 15, 2021 at 13:58
  • Thank you for your answers! For other interested in the second question, made a new post for it: tex.stackexchange.com/questions/605230/….
    – Nitsugua
    Commented Jul 22, 2021 at 9:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .