我阅读了有关错误消息的所有问题 Underfull \hbox (badness 10000) in paragraph at lines
,但我仍然不确定我的代码是否正确。问题出在表格的制表符上。
当我查看 pdf 时,我注意到第一个原始文件(标题)占用了多行,并且一些单词被截断了,这是我所期望的行为。所以,我的问题是,我应该忽略这些警告还是应该修复某些问题?
重现代码:
\documentclass{article}
% Tables
\usepackage{pdfpages}
\usepackage{longtable}
\usepackage{array} % for extrarowheight
\usepackage[table]{xcolor}
\usepackage{tabularx}
\usepackage{ifthen}
\usepackage{xspace}
%\setlength{\extrarowheight}{1pt}
%\setlength{\tabcolsep}{1em}
\rowcolors{1}{black!10}{}
\newboolean{nextRetrait}
%\setboolean{french}{false}
\setboolean{nextRetrait}{false}
\newcommand{\retrait}
{\ifthenelse{\boolean{nextRetrait}}%
{\hspace{-3cm}}%
{}}%
\begin{document}
\begin{center}
\begin{table*}[!ht]
{\small
\hfill{}
\centering
\scalebox{0.8}{
\retrait\begin{tabular}{|p{1.8cm}|p{1.2cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.4cm}|p{1.4cm}|p{1.4cm}|p{1.4cm}|p{0.6cm}|}
\hline
\textbf{Application (swap unit)}
&\textbf{Size (MB) before swapping}
&\textbf{Objects before swapping}
&\textbf{Size (MB) after swapping}
&\textbf{Objects after swapping}
&\textbf{Size (MB) after experiments}
&\textbf{Objects after experiments}
&\textbf{Average objects per graph}
&\textbf{Average \% of shared objects per graph}
&\textbf{Gain}
\\
\hline
XXX (class) & 22.7 & 469882 & 10.6 & 254696 & 13.8 & 317107 & 170 &17\% & 40\% \\
\hline
\end{tabular}}}
\hfill{}
\caption{XXX}
\label{tb:XXX}
\end{table*}
\end{center}
\end{document}
警告如下:
Overfull \hbox (2.82243pt too wide) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Application
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 (swap
Underfull \hbox (badness 10000) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Size
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 (MB)
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 be-fore
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 swap-
Underfull \hbox (badness 10000) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Objects
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 be-fore
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 swap-
Underfull \hbox (badness 10000) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Size
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 (MB)
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 af-ter
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 swap-
Underfull \hbox (badness 10000) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Objects
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 af-ter
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 swap-
Underfull \hbox (badness 10000) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Size
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 (MB)
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 af-ter
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 ex-per-i-
Underfull \hbox (badness 10000) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Objects
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 af-ter
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 ex-per-i-
Underfull \hbox (badness 10000) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Average
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 ob-jects
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 per
Underfull \hbox (badness 10000) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Average
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 % of
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 shared
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 ob-jects
Underfull \hbox (badness 10000) in paragraph at lines 49--49
\OT1/cmr/bx/n/9 per
Overfull \hbox (5.3494pt too wide) in paragraph at lines 49--49
[]|\OT1/cmr/bx/n/9 Gain|
Overfull \hbox (57.22829pt too wide) in paragraph at lines 30--51
[] []
Underfull \hbox (badness 10000) in paragraph at lines 30--51
答案1
你可能想把标题设置得不对:比如说
\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}
在你的序言中并使用
\begin{tabular}{|P{1.8cm}|P{1.2cm}|P{1.3cm}|P{1.3cm}|P{1.3cm}|P{1.4cm}|P{1.4cm}|P{1.4cm}|P{1.4cm}|P{0.6cm}|}
您必须微调宽度,因为“应用”和“增益”并不真正合适。