未满 \hbox badness 10000 \textbf

未满 \hbox badness 10000 \textbf

简单代码(LaTeX 的新功能)。收到以下错误:

Underfull \hbox (badness 10000) in paragraph at lines 13--14
Underfull \hbox (badness 10000) in paragraph at lines 15--26
Underfull \hbox (badness 10000) in paragraph at lines 15--26
Underfull \hbox (badness 10000) in paragraph at lines 15--26
Underfull \hbox (badness 10000) in paragraph at lines 27--28

这是代码

\documentclass[11pt]{article}

\usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}
\usepackage{verbatim}

\begin{document}

\title{Homework 1}
\author{Joshua Hazel}
\date{\today}
\maketitle

\textbf{2.3 Suppose that the values for a given set of data are grouped into intervals.  The intervals and corresponding frequencies are as follows:} \\ 

\indent
\begin{tabular}
{|l r|} \hline
age & frequency \\ \hline
1-5 & 200 \\
6-15 & 450 \\
16-20 & 300 \\
21-50 & 1500 \\
51-80 & 700 \\
81-110 & 44 \\ \hline
\end{tabular} \\ \\ \\

\textbf{Compute an \textit{approximate median} value for the data.}\\

My answer here.

\end{document}

行号指向我使用 \textbf 的两个部分,另一个指向表格的开始/结束。

代码有什么问题?

答案1

您应该尽量避免在文档中出现明确的间距,标记文档结构,然后全局安排结构元素的正确布局。

类似这样的情况可能更接近(并且不会产生任何警告)

在此处输入图片描述

\documentclass[11pt]{article}

\usepackage[margin=1in]{geometry}
\usepackage{verbatim}
\usepackage{parskip}
\setlength\parskip{\baselineskip}
\setlength\parindent{0pt}

\begin{document}

\title{Homework 1}
\author{Joshua Hazel}
\date{\today}
\maketitle
\setcounter{section}{2}
\setcounter{subsection}{2}

\subsection{Suppose that the values for a given set of data are grouped into intervals.  The intervals and corresponding frequencies are as follows:}


\begin{tabular}
{|l r|} \hline
age & frequency \\ \hline
1-5 & 200 \\
6-15 & 450 \\
16-20 & 300 \\
21-50 & 1500 \\
51-80 & 700 \\
81-110 & 44 \\ \hline
\end{tabular}

\textbf{Compute an \textit{approximate median} value for the data.}

My answer here.

\end{document}

相关内容