# LaTeX Warning About Height, \hbox, and \vbox, and ht

I am compiling a LaTeX document on Ubuntu and I am getting those warnings, errors, or whatever. Any idea about them?

Package hyperref Warning: Height of page (\paperheight) is invalid (0.0pt),
(hyperref)                using 11in.
Underfull \hbox (badness 10000) has occurred while \output is active
Underfull \vbox (badness 10000) has occurred while \output is active []
LaTeX Warning: h' float specifier changed to ht'.

-

Package hyperref Warning: Height of page (\paperheight) is invalid (0.0pt), (hyperref) using 11in.

Obviously your class doesn't define \paperheight, so you have to do it by yourself or rely on defaults.

For example, to get A4 paper, use:

\setlength{\paperheight}{297mm}
\setlength{\paperwidth}{210mm}


For letter paper:

\setlength{\paperheight}{11in}
\setlength{\paperwidth}{8.5in}


Underfull \hbox (badness 10000) has occurred while \output is active

Underfull \vbox (badness 10000) has occurred while \output is active []

LaTeX Warning: 'h' float specifier changed to 'ht'.

You used a placement option h for a float (table or figure). If LaTeX cannot place it right there because of too less space, it moves it to the top of the next page and issues that warning.

Usually h is too strict. This way you don't allow top, bottom or page placement. Use at least ht instead, or relax it to htbp or even !htbp if you like. If you really need it to be exactly "here", use the H option together with the float package. There are further ways. But adding placement options is usually fine.

-
Thanks Stefan, you did me a great favour :-) – Promather Dec 12 '10 at 20:05
One question though, why do I have to hard code constants in the TeX file (297mm, etc.)? A4, letter, etc., are all very famous, shouldn't there be any constant for them? – Promather Dec 12 '10 at 20:07
Commonly classes define supported paper sizes. For example, presentation classes (powerdot, beamer, slides, seminar) don't need paper sizes such as A4 or letter; poster classes use very large sizes, flashcard/business card sizes very small instead. But you're right: a place where standard sizes are defined would be good. The geometry package defines a lot of such sizes, and I guess most people just use that, if not class options. – Stefan Kottwitz Dec 12 '10 at 20:17