
簡單的程式碼(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}