【问题标题】:Making self-adjusting table in latex用乳胶制作自调表
【发布时间】:2019-01-02 07:00:45
【问题描述】:

我正在尝试在乳胶中创建自调整表。这将是一张大桌子,所以如果空间不足,我需要文本转到下一行,但我无法做到这一点。我需要有 5 列。 下面是我管理的图像,但“描述”现在进入下一个单元格。如果有人能告诉我哪里出错了,我将不胜感激。我花了很多时间在这上面

我正在使用的代码,

    \begin{table}[h]
\begin{tabularx}{\textwidth}{|l|X|X|X|X|}
\hline
Author & Clustering Technique & Dataset & Description & Industry\\
\hline
\citeauthor{shen2009study} & Quantiles & Customer and Transaction Department store & RFM; Customer Lifetime Value; Target Marketing; Data Mining 
 &  Retail Store \\ 
 \hline
\citeauthor{aggelis2005customer} & Quantiles & E-Banking Dataset & Data Mining; e-banking; RFM analysis & Banking\\

\hline
\end{tabularx}
\end{table}

编辑:我还需要它来适应一页或能够在下一页继续。

【问题讨论】:

  • 你能发布你的序言吗?所以我们知道页面的宽度等。(MWE)

标签: latex tabular


【解决方案1】:

为避免侵入下一个单元格,您可以通过建议description 的可能断字点来帮助乳胶

\documentclass{book}
\usepackage{tabularx}

\begin{document}


    \begin{table}[h]
\begin{tabularx}{\textwidth}{|l|X|X|X|X|}
\hline
Author & Clustering Technique & Dataset & De\-scrip\-tion & Industry\\
\hline
xxx & Quantiles & Customer and Transaction Department store & RFM; Customer Lifetime Value; Target Marketing; Data Mining 
 &  Retail Store \\ 
 \hline
xxxxxx xxx xxxx xxxxxx xxx & Quantiles & E-Banking Dataset & Data Mining; e-banking; RFM analysis & Banking\\
\hline
\end{tabularx}
\end{table}


\end{document}

(如果您需要表格允许分页,请改用xltabular 包)

【讨论】:

    【解决方案2】:

    很晚的答案...

    要调整我使用p{.1\textwidth} 的列宽,这是段落对齐,列宽等于0.1 乘以正文宽度(或其他部分它)。

    为了让表格在下一页继续,如有必要,我使用了package with the same name中的极好的环境longtable

    \documentclass{article}
    \usepackage{longtable,natbib}
    
    \begin{document}
    
    \begin{longtable}{|p{.1\textwidth}|p{.15\textwidth}|p{.25\textwidth}|p{.3\textwidth}|p{.15\textwidth}|}
    %\caption[Short caption]{Full caption}\label{longt}\\
    \hline
    % content of first header
    Author & Clustering Technique & Dataset & Description & Industry\\
    \hline
    \endfirsthead
    % content of following headers if the table continues in other page(s)
    Author & Clustering Technique & Dataset & Description & Industry\\
    \hline
    \endhead
    % content of all footers
    \hline
    \endfoot
    % content of last footer
    \hline
    \endlastfoot
    \citeauthor{shen2009study} & Quantiles & Customer and Transaction Department store & RFM; Customer Lifetime Value; Target Marketing; Data Mining & Retail Store\\ 
    \hline
    \citeauthor{aggelis2005customer} & Quantiles & E-Banking Dataset & Data Mining; e-banking; RFM analysis & Banking\\
    \end{longtable}
    
    \end{document}
    

    上面代码的输出:

    【讨论】:

      猜你喜欢
      • 2011-01-09
      • 2023-03-13
      • 1970-01-01
      • 2010-09-23
      • 2011-07-24
      • 2017-07-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多