The l2h help pages   © Leon van Dommelen 
The latest version of this document is online at eng.fsu.edu or at dommelen.net.

Warnings while processing LaTeX files

Preface

This web page tries to give some help with warning messages that may pop up while processing your LaTeX file index.tex.

Warning messages are problems that are not severe enough to prevent processing. And a few of them, like "underfull" boxes, are often ignored. But you do want to fix up the rest before making a pdf or web pages of your document.

If you have any warnings that would be good to include here, please e-mail them to me. You will be helping other LaTeX users, even those that do not use l2h. If you can paste them directly from the log file, (so that the log file reader can recognize them), it would be even better. And so it would if you can give a solution to the problem.

Contents

Contents
Preface
General notes on warnings
A space is missing. (No warning).
Too much space after a point. (No warning).
Bad line break. (No warning).
Bad page break. (No warning).
* Font `...' does not contain script '...'.
LaTeX Font Warning: Command ... invalid in math mode on input line nnn.
LaTeX Font Warning: Some font shapes were not available, defaults substituted.
LaTeX Warning: Citation `...' on page nnn undefined on input line nnn.
LaTeX Warning: Command ... invalid in math mode on input line nnn.
LaTeX Warning: Float too large for page by nn.nnnpt on input line nnn.
LaTeX Warning: `h' float specifier changed to `ht'.
LaTeX Warning: Label `...' multiply defined.
LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.
LaTeX Warning: Marginpar on page nnn moved.
LaTeX Warning: No ... typeface in this size, using ...
LaTeX Warning: Oval too small.
LaTeX Warning: \oval, \circle, or \line size unavailable on input line nnn.
LaTeX Warning: Reference `...' on page nnn undefined on input line nnn.
LaTeX Warning: There were multiply-defined labels.
LaTeX Warning: There were undefined references.
LaTeX Warning: You have requested release `...' of LaTeX,
LaTeX Warning: You have requested, on input line ..., version
LaTeX Warning: ... in math mode.
Missing character: There is no ... in font ...
Overfull \hbox (nn.nnnpt too wide) detected at line nnn
Overfull \hbox (nn.nnnpt too wide) has occurred while \output is active
Overfull \hbox (nn.nnnpt too wide) in paragraph at lines nnn--nnn
Overfull \vbox (nn.nnnpt too high) detected at line nnn
Overfull \vbox (nn.nnnpt too high) has occurred while \output is active
Package etoolbox Warning: Patching '\begin' failed!
Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):
Package hyperref Warning: Rerun to get /PageLabels entry.
Package natbib Warning: Citation `...' on page nnn undefined on input line nnn.
Package natbib Warning: There were undefined citations.
Package polyglossia Warning: No hyphenation patterns were loaded for `...'
Package rerunfilecheck Warning: File `...' has changed.
pdfTeX warning (ext4): destination with the same identifier (...) has been already used, duplicate ignored
Underful \hbox (badness nnn) detected at line nnn
Underfull \hbox (badness nnn) has occurred while \output is active
Underfull \hbox (badness nnn) in paragraph at lines nnn--nnn
Underfull \vbox (badness nnn) detected at line nnn
Underfull \vbox (badness nnn) has occurred while \output is active




General notes on warnings

Warning messages are problems that are not severe enough to prevent processing. And a few of them, like "underfull" boxes, are often ignored. But you do want to fix up the rest before making a pdf or web pages of your document.

One important thing to remember about warnings: they may be spurious. They often complain about the previous version of your document. In particular, if you correct the reason for a warning, you need to run LaTeX twice to get the warning message to disappear. (The l2h shell will try to do that for you.)

And after you have inserted an additional bibliographical reference you must run LaTeX, then bibtex, then LaTeX two more times for the warning about the missing citation disappears. (Again l2h will do it for you.)

So, if you think you have fixed the problem, run latex a few times to see whether it did. Besides that major annoyance, warnings are usually easy to fix.


A space is missing. (No warning).

