在Latex中的\ textwidth中安装一个表

时间:2015-03-30 14:13:12

标签: latex

我的表格比文档的\ textwidth宽。 (我不想改变\ textwidth。) 我想通过包装最后一个(最右列)列的文本来强制将表安装在\ textwidth中。 这是我的表格代码:

\begin{table*}[!t]
\caption{Extracted Features used in Meta-Learning} \label{sample-features}
\label{tbl:features}
\begin{center}
\begin{tabular*}{0.95\textwidth,center}{|l||l|}
{\textbf{FEATURE}}  &{\textbf{DESCRIPTION}} \\
\hline \\
n.examples & Number of examples \\
n.attrs & Number of attributes \\
prop.symbolic.attrs & Proportion of symbolic attributes \\
prop.missing.values & Proportion of missing values \\
class.entropy & Class entropy \\
avg.mutual.information & Average mutual information \\
prop.h.outlier & Proportion of continuous attributes with outliers \\
avg.attr.entropy & Average attribute entropy \\
avg.symb.pair.mutual.infor & Average mutual information between pairs of symbolic attributes \\
avg.abs.attr.correlation & Average absolute correlation between continuous attributes \\
avg.skewness & Mean skewness of attributes \\
avg.abs.skewness & Mean absolute skewness of attributes \\
avg.kurtosis & Mean kurtosis of attributes \\
canonical.correlation.best.linear.combination & Canonical correlation of the best linear combination of attributes to distinguish between classes \\
relative.prop.best.linear.combination & Proportion of the total discrimination power explained by the best linear combination \\
\end{tabular*}
\end{center}
\end{table*}

此代码的结果如下:

Latex results

红线右侧的部分(由我自己添加)应该包裹起来。

任何帮助?

1 个答案:

答案 0 :(得分:0)

这是答案。我希望它可以帮到你:

使用包tabularx如下:

\usepackage{tabularx,booktabs}
.
.
.
\begin{table*}[!t]
\caption{Caption}
\label{tbl:tbl}
\centering
\begin{tabularx}{\textwidth}{X X}
\toprule
Item 1 & Item 2 \\
\midrule
Item 1 description & Item 2 description \\
.
.
.
\bottomrule
\end{tabularx}
\end{table*}

就我而言,解决方案如下:

\begin{table*}[!t]
\caption{Extracted Features used in Meta-Learning} \label{sample-features}
\label{tbl:features}
\centering
\begin{tabularx}{0.95\textwidth}{|X||X|}
\toprule
{\textbf{FEATURE}}  &{\textbf{DESCRIPTION}} \\
\midrule
n.examples & Number of examples \\
n.attrs & Number of attributes \\
prop.symbolic.attrs & Proportion of symbolic attributes \\
prop.missing.values & Proportion of missing values \\
class.entropy & Class entropy \\
avg.mutual.information & Average mutual information \\
prop.h.outlier & Proportion of continuous attributes with outliers \\
avg.attr.entropy & Average attribute entropy \\
avg.symb.pair.mutual.infor & Average mutual information between pairs of symbolic attributes \\
avg.abs.attr.correlation & Average absolute correlation between continuous attributes \\
avg.skewness & Mean skewness of attributes \\
avg.abs.skewness & Mean absolute skewness of attributes \\
avg.kurtosis & Mean kurtosis of attributes \\
canonical.correlation.best.linear.combination & Canonical correlation of the best linear combination of attributes to distinguish between classes \\
relative.prop.best.linear.combination & Proportion of the total discrimination power explained by the best linear combination \\
\bottomrule
\end{tabularx}
\end{table*}