我收到“坏盒子”警告,上面写着“!h”
Underfull \hbox (badness 10000) in paragraph
Underfull \hbox (badness 10000) in paragraph
Underfull \hbox (badness 10000) in paragraph
Underfull \hbox (badness 2707) in paragraph
源代码是
\begin{table}[!ht]
\caption{Comparison of design requirements for adults and children}
\footnotesize
\begin{center}
\begin{tabular}{|p{0.2\linewidth}|p{0.35\linewidth}|p{0.35\linewidth}|}
\hline \centering{Message} & \centering{Adults} & \centering{Children} \tabularnewline
\hline *M1-constraint-requirement-requirement-summary & ``The target user is an \textbf{adult}. Constraints - Ergonomics can be found in standard \textbf{XX1}.''& ``The target user is a \textbf{child}. Constraints - Ergonomics can be found in standard \textbf{XX2}.'' \tabularnewline
\hline
\end{tabular}
\end{center}
\end{table}
它看起来像这样
我不知道我的情况出了什么问题。
答案1
第二行第一个单元格的行没有填充hbox
-es(3 个坏框)。第三行也是一样,一行(1 个坏框)。使用\raggedright
可以让这些坏框消失,而不会真正改变输出。这是因为框很小但单词很长:当每行只有 1 个单词时,您实际上无法使用对齐。(如果每行只有几个单词,您可以尝试\sloppy
。)
最后一个坏框是由于您的表格比实际的要大\hsize
。这是因为它比列宽的总和要宽。使用该showframe
包,您可以在下面的示例中清楚地看到这一点(\raggedright
已添加,剩余 1 个坏框)。您可以通过调整列大小或更改列分隔(或检查这个话题)。
\documentclass{article}
\usepackage{showframe}
\begin{document}
\begin{table}[!ht]
\caption{Comparison of design requirements for adults and children}
\footnotesize
\begin{center}
\begin{tabular}{|p{0.2\textwidth}|p{0.35\textwidth}|p{0.35\textwidth}|}
\hline \centering{Message} & \centering{Adults} & \centering{Children} \tabularnewline
\hline \raggedright*M1-constraint-requirement-requirement-summary & \raggedright``The target user is an \textbf{adult}. Constraints - Ergonomics can be found in standard \textbf{XX1}.''& \raggedright``The target user is a \textbf{child}. Constraints - Ergonomics can be found in standard \textbf{XX2}.'' \tabularnewline
\hline
\end{tabular}
\end{center}
\end{table}
\end{document}