Latex ignores spaces behind commands. If you cleverly define a shorthand command for your place of work like \newcommand{\fsu}{The Florida state University}, then "\fsu is well known" shows up as "The Florida state Universityis well known". To avoid this, use "{\fsu} is well known" or "\fsu{} is well known" or "\fsu\ is well known"


Too much space after a point. (No warning).

"Dr. Smith" will print out as "Dr.  Smith", with too much space behind the point. To avoid that, use "Dr.\ Smith". See also the next entry.


Bad line break. (No warning).

Sometimes LaTeX will break the line at a bad point, like between "Dr." and "Smith"

  1. If you type it as "Dr.~Smith", the line will not be broken between the two words.
  2. Inserting a \nolinebreak command will normally prevent a line break. And \linebreak or \newline will create one.

Bad page break. (No warning).

Sometimes LaTeX will start a new page at a bad point.

  1. Inserting a \nopagebreak command will normally prevent a page break. If you are lucky. And \pagebreak or \newpage will create one.

* Font `...' does not contain script '...'.

The font specified in \newfontfamily does not have the hoped for script info and might be wrong.

  1. See first whether the characters show up OK anyway.
  2. Try specifying another font.
  3. Try installing a suitable font. See internationalization.html.

LaTeX Font Warning: Command ... invalid in math mode on input line nnn.

A command is not valid in mathematics mode.

  1. Is the command the one you think it is?
  2. Try putting the command inside an \mbox{} or \hbox{}

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

Look for more specific warnings and check the final document whether the results are unacceptable.


LaTeX Warning: Citation `KEY' on page nnn undefined on input line nnn.

A \cite{KEY} citation refers to a bibliographical reference, (like a paper, book, or report), that has not been defined. Or actually, the citation may already be correctly defined, but LaTeX may not yet know that.

  1. If latex complains about some \cite{KEY} command, check with a text editor that there is some entry in file references.bib that has KEY as label. When that is OK and file references.bib has been saved, first run latex on index.tex, then run bibtex, and then run latex two more times. The warning should disappear.
  2. If not, check for typos in 'KEY'. And that the brackets in the KEY entry in references.bib are properly matched. And that references.bib is properly loaded in a \bibliography{references} command near the end of index.tex. Note that a citation is actually defined by a \bibitem command inside the index.bbl file. So, if all fails, check there.

LaTeX Warning: Command ... invalid in math mode on input line nnn.

A command is not valid in mathematics mode.

  1. Is the command the one you think it is?
  2. Try putting the command inside an \mbox{} or \hbox{}

LaTeX Warning: Float too large for page by nn.nnnpt on input line nnn.

Your picture or table is too big vertically. (Note that a pt is about the size of a point: 72 pt = 1 inch.)

  1. For a table, split it into two tables.
  2. For a figure, try using something like \resizebox{!}{500pt}{CONTENTS OF PICTURE}
  3. Or split it into two figures. If necessary, use an \addtocounter{figure}{-1} or \addtocounter{table}{-1} to keep the figure or table number from increasing.

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

If you put [h] behind a \begin{figure}, you are telling LaTeX to put the picture right [h]ere at this point in the text. However, LaTeX thinks you are an idiot. If LaTeX, in its wisdom, finds the figure just slightly awkward at the given point, (maybe not enough lines above or below it), it puts the figure elsewhere, normally at the top of some later page. So it adds a [t]op allowed position, changing your stupid [h] into a much better [ht]. (And then ignores your h.)

  1. If you want it HERE, make sure the float package is loaded using \usepackage and then change [h] into [H].

