长表中的多列文本换行

长表中的多列文本换行

我需要 longtable 或其他包中的表格,我需要列标题、功能和亮点以及数据集。以下代码生成换行表,但我无法调整带文本换行的列大小以使其看起来更美观。请查看本文底部的附加图片。

现在所有列的大小都相同,但想要调整列大小并换行文本,例如“功能”列需要更大。

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

在此处输入图片描述

答案1

我猜你正在寻找如下的故事:

在此处输入图片描述

为此,您的 MWE 添加了以下包:

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

完整的 MWE 是:

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

相关内容