1

I need a table from the longtable or other package I need columns Titles, Features and highlights and Dataset. Following code generates the wrapped table but I cannot resize the column with text wraps to make it look nicer. Please take a look into to attached image at the bottom of this.

Right now all the columns are of same size but wanted to resize the columns and wrap the text for instance Features column needs to be bigger.

\documentclass{article}
\usepackage{longtable}
\usepackage{array} 
\usepackage{amssymb}
\usepackage{xltabular}

\begin{center}
        \begin{longtable}
        {@{}
        >{\raggedright}p{1.5in}
        p{6.5cm}
        >{\raggedleft}p{}@{1.5cm}
        >{\raggedright}p{0.5cm}
        p{3.5in}
        @{}}

        \caption{Previous Studies} \label{grid_mlmmh} \\

        \hline 

        \multicolumn{1}{c}{\textbf{Studies(s)}} & \multicolumn{2}{c}{\textbf{Features and Highlights}} & 
        \multicolumn{2}{c}{\textbf{Dataset}}\\ 

        \hline 
        \endfirsthead

        \multicolumn{3}{c}%

        {{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
        \hline 
         \multicolumn{1}{c}{\textbf{Studies(s)}} & \multicolumn{1}{c}{\textbf{Features and Highlights}} & 
        \multicolumn{2}{c}{\textbf{Dataset}}\\ 
        \endhead

        \hline \multicolumn{3}{r}{{Continued on next page}} \hline
        \endfoot

        \hline \hline
        \endlastfoot
        \textbf{General Introduction}\\

        \cite{Baldominos2019}& Dataset 1998 & Comparative Study \\


        \cite{LeCunn1998} & Dataset & Multilayer Perceptron \\ \\
        LeCun, et. al. \cite{Y.LeCun1998}& 1998 & Introduction of Dataset \\

        \hline
        \textbf{Survey} \\

        \cite{Bianchini2006} Survey 
        \cite{Cai2018}, \cite{Goyal2018},  \cite{Cui2019}& comprehensive surveys on graph, network embeddings: (node clustering,  node recommendation, link prediction, graph classification, visualization, systematic taxonomization), graph reconstruction and support network inference,  survey of related studies &
        BlogCatalog, Flicker, Twitter, DBLP, Cora, Citeseer, ArXiv, Biological, etc\\

        \textbf{Recurrent Graph Neural Networks(RecGNNs)}\\

        \textbf{Studies}: \cite{Scarselli2009}, \cite{Gallicchio2010}, \cite{Li2016},\cite{Dai2018}&
        - Iterative information propagation from target node into neighbors 
        - Recursion and iteration, subgraph matching, the mutagenesis, ranking &
        MNIST, Facebook Entity Relaionships\\

        \textbf{Convolutional Graph Neural Netoworks(ConvGNNs)} \\

        - \textbf{Spectral-based Approaches (spectral graph theory)} \\
        \textbf{Studies}: \cite{Bruna2014}, \cite{Defferrard2016}, \cite{Kipf2017}, \cite{Li2018}, \cite{Z}&
        &
        - Spectral formulation, Strictly localized filters, low computational complexity, efficient pooling,
        - Features of Geometric Properties to low-dimensional grid structure (eg data of social networks, collaborative filtering)
        - general non-Euclidean domains (eg unstructured text data) 
        - Graph Estimation procedures &
        MNIST, 20NEWS, Citation Networks (eg PubMed, CiteSeer) \\

        - \textbf{Spatial-based Approaches}\\
        \textbf{Studies: } \cite{Micheli2009}, \cite{Atwood2016}, \cite{Niepert2016}, \cite{Hamilton2017}, \cite{Gao2018}, \cite{Tran2019}&
        \textbf{Features: }\\
        - cascade correlation, recursive neural networks, learning in strctured domains\\
        - graph diffusion, normalization of graph structure, \\
        \textbf{Example Dataset: } Quantitative structure-property
        relationship (QSPR)  of Alkanes, CORA and Pubmed, \\power grid system in the USA, email-enron \\
        \hline

        \textbf{Graph Autoencoders(GAEs)}\\
        \textbf{Studies: }\\
        \textbf{Features: }\\
        \textbf{Example Dataset: }\\
        \hline

        \textbf{Spatial-temporal Graph Neural Networks(STGNNs)} \\
        \hline




        \end{longtable}
\end{center}

enter image description here

14
  • Please make your code compilable by adding the documentclass as well as the relevant packages.
    – leandriis
    Apr 18 '20 at 20:01
  • >{\raggedleft}p{}@{1.5cm} is not correct because the p type column needs a width as argument. Also, add \arraybackslash as in \raggedleft\arraybackslash. The same applies to \raggedright and \centering. And remove the @{1.5cm}.
    – leandriis
    Apr 18 '20 at 20:04
  • Also, remove the center environment around the longtable. Longtables are horizontally centerd by default.
    – leandriis
    Apr 18 '20 at 20:05
  • A \\ is missing after \multicolumn{3}{r}{Continued on next page}.
    – leandriis
    Apr 18 '20 at 20:07
  • @leandriis also the center environment would not center longtable anyway as it is full width, flushleft or flushright environments are similar but they would not change the centred alignment of the table. Apr 18 '20 at 20:18
1

I guessing, that you looking for tale like the following:

enter image description here

For it are to your MWE are added the following packages:

\usepackage{geometry}
\usepackage{ragged2e}
\usepackage{booktabs, makecell}
\usepackage{enumitem}
\usepackage{microtype}

Complete MWE is:

\documentclass{article}
\usepackage{geometry}
\usepackage{ragged2e}
\usepackage{booktabs, makecell, xltabular}
\renewcommand\theadfont{\small\bfseries}
\renewcommand\theadgape{}
\newcolumntype{L}[1]{>{\RaggedRight%
                       \hsize=#1\hsize%                
                       \linewidth=\hsize}X}
\usepackage{enumitem}

\usepackage{microtype}

\begin{document}
\begingroup
\setlist[itemize]{nosep,
                  label=\textbullet,
                  wide,
                  after={\end{minipage}},
                  before={\begin{minipage}[t]{\linewidth}}
                  }
    \begin{xltabular}{\linewidth}{@{} L{0.6}
  >{\hsize=1.2\hsize\linewidth=\hsize}X
                                      L{1.2} 
                                  @{}}
\caption{Previous Studies} 
\label{grid_mlmmh} \\
    \toprule
\thead{Studies(s)}  
    &   \thead{Features and Highlights}
        &   \thead{Dataset}                                         \\
    \midrule
\endfirsthead
\caption[]{Previous Studies -- continued from previous page}        \\
\thead{Studies(s)}
    &   \thead{Features and Highlights}
        &   \thead{Dataset}                                         \\
    \midrule
\endhead
    \multicolumn{3}{r}{\small\itshape{Continued on next page}}      \\
\endfoot
    \bottomrule
\endlastfoot
% table body
\textbf{Survey}         &   &                                       \\
\cite{Bianchini2006}, \cite{Cai2018}, \cite{Goyal2018}, \cite{Cui2019}
    &   comprehensive surveys on graph, network embeddings: (node clustering,  node recommendation, link prediction, graph classification, visualization, systematic taxonomization), graph reconstruction and support network inference,  survey of related studies
        &   BlogCatalog, Flicker, Twitter, DBLP, Cora, 
            Citeseer, ArXiv, Biological, etc                        \\
    \addlinespace
\multicolumn{3}{l}{%
    \thead{Recurrent Graph Neural Networks(RecGNNs)}}               \\
\textbf{Studies}:       &   &                                       \\
\cite{Scarselli2009}, \cite{Gallicchio2010}, \cite{Li2016}, \cite{Dai2018}
    &   \begin{itemize}
    \item   Iterative information propagation from target node into neighbors
    \item   Recursion and iteration, subgraph matching, the mutagenesis, ranking
        \end{itemize}
        &   MNIST, Facebook Entity Relaionships                     \\
    \addlinespace
\multicolumn{3}{l}{%
    \thead{Convolutional Graph Neural Netoworks(ConvGNNs)}}         \\
    \addlinespace
\multicolumn{3}{l}{%
    \thead{Spectral-based Approaches (spectral graph theory)}}      \\
\textbf{Studies}:       &   &                                       \\
\cite{Bruna2014}, \cite{Defferrard2016}, \cite{Kipf2017}, \cite{Li2018}, \cite{Z}
    & \begin{itemize}
    \item   Spectral formulation, Strictly localized filters, low computational complexity, efficient pooling,
    \item   Features of Geometric Properties to low-dimensional grid structure (eg data of social networks, collaborative filtering)
    \item   general non-Euclidean domains (eg unstructured text data)
    \item   Graph Estimation procedures
            \end{itemize}
        &   MNIST, 20NEWS, Citation Networks (eg PubMed, CiteSeer) \\
    \end{xltabular}
\endgroup
\end{document}
3
  • for some reason this code did not compile in overleaf
    – lpt
    Apr 19 '20 at 15:32
  • @lpt, oh Overleaf .... it seems that it hasn't installed xltabular package ... you need ask Ovewrleaf maintainers for help. I don't use them, so I can't help you in this matter.
    – Zarko
    Apr 19 '20 at 15:42
  • Ah okay, I will tag Overleaf if they can advise
    – lpt
    Apr 19 '20 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.