LaTeX Warning: Label `LABEL' multiply defined.

You have two \label{LABEL} commands with the same label LABEL. Or two bibliographical references inside references.bib with the same KEY. For me, a multiple label is usually a result of too much cut and paste. A multiple KEY is usually a second paper by the same author in the same year.

  1. Change one LABEL into LABEL2 and run latex a couple of times. The error should disappear. Unless there is a third instance.
  2. Or change one KEY into KEYb.

LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.

Like it says. This will fix the numbers produced \ref, \pageref, and \cite commands.

  1. Run latex again on index.tex.

LaTeX Warning: Marginpar on page nnn moved.

A note in the margin intruded on another one and was moved. It is no longer aligned with the text it is commenting on.

  1. Do you really need both notes in the margin?
  2. Can they be made more concise?
  3. Make the margins bigger?

LaTeX Warning: No ... typeface in this size, using ...

A type style declaration specified a font that is not available. Another font was substituted.

  1. See whether the substitution is acceptable. Otherwise try something else.
  2. If you are looking for bold math or something like it, have a look at the AMS fonts.

LaTeX Warning: Oval too small.

An \oval command in a picture specified an oval that is smaller than latex can make it. See the next entry.


LaTeX Warning: \oval, \circle, or \line size unavailable on input line nnn.

An \oval, \circle, or \line command in a picture has a size that LaTeX cannot produce. It is somewhat of a pain that LaTeX cannot make oblique lines smaller than about the size of a letter. And it cannot make big circles either.

  1. Latex can make horizontal and vertical lines of any size.
  2. Use a drawing program like xfig that can produce eps output to draw what you want. Then include the produced eps figure in your picture using \epsffile.
  3. Less desirable, use a bitmap drawing program like MicroSoft Paint or xpaint to draw what you want. Then convert the produced bmp file into eps. One way to convert the file to eps is to look in the convert subfolder of l2h and find the folder named graphics. If you put your picture in that folder and double-click bmp_to_eps, an eps version will be created. If you do this, make the picture big and resize it with a \resizebox command. Or quality will be miserable.

LaTeX Warning: Reference `LABEL' on page nnn undefined on input line nnn.

A \ref{LABEL} refers to a label, (like that of an equation, figure, table, section, ...), that has not been defined. Or actually, the label may already be correctly defined, but LaTeX may not yet know that. (Note that this is not a bibliographical reference; a bibliographical reference is referred to as a "citation".)

  1. If latex complains about some \ref{LABEL} command, check that there is a corresponding \label{LABEL} command inside the referred-to equation or table (behind the caption command), or equation, or immediately behind the \chapter / \section / ... command. When that is OK, run latex on index.tex one or two times. The warning should disappear.

LaTeX Warning: There were multiply-defined labels.

Find and fix the corresponding specific warning(s)


LaTeX Warning: There were undefined references.

Find and fix the corresponding specific warning(s)


