Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Simple code (new to LaTeX). Receiving these errors:

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

Here is code

\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}

The line numbers are pointing to the 2 sections where i used \textbf and the other is pointing to the start/end of the tabular.

What is wrong with the code?

share|improve this question
5  
Welcome to TeX.sx! Don't use \\ for "leaving an empty line" –  egreg Apr 14 '13 at 20:43
4  
delete the \\ at the ends of your paragraphs. They just cause an empty spurious "underfull" line and a warning message. –  David Carlisle Apr 14 '13 at 20:43
    
Since you have the same margin all the way around, you can use \usepackage[margin=1in]{geometry}. –  Svend Tveskæg Apr 14 '13 at 20:48
    
@egreg Thanks that works - what is the appropriate method to add some extra spacing before and after the table so it doesnt look odd? –  Kairan Apr 14 '13 at 21:03
3  
@Kairan -- if you really must have extra vertical spacing, then \vspace{<dimen>} is the proper way to add it. This should only be added after a paragraph break or an environment that places latex in vertical mode when it ends. –  barbara beeton Apr 14 '13 at 21:33

1 Answer 1

up vote 5 down vote accepted

You should try to avoid explicit spacing within the document, markup the document structure and then globally arrange that the structural elements make the right layout.

Something like this might be closer (and produces no warnings)

enter image description here

\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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.