\documentclass[]{scrbook}
\usepackage{tabularx}
\begin{document}
\begin{table}[t]
\caption{Scores of the individual metrics}
\begin{tabularx}{\columnwidth}{p{0.118\textwidth} p{0.1312\textwidth} p{0.1\textwidth} p{0.119\textwidth} >{\raggedright\arraybackslash}X >{\raggedright\arraybackslash}X >{\raggedright\arraybackslash}X}
Metric & Name & Raw score & Normalized score & Min value & Max value & Goal \\
Logistic Detection & Logistic Regression Detection & 0.0298 & 0.0298 & 0.0000 & 1.0000 & MAXIMIZE \\
SVC Detection & SVC Detection & 0.0217 & 0.0217 & 0.0000 & 1.0000 & MAXIMIZE \\
GM Log Likelihood & Gaussian Mixture Log Likelihood & -177.0716 & 0.0000 & -inf & inf & MAXIMIZE \\
CS Test & Chi-Squared & 0.3141 & 0.3141 & 0.0000 & 1.0000 & MAXIMIZE \\
KS Test & Inverted Kolmogorov-Smirnov D statistic & 0.6796 & 0.6796 & 0.0000 & 1.0000 & MAXIMIZE \\
KS Test Extended & Inverted Kolmogorov-Smirnov D statistic & 0.6971 & 0.6971 & 0.0000 & 1.0000 & MAXIMIZE \\
Continuous KL Divergence & Continuous Kullback–Leibler Divergence & 0.4036 & 0.4036 & 0.0000 & 1.0000 & MAXIMIZE \\
Discrete KL Divergence & Discrete Kullback–Leibler Divergence & 0.1507 & 0.1507 & 0.0000 & 1.0000 & MAXIMIZE
\end{tabularx}
\end{table}
\end{document}
我尝试了几个小时才让这张表看起来正常而没有任何警告,但我无法弄清楚如何......
答案1
它警告你,第一列的文本空间过长
像后面的列一样设置这个 raggedright:
我稍微缩短了标题,没有收到任何警告
\documentclass[]{scrbook}
\usepackage{tabularx}
\begin{document}
\begin{table}[t]
\caption{Scores of the individual metrics}
\setlength\tabcolsep{4pt}
\begin{tabularx}{\columnwidth}{
@{}
>{\raggedright}p{0.14\textwidth}
>{\raggedright}X
>{\raggedright}p{0.1\textwidth}
>{\raggedright}p{0.119\textwidth}
l
l
l
@{}}
Metric & Name & Raw score & Norm.\ score & Min& Max & Goal \\
Logistic Detection & Logistic Regression Detection & 0.0298 & 0.0298 & 0.0000 & 1.0000 & MAXIMIZE \\
SVC Detection & SVC Detection & 0.0217 & 0.0217 & 0.0000 & 1.0000 & MAXIMIZE \\
GM Log Likelihood & Gaussian Mixture Log Likelihood & -177.0716 & 0.0000 & -inf & inf & MAXIMIZE \\
CS Test & Chi-Squared & 0.3141 & 0.3141 & 0.0000 & 1.0000 & MAXIMIZE \\
KS Test & Inverted Kolmogorov-Smirnov D statistic & 0.6796 & 0.6796 & 0.0000 & 1.0000 & MAXIMIZE \\
KS Test Extended & Inverted Kolmogorov-Smirnov D statistic & 0.6971 & 0.6971 & 0.0000 & 1.0000 & MAXIMIZE \\
Continuous KL Divergence & Continuous Kullback–Leibler Divergence & 0.4036 & 0.4036 & 0.0000 & 1.0000 & MAXIMIZE \\
Discrete KL Divergence & Discrete Kullback–Leibler Divergence & 0.1507 & 0.1507 & 0.0000 & 1.0000 & MAXIMIZE
\end{tabularx}
\end{table}
\end{document}