LaTeX Warning: You have requested release `...' of LaTeX,

Your LaTeX is too old for some package.

  1. If there is a problem in the final document, upgrade.

LaTeX Warning: You have requested, on input line ..., version

One of your packages is older than another package wants. This warning is often ignorable, in my experience.

  1. If the package is in the "texinputs" folder of l2h, try taking it temporarily out of there. Then latex may be able to find a more recent version elsewhere. (This should certainly work for MiKTeX, for one.)
  2. Try finding a more recent version on the web. Put it in texinputs. Note that you may have to run latex on any .ins or .dtx file you find to get the sty file.

LaTeX Warning: ... in math mode.

You are using something inside math mode that is not legal.

  1. If you need it, put it inside an \mbox{}. Math mode is suspended inside the brackets of an \mbox{} (or a \hbox{}, for that matter.)

Missing character: There is no ... in font ...

A selected font does not have the required character.

  1. Try to use another character?
  2. Select another font with \newfontfamily when using xelatex?
  3. Install such a font first?

Overfull \hbox (nn.nnnpt too wide) detected at line nnn

A line is too long and sticks out in the right margin. (Note that a pt is about the size of a point: 72 pt = 1 inch.)

  1. Have a look at the output produced in the pdf file.
  2. If this is an equation, you may have to split it up in two equations. Or you can break the single equation into several lines by turning the equation environment into an eqnarray one. If this is an displaymath environment rather than an equation one, turn it into an eqnarray* environment.

Overfull \hbox (nn.nnnpt too wide) has occurred while \output is active

A line is too long and sticks out in the right margin. (Note that a pt is about the size of a point: 72 pt = 1 inch.)

  1. Have a look at the output produced in the pdf file.
  2. Have a look at the previous and next items.

Overfull \hbox (nn.nnnpt too wide) in paragraph at lines nnn--nnn

To produce the final document, LaTeX must break up the paragraphs that you write in lines of the right size. However, while trying to do so in a reasonable way, it ended up with a line with too much text on it. It is sticking out into the right margin. (Note that a pt is about the size of a point: 72 pt = 1 inch.) LaTeX also lists the relevant text, using hyphens to show you where it is willing to hyphenate words.

  1. Have a look at the output produced in the pdf file. You will see the line sticking out.
  2. Put in "\-" discretionary hyphens. For example, LaTeX will not normally hyphenate already hyphenated words like "three-dimensional". But if such a long word ends up near the end of a line, there is very likely to be an underfull or overfull line. In that case, writing it as "three-di\-men\-sional" allows LaTeX to break the word either as "three-di-" and "mensional", or as "three-dimen-" and "sional". That usually solves the problem.
  3. In some cases I simply rewrite the paragraph slightly. Interestingly enough, I often find that the new paragraph is better than the original one.
  4. Enclose the entire paragraph inside \begin{sloppypar} and \end{sloppypar}. Somehow, personally I never do this at all. I do not like sloppy documents.
  5. Break a line yourself with a \linebreak command. Do this only when you are finalizing the document. Like the previous item, this may produce an "underfull \hbox" warning. (Which means too much space between the individual words.)
  6. Break a line yourself with a \newline command. Do this only when you are finalizing the document. This will leave a line that is shorter than normal.

Overfull \vbox (nn.nnnpt too high) detected at line nnn

LaTeX made a page longer than it wanted. (Note that a pt is about the size of a point: 72 pt = 1 inch.)

  1. Have a look at the output produced in the pdf file to see how bad it is.
  2. If a figure or table is too long vertically, you will need to break it up into two figures or tables.
  3. If the amount that the table or figure is too long is very small, a \resizebox using the graphicx package may be a quick fix.

Overfull \vbox (nn.nnnpt too high) has occurred while \output is active

A page in the final document can be only so long. So when LaTeX creates the final document, it needs to choose points at which to start the next page. In trying to do so in a reasonable manner, LaTeX ended up with a page with too much text on it. So LateX probably really squeezed the space between paragraphs and lines. And the page is still too long. (Note that a pt is about the size of a point: 72 pt = 1 inch.)

  1. Have a look at the output produced in the pdf file to see how bad it is.
  2. One possible solution is to rewrite the paragraph(s) involved a bit.
  3. Break a page yourself with a \pagebreak command. Do this only when you are finalizing the document. This may produce an "underfull \vbox" warning. (Which means too much space between the paragraphs and lines.)
  4. Break a line yourself with a \newline command. Do this only when you are finalizing the document. This will leave a shorter page than normal.

Package etoolbox Warning: Patching '\begin' failed!

This error shows up because l2h maintains the highest standards of code integrity. Patching up things is a nono. The mere loss of \AtBeginEnvironment is a small price to pay if the very difference between shell writers and package writers is at stake.

Also, I have no clue what \AtBeginEnvironment is supposed to do.


Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):

In general, math mode symbols, like for example \sigma, are not available for inclusion in PDF bookmarks, etc.

  1. One approach is to use \texorpdfstring:
    \title{Some text \texorpdfstring{$\sigma$}{[sigma]}}
    which will use $\sigma$ in TeX and [sigma] for the bookmark.
  2. On the other hand, if you are using sigma for something non-mathematical, then consider using a UTF-8 engine (XeTeX or LuaTeX) and inserting the character directly.
(Thanks to Joseph Wright at tex.stackexchange.com)
Package hyperref Warning: Rerun to get /PageLabels entry.
  1. Rerun LaTeX.

Package natbib Warning: Citation `KEY' on page nnn undefined on input line nnn.

A \cite{KEY} (or \citet or \citep) citation refers to a bibliographical reference, (like a paper, book, or report), that has not been defined. Or actually, the citation may already be correctly defined, but LaTeX may not yet know that.

  1. If LaTeX complains about some \cite.{KEY} command, check with a text editor that there is some entry in file references.bib that has KEY as label. When that is OK and file references.bib has been saved, first run latex on index.tex, then bibtex, and then run latex two more times. (The l2h shell tries to do this automatically.) The warning should disappear.
  2. If not, check for typos in 'KEY'. And that the brackets in the KEY entry in references.bib are properly matched. And that references.bib is properly loaded in a \bibliography{references} command near the end of index.tex.

Package natbib Warning: There were undefined citations.

Find and fix the specific warning(s) as described above.


Package polyglossia Warning: No hyphenation patterns were loaded for `...'

You are probably missing the setup of the language in your LaTeX installation.

  1. Apparently, MikTeX has a language tab to deal with this.
  2. In Debian/Ubuntu, you would need to install some package like texlive-lang-...

Package rerunfilecheck Warning: File `...' has changed.

Latex must be rerun because the hyperref labels have changed.


pdfTeX warning (ext4): destination with the same identifier (...) has been already used, duplicate ignored

Someone has been messing around with the page numbers. (One day I need to fix this in the thesis templates.)

  1. Apparently hyperref options "plainpages=false,pdfpagelabels" might help.

Underful \hbox (badness nnn) detected at line nnn

There is a line with too little text on it. LaTeX did not know how to stretch it to the right margin. For example "\hbox to 4in {Hello.}" will produce this message. The word Hello is far too small to extend to 4 inches.

  1. Have a look at the output produced in the pdf file.
  2. Maybe not use "\hbox to 4in {Hello.}"? What you want is probably better done with LaTeX commands like \makebox or \parbox.

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

There is a line with too little text on it. LaTeX did not know how to stretch it to the right margin.

  1. Have a look at the output produced in the pdf file.
  2. Have a look at the previous and next items.

Underfull \hbox (badness nnn) in paragraph at lines nnn--nnn

To produce the final document, LaTeX must break up the paragraphs that you write in lines of the right size. However, while trying to do so in a reasonable way, it ended up with a line with too little text on it.

  1. Look at the produced pdf. You will probably see a line with too much space between the words, as LaTeX stretched it to reach the right margin.
  2. You can add a possible hyphenation point in a strategic place. For example, LaTeX will not normally hyphenate already hyphenated words like "three-dimensional". But if such a long word ends up near the end of a line, there is very likely to be an underfull or overfull line. In that case, writing it as "three-di\-men\-sional" allows LaTeX to break the word either as "three-di-" and "mensional", or as "three-dimen-" and "sional". That usually solves the problem.
  3. In some cases I simply rewrite the paragraph slightly. Interestingly enough, I often find that the new paragraph is better than the original one.
  4. If you used a \linebreak command to break a line somewhere, consider a \newline or \\ instead. At a \newline or \\, LaTeX does not try to stretch the line to the right margin.

Underfull \vbox (badness nnn) detected at line nnn

LaTeX made a page with less text on it than it wanted. It cannot stretch it vertically enough to make a full page. For example, a \pagebreak can cause this warning.

  1. Have a look at the output produced in the pdf file to see how bad it is.
  2. If you are fine with having a short page, use \newpage instead. Then LaTeX will not try to make a full length page.

Underfull \vbox (badness nnn) has occurred while \output is active

A page in the final document can be only so long. So when LaTeX creates the final document, it needs to choose points at which to start the next page. In trying to do so in a reasonable manner, LaTeX ended up with a page with less text on it than it should have. So LateX probably put lots of space between paragraphs.

  1. Have a look at the output produced in the pdf file to see how bad it is.
  2. This is usually not something that you would want to spend much time on until you are finalizing the document. At that time, have a look at the entry on the overfull \vbox case. (Frankly, personally I routinely simply ignore underfull vboxes like this. I guess I should not really.)
 Index   Intro to LaTeX