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

Errors while processing latex files

Preface

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

Now don't get scared. I cannot remember ever seeing most of these errors and I have been using TeX and LaTeX for all my documents a quarter century or so. (Then again, my memory definitely does not extend over a quarter century. More like a quarter hour nowadays.) And almost all the complicated errors are self-inflicted. Or professor-inflicted. If you do not make your own problems, the problems will probably be typos and forgotten {, }, or $ characters. Or often you forget a \ before a special character that needs one. (At least, I do this often.)

However, if your admirable professor tells you that he or she would like the page numbers in Egyptian hieroglyphs in the middle of the page, go for it! Ask your beloved professor to help you get this just perfectly right. Don't leave the professor\rq{}s office until it is done. (Visit early in the morning, of course.)

Other than that very important observation, this web page needs work. However, some of it may already be useful. On first use, be sure to read the first two entries of the contents below (excluding this preface).

If you have any errors 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 also give a solution to the problem.

Contents

Contents
Preface
General notes on errors
General tricks to try
No error message. Just shows a * and sits there.
No error message. But bad links in the pdf side bar.
==> Fatal error occurred, the output PDF file is not finished!
! ==> Fatal error occurred, no output PDF file produced!
(end occurred inside a group at level nnn)
(end occurred when if... on line nnn was incomplete)
(Fatal format file error; I'm stymied)
Please type a command or say `\end'
! A <box> was supposed to be here
! Ambiguous; you need another { and }
! Argument of ... has an extra }
! Arithmetic overflow
! Bad character code
! Bad delimiter code
! Bad math code (...).
! Bad mathchar
! Bad node name: `...'.
! Bad number
! Bad register code
! Bad space factor
! Counter too large
! Dimension too large
! Discretionary list is too long
! Display math should end with $$
! Double subscript
! Double superscript
! Duplicate pattern
! Emergency stop
! Extra \right
! Extra alignment tab has been changed to \cr
! Extra }, or forgotten $
! Extra \....
! File ended while scanning use of \end.
! File ended within
! Font ... not loadable: Bad metric (TFM) file.
! Font ... at ... not loadable: Metric (TFM) file not found.
! Font ... not loadable: Metric (TFM) file not found.
! Font ... not loadable: Metric (TFM) file or installed font not found.
! Font ... not loaded; Not enough room left
! fontspec error: "font-not-found"
! Forbidden control sequence found
! Huge page cannot be shipped out
! I can't find file `...'
! I can't go on meeting you like this
! I can't write on file `...'.
! Illegal magnification has been changed to 1000 (...).
! Illegal math
! Illegal parameter number in definition of ...
! Illegal unit of measure (pt inserted)
! Improper \hyphenation will be flushed.
! Improper `at' size (
! Improper alphabetic constant
! Improper discretionary list
! Incompatible glue units
! Incompatible list can't be unboxed
! Incompatible magnification (
! Incomplete \if...
! Infinite glue shrinkage found in ...
! Infinite glue shrinkage inserted from
! Insertions can only be added to a vbox
! Interruption
! Invalid code (
! LaTeX Error: Bad \line or \vector argument.
! LaTeX Error: Bad math environment delimiter.
! LaTeX Error: Bad use of \\
! LaTeX Error: \begin{...} ended by \end{...}
! LaTeX Error: Can be used only in preamble.
! LaTeX Error: \caption outside float
! LaTeX Error: Command ... already defined
! LaTeX Error: Command \circle invalid in math mode.
! LaTeX Error: Command \end{itemize} invalid in math mode
! LaTeX Error: Counter too large.
! LaTeX Error: Environment ... undefined.
! LaTeX Error: File `...' not found
! LaTeX Error: Float(s) lost.
! LaTeX Error: Illegal character in array arg.
! LaTeX Error: Lonely \item--perhaps a missing list environment.
! LaTeX Error: Missing \begin{document}
! LaTeX Error: Missing p-arg in array arg
! LaTeX Error: Missing @-exp in array arg
! LaTeX Error: No such counter
! LaTeX Error: Not in outer par mode.
! LaTeX Error: Option clash for package csvtools.
! LaTeX Error: \pushtabs and \poptabs don't match.
! LaTeX Error: \RequirePackage or \LoadClass in Options Section.
! LaTeX Error: Something's wrong--perhaps a missing \item
! LaTeX Error: Suggested extra height (...) dangerously large.
! LaTeX Error: Tab overflow.
! LaTeX Error: There's no line here to end
! LaTeX Error: This may be a LaTeX bug
! LaTeX Error: This NFSS system isn't set up properly.
! LaTeX Error: Too deeply nested.
! LaTeX Error: Too many columns in eqnarray environment.
! LaTeX Error: Too many unprocessed floats
! LaTeX Error: Two \LoadClass commands.
! LaTeX Error: Two \documentclass or \documentstyle commands.
! LaTeX Error: Undefined tab position.
! LaTeX Error: Unknown option ... for package ...
! LaTeX Error: \usepackage before \documentclass.
! LaTeX Error: \verb ended by end of line
! LaTeX Error: \< in mid line
! LaTeX Error: ... undefined
! Leaders not followed by proper glue
! Limit controls must follow a math operator
! Math formula deleted: Insufficient ... fonts
! Misplaced alignment tab character &.
! Misplaced \omit
! Missing # inserted in alignment preamble
! Missing $ inserted
! Missing $$ inserted
! Missing = inserted for
! Missing { inserted
! Missing } inserted
! Missing control sequence inserted
! Missing delimiter (. inserted)
! Missing \endcsname inserted
! Missing font identifier
! Missing number, treated as zero
! Missing `to' inserted
! Not a letter
! Number too big
! OK
! Only one # is allowed per tab
! Output loop---
! Output routine didn't use all of
! Paragraph ended before ... was complete
! Parameters must be numbered consecutively
! Patterns can be loaded only by INITEX
! Please use ...
! Runaway argument
! \script...font ... is undefined (character ...)
! TeX capacity exceeded, sorry [...]
! \textfont ... is undefined (character ...)
! Text line contains an invalid character
! This can't happen (
! Too late for ...
! Too many }'s
! Unbalanced output routine
! Unbalanced write command
! Undefined control sequence
! Use of ... does not match its definition
! You already have nine parameters
! You can't dump inside a group
! You can't use `macro parameter character #' in ... mode
! You can't use a prefix with `...'




General notes on errors

When your latex file, index.tex, is processed, errors may be found. On a serious error, processing stops. An error message will be printed, preceded by a !. The line number in your latex file at which the error is discovered is printed before the message, following an l.

To be sure, the error might not be in your own index.tex file. It may be in a package you load. Then the filename of that package will have been printed earlier following a "(", one that is not yet closed by a ")". Now packages by themselves do not have errors. I hope. But when you load several different packages, and you will, they might conflict. Then there is not much you can do except try to change the order in which the packages are loaded. If that does not help, you will need to live without one of the packages. Fortunately, such problems are rare, and mostly restricted to recently developed packages. So the discussion here assumes that the error is in your index.tex file.

The first thing to do is to read the error message. Then read the line number at which it was found. Look in your tex file at and maybe before that line number and try to find an error. (See the next entry for some general rules in doing so.)

After you have found the error, you can correct it in your tex file. But do not save. Processing can get really weird if the file changes while it is still being processed. Also, if you make changes, note that this may change the line numbers. The processing will still print the line numbers of the original file.

After hopefully identifying and correcting each error, hit Enter in the processing window. Note that one error often causes more than one error message. The additional error messages should disappear too the next time you process the file.

If there are countless error messages, the best thing may be to enter a "q" or "x" at the ? prompt. Then after having saved your corrections so far, reprocess. Hopefully there will not be that many problems anymore.

Also, processing can get very nasty if latex tries to open some file and cannot find it. If you get stuck, try hitting "c" or "d" while holding down Ctrl. Or try to specify a junk file name like "/dev/null" or "nul".

See also http://www.tex.ac.uk/cgi-bin/texfaq2html?label=erroradvice


General tricks to try

There are some general tricks to identify errors.

Use the "a" key to get a list of all errors. Maybe another error message can clarify the problem.

Remember the special characters. To get an actual %, you need \%. (That is a mistake even experienced latex users still make regularly.) For an & you need \&, for a # you need \#, for a \ you need \backslash, (\\ is new line), for a printed { you need \{, and for } you need \}. However, [ and ] are normal, while \[ and \] surround math.

Except in mathematics, the characters ^ and _ are illegal too, and < and > will not do what you think they should. A * or [ immediately behind \\ will cause problems. The trick is then to enclose that following stuff between { and }.

Look carefully for typos. A 1 may resemble an l, a ) a }, etcetera. Carefully identify for each { the corresponding } that closes it. Check that \begin{something} is closed by \end{something}, not \end{somethingelse}.

Try to find the error message on this web page and see whether that gives a useful hint. (But there are almost infinitely many possible problems for a single error message; this page cannot list them all. Using you intuition is often the best guide to what is wrong.)

Try to temporarily remove the apparently problematic command or environment. Does the problem disappear? If so, you know where the problem is.

But it is not uncommon for even experienced latex users to get stumped by an error. In that case, a divide and conquer approach may be your best bet.

Try enclosing the general problem area between \begin{comment} and \end{comment} lines. The enclosed area will no longer be processed. So if your error is indeed in the selected area, the processing error should disappear. (If it does not disappear, select a bigger area).

After you have identified the problem area, move roughly half of it outside the comment block. (Of course, select complete units. Do not break groupings, or you create additional errors.) If the error reappears, it is in that half. If not, it is in the other half. Either way, you have narrowed down the problem area by a factor 2.

Move everything out of the comment block. Then put about half of the now identified smaller problem area back inside. If the error is in that half, it will not show up. In the other half it will. That allows you to narrow the problem area even more closely. And so on until the problem area is so small that there is only one possible cause to the error left.

Of course, then you will notice that the problem was trivial, and you should have seen it in a second. No need for all this chopping into pieces. When you know the answer, the problem is always simple.


List of error descriptions



No error message. Just shows a * and sits there

Latex did not see an \end{document} line. It is patiently waiting for whatever other exciting stuff you have planned for it.

  1. Check that you have a correctly spelled \end{document}.
  2. Check that \end{document} is not hidden behind something like an \endinput line.
  3. Check that you are indeed processing the index.tex file that you think you are processing. (Create an error right at the start of the file if you have to.)
  4. If stumped, try the general tricks.

No error message. But bad links in the pdf side bar.

Sometimes the pdf has bad links in the sidebar even though no rerun is requested in the log file.

  1. Run latex once more. L2h will complain, but just hit "c" to continue. Then run "p" as needed. That fixed it for me.
  2. Sometimes the link of an \addcontentline command goes to the end of the previous chapter instead of the start of the new chapter (which is an unnumbered \chapter*{...} chapter). In that case, make sure the thing is formatted as follows:
    \clearpage
    \phantomsection
    \addcontentsline{toc}{chapter}{Title of whatever}
    \chapter*{TITLE OF WHATEVER}
    
    The additional first two commands will hopefully fix things.

==> Fatal error occurred, the output PDF file is not finished!

This just tells you the pdf was not made.

  1. Look for the earlier error message that gives the reason.
  2. If stumped, try the general tricks.

! ==> Fatal error occurred, no output PDF file produced!

This just tells you the pdf was not made.

  1. Look for the earlier error message that gives the reason.
  2. If stumped, try the general tricks.

(end occurred inside a group at level nnn)

Something was not properly closed when the end of the file was reached.

  1. Look for a { bracket that has never been closed by a }.
  2. Look for other things that may not have been closed, like environments, math, etc.
  3. If a pdf was created, or can be created, look at the end of the document in the pdf for clues. If, say, an {\it was not closed, things will be in italics.
  4. If stumped, try the general tricks.

(end occurred when if... on line nnn was incomplete)

Unless you write your own latex code, you did not close something or put something in a place latex cannot accommodate it.

  1. Look for missing } brackets.
  2. Look for other things that may not have been closed, like environments, math, etc.
  3. If stumped, try the general tricks.

(Fatal format file error; I'm stymied)

From the TeX FAQ:

The commonest cause of the message, is that a new binary has been installed in the system: no two TeX binaries on the same machine can understand each other’s formats. So the new version of TeX you have just installed, won’t understand the format generated by the one you installed last year.

Resolve the problem by regenerating the format; of course, this depends on which system you are using.

From the web:

I first tried the fmtutil command as root [administrator] again and it still didn't work. Then I ran the command as normal user and now everything works.


Please type a command or say `\end'

TeX has nothing to do and asks you what it should do. You will get this error, for example, if you run latex interactively on an empty latex source file. Since in the l2h shell you do not run latex interactively, you should not get this error there. (Just an "emergency stop" one.)

  1. Say `\end'? (Actually, I got an "TeX capacity exceeded, sorry" error on that. But it did end the program.)

! A <box> was supposed to be here

In LaTeX, boxes are created by \newsavebox, given content by \savebox, and used by \usebox. Plain TeX uses \newbox, \setbox, \copy, etcetera.

  1. Check that your \savebox or \usebox has a box in its first argument.
  2. If stumped, try the general tricks.

! Ambiguous; you need another { and }

Compare the items on double subscripts and superscripts.

  1. Try adding a couple of brackets, I guess.
  2. If stumped, try the general tricks.

! Argument of ... has an extra }

  1. Did you use a fragile command, like \footnote or \parbox, in a place it should not be? Like in a \caption? If you really need it there, try putting \protect right in front of it.
  2. A misused \frac command, like \frac{1,2} can cause this.
  3. Apparently, some commands inside fragile commands can cause this. Try temporarily removing the content and see whether the error disappears.
  4. If stumped, try the general tricks.

! Arithmetic overflow

Something went wrong deep inside the processing program.

  1. Check for unusual constructs.
  2. If stumped, try the general tricks.

! Bad character code

The character code of a normal character was specified outside the valid range from 0 to 127.

  1. Check for \lccode or \uccode commands.
  2. If stumped, try the general tricks.

! Bad delimiter code

A numeric delimiter code must be between 0 and 2^{24}-1, (\delcode) or 2^{27}-1 including the class number (\delimiter).

  1. If stumped, try the general tricks.

! Bad math code (...).

A numeric math code was specified outside the valid range from 0 to 32767.

  1. Check for \mathchardef commands.
  2. If stumped, try the general tricks.

! Bad mathchar

A math character with a code outside the valid range from 0 to 32767 was encountered.

  1. If stumped, try the general tricks.

! Bad node name: `...'.

An error in the pstricks package. A node name must only contain letters and digits and start with a number.

  1. Change the name.
  2. If stumped, try the general tricks.

! Bad number ...

Latex expected a number, but did not get a valid one.

  1. Careful examination of the correct form of the command listed will usually show up the problem.
  2. If stumped, try the general tricks.

! Bad register code

Gee.

  1. If stumped, try the general tricks.

! Bad space factor

Gee.

  1. Something wrong with a \hfil[l] or \vfil[l]?
  2. If stumped, try the general tricks.

! Counter too large

One counter that is fairly likely to run out is the footnote one. There are only so many footnote marks, after all. (9 symbolic ones, to be precise.)

  1. Too many footnotes?
  2. Too many \thanks commands?
  3. Converting a counter > 26 to a letter a-z can also cause this error.
  4. If stumped, try the general tricks.

! Dimension too large

I think this means a length is specified that is larger than possible.

  1. If stumped, try the general tricks.

! Discretionary list is too long

A \discretionary line break has 3 parameters: text before the line break, text after the line break, and text if there is no line break in the first place.

  1. Check that it hhas three {...} parameters of reasonable size.
  2. If stumped, try the general tricks.

! Display math should end with $$.

Actually, in latex you should use \[ and \] instead of $$ and $$. Or better, use \begin{displaymath} and \end{displaymath}.

  1. Change to one of the correct forms. Then you know what begins math and what ends it.
  2. Math may not contain blank lines. If you leave a single blank line in an equation, it will generate the error message ! Missing $ inserted, followed by ! Display math should end with $$. followed by ! LaTeX Error: Bad math environment delimiter. Remove the blank line and all three error messages should disappear.
  3. Now latex2html has a nasty habit of leaving blank lines when it removes the labels from equations. These errors will then show up in its math images processing. In particular, they will show up in images.log. To fix this, put the \label{...} in equations at the end, followed by a %. Furthermore, leave some mathematics on the same line, before the \label{...}%.
  4. Use of $$ inside equation mode can cause this, I hear.
  5. If stumped, try the general tricks.

! Double subscript

If you think about it, {a_b}_c is not the same as a_{b_c}. In the first case, c is a subscript to the complete expression a_b. In the second case, it is a subscript to the subscript b only. So in the second case, c should be a lot smaller than b. In the first case, it must be at least as big as b. TeX needs to know which case it is.

  1. Add the brackets already.
  2. If stumped, try the general tricks.

! Double superscript

If you think about it, {a^b}^c is not the same as a^{b^c}. In the first case, c is a superscript to the complete expression a^b. In the second case, it is a superscript to the superscript b only. So in the second case, c should be a lot smaller than b. In the first case, it must be at least as big as b. TeX needs to know which case it is.

  1. Add the brackets already.
  2. Note that in math, ' is a superscript too. (It is really the same as ^\prime.)
  3. If stumped, try the general tricks.

! Duplicate pattern

I assume this refers to hyphenation patterns. In that case, you should never see it unless you are an expert.

  1. If stumped, try the general tricks.

! Emergency stop

Tex got in trouble. The actual error may be much earlier.

  1. You will see this error when LaTeX cannot find a file in an \input or \include type statement.
  2. You will see this error when LaTeX cannot find the \end{document} line. Check its presence and spelling.
  3. If stumped, try the general tricks.

! Extra \right

A \right, which must precede some bracket or a point, must match an earlier \left.

  1. I tend to get my \left and \right mixed up.
  2. Missing/misspelled \end{array}?
  3. If stumped, try the general tricks.

! Extra alignment tab has been changed to \cr

You put in too many & characters in a single row in your table or array or matrix. Each & should separate two columns. (Note that what TeX calls \cr is what LaTeX calls \\. TeX has started a new row to fix things up.)

  1. Is the & count right?
  2. Did you mean \& somewhere?
  3. Did you forget or mistype \\ at the end of the previous row?
  4. Did you use an invalid range in a \cline?
  5. Too large a count in a \multicolumn?
  6. Is there something wrong in the column specifications? Check p and @ commands for correctness.
  7. If stumped, try the general tricks.

! Extra \....

There is something not matching something else, like maybe a \fi, \or, or \else not matching an earlier \if. Unless you write your own TeX code, that would probably mean that something has been put in the wrong place.

  1. Check for unusual constructs.
  2. If stumped, try the general tricks.

! Extra }, or forgotten $

There is some problem with figuring out what begins or ends what.

  1. Unlike what it says, check not only that there is a { for each }, and a $ for each $, but also a \[ for each \] and a \( for each \). And that they are properly nested: {\small $a}=b$ is wrong. You must close the math before closing the { with }.
  2. If stumped, try the general tricks.

! File ended while scanning use of \end.

You did not close something properly. May be just a forgotten }. LaTeX has now reached end of file without finding the closing bracket.

  1. Check the indicated problem area for { that may have forgotten }.
  2. If stumped, try the general tricks.

! File ended within ...

You did not close something properly. May be just a forgotten } or \end{...}.

  1. If stumped, try the general tricks.

! Font ... not loadable: Bad metric (TFM) file.

A needed font seems to be corrupt.

  1. Error in the font specification?
  2. Try to reinstall the font?
  3. Try to use a different font?

! Font ... at ... not loadable: Metric (TFM) file not found.

A needed font is not found.

  1. Error in the font specification?
  2. Try to install the font?
  3. Try to use a different font?
  4. You get this error if you try to use plain latex to process a template set up for xelatex. Check the value of \pdfengine or \webengine.

! Font ... not loadable: Metric (TFM) file not found.

A needed font is not found.

  1. Error in the font specification?
  2. Try to install the font?
  3. Try to use a different font?
  4. Are you using plain latex where xelatex is needed? Check the value of \pdfengine or \webengine.

! Font ... not loadable: Metric (TFM) file or installed font not found.

A needed font is not found.

  1. Error in the font specification?
  2. Try to install the font?
  3. Try to use a different font?
  4. Are you using plain latex where xelatex is needed? Check the value of \pdfengine or \webengine.

! Font ... not loaded; Not enough room left

I do not think that should happen with an up-to-date version of LaTeX.

  1. Do you really need all these fonts?
  2. There are ways to process a document in parts. That is described in Lamport's LaTeX User's guide & Reference Manual.

! fontspec error: "font-not-found"

The fontspec package cannot find the specified font.

  1. Did you mistype the font name?
  2. Does the font exist? Use the "Character Map" program to check. If it does not, maybe you can install it.

! Forbidden control sequence found
  1. Try removing it?
  2. If stumped, try the general tricks.

! Huge page cannot be shipped out

Never seen this one in my life. Doubt that it would happen with a modern latex version. Unless there is something really, really, wrong.

  1. If stumped, try the general tricks.

! I can't find file `...'

When interactive, typing in the correct file name, or correct package name, is the best way to proceed. However, latex in the l2h menu is not interactive and all processing aborts.

  1. Interactively, LaTeX will be happy as long as it gets any valid file name.
  2. Interactively, the way to get LaTeX to stop asking depends on your operating system and TeX version. Try entering x a couple of times. Or nul or /dev/null. Or try hitting c while holding down Ctrl.
  3. Interactive or not, you either have to provide a valid link to an existing, readable file, or remove the command trying to read it.
  4. If stumped, try the general tricks.

! I can't go on meeting you like this

Because LaTeX loves you, it feels really bad about all the problems resulting from your error.

  1. Fix the problems you have figured out so far and try processing the latex again.
  2. If stumped, try the general tricks.

! I can't write on file `...'

Latex wants to create a file, but it cannot do so.

  1. You may get this error if you have an old version of index.pdf open in Adobe Acrobat and postcript or pdflatex is trying to create a new one. You will need to exit Acrobat and then try the "l" or "p" key again.
  2. No more disk space?
  3. Are you in a location where you have no privileges to write the file?
  4. Does someone else, like system, own the file that is to be replaced?
  5. If stumped, try the general tricks.

! Illegal magnification has been changed to 1000 (...).

You are not supposed to use \magnification in latex.

  1. Check that "scaled" font scalings use valid numbers.
  2. If stumped, try the general tricks.

! Illegal math

TeX is being helpful here. You can do thousands of things wrong in TeX, and TeX actually reduced the possible problems for you to look for by a factor 2 or so!

  1. If stumped, try the general tricks.

! Illegal parameter number in definition of ...

There is a problem with a # parameter while defining something.

  1. If you mistype \newcommand{\mycommand}[2]{...} as \newcommand{\mycommand}[1]{...}, references #2 to argument 2 will be invalid.
  2. To get an actual #, use \#.
  3. For a \[re]newenvironment{name}[n]{begin stuff}{end stuff}, the n parameters cannot be used in end stuff.
  4. There may be some #1, #2, ... mistyped in a \[re]newcommand or \[re]newenvironment. (Or in a plain tex \def statement).
  5. Check that you are not defining something inside defining something. (Like a \newcommand inside a \renewenvironment, say.)
  6. If stumped, try the general tricks.

! Illegal unit of measure (pt inserted)

Note that you cannot abbreviate 0in (0 inch), or 0pt (0 points, i.e. 0/72 inch) as 0. You still need to add "in" or "pt" even if the length is zero. (Which one of the two obviously does not make a difference.)

  1. Like above.
  2. This one is likely to follow an "Missing number, treated as zero" error. The missing number is really a missing length.
  3. Check the proper format of the command you are using.
  4. If stumped, try the general tricks.

! Improper \hyphenation will be flushed.

Improper parameter to \hyphenation

  1. Words should be letters and hyphens and separated by spaces.
  2. If stumped, try the general tricks.

! Improper `at' size (

  1. If stumped, try the general tricks.

! Improper alphabetic constant

  1. If stumped, try the general tricks.

! Improper discretionary list

  1. If stumped, try the general tricks.

! Incompatible glue units

  1. If stumped, try the general tricks.

! Incompatible list can't be unboxed

  1. If stumped, try the general tricks.

! Incompatible magnification (

  1. If stumped, try the general tricks.

! Incomplete \if...; all text was ignored after line nnn.

Unless you write your own LaTeX code, this is propably caused by something in the wrong place.

  1. Look for unusual constructs.
  2. If stumped, try the general tricks.

! Infinite glue shrinkage found in ...

  1. If stumped, try the general tricks.

! Infinite glue shrinkage inserted from

  1. If stumped, try the general tricks.

! Insertions can only be added to a vbox

  1. If stumped, try the general tricks.

! Interruption

  1. If stumped, try the general tricks.

! Invalid code (

  1. If stumped, try the general tricks.

! LaTeX Error: Bad \line or \vector argument.

You put something invalid behind \line or \vector inside a picture environment

  1. Try looking at http://en.wikibooks.org/wiki/LaTeX/Picture.
  2. If stumped, try the general tricks.

! LaTeX Error: Bad math environment delimiter.

Are your { and } braces matched? Is \[ or \( closed by \] or \)? Are you entering math mode while already in it?

  1. Check properly opening and closing of math environments.
  2. Math may not contain blank lines. If you leave a single blank line in an equation, it will generate the error message ! Missing $ inserted, followed by ! Display math should end with $$. followed by ! LaTeX Error: Bad math environment delimiter. Remove the blank line and all three error messages should disappear.
  3. Now latex2html has a nasty habit of leaving blank lines when it removes the labels from equations. These errors will then show up in its math images processing. In particular, they will show up in images.log. To fix this, put the \label{...} in equations at the end, followed by a %. Furthermore, leave some mathematics on the same line, before the \label{...}%.
  4. A missing \right after an array can cause this error.
  5. If stumped, try the general tricks.

! LaTeX Error: Bad use of \\

A \\ new line command is in an unallowed position.

  1. Remove the \\?
  2. If stumped, try the general tricks.

! LaTeX Error: \begin{...} ended by \end{...}
  1. Check for typos in ... Check that you did not forget a \begin{..} or \end{...}.
  2. If stumped, try the general tricks.

! LaTeX Error: Can be used only in preamble.

Things like \usepackage can only be used before the \begin{document} line. In particular, \documentclass must be the first line, way before \begin{document}.

  1. Make sure you do not have two \begin{document} lines.
  2. If stumped, try the general tricks.

! LaTeX Error: \caption outside float

A \caption must inside a "float" like a figure or a table.

  1. Is the \begin{figure) or \begin{table} of the caption environment properly spelled?
  2. If stumped, try the general tricks.

! LaTeX Error: Command ... already defined

A new command being defined already exists.

  1. If you are defining a new command here, the name is already used for something else. Change it. Remember that LaTeX is case sensitive, so simply changing the case will fix things.
  2. Or to overwrite the old command, use \renewcommand. Warning: this will get you into big trouble if the overwritten command is an important one.
  3. If this occurs during the loading of a package, the package conflicts with another one. (Not at all unusual.) Try changing the order of package loading, or forget about one of the two.
  4. If stumped, try the general tricks.

! LaTeX Error: Command \circle invalid in math mode.
  1. Like it says? However, you can put a picture environment inside a mathematics environment. Then you can put the \circle inside that picture. (As far as the surrounding math mode is concerned, the entire picture will be just some very big "letter".)
  2. If stumped, try the general tricks.

! LaTeX Error: Command \end{itemize} invalid in math mode

If you use math mode inside an itemize and forget the closing $, this will happen.

  1. Check properly closing of math mode.
  2. If stumped, try the general tricks.

! LaTeX Error: Counter too large.
  1. Unless you are defining a very long list, you probably brought this upon yourself somehow. (Who else is readily available to be blamed?)
  2. If you are really defining a long list, make sure it is a top level list, which is enumerated by arabic numbers. (Or learn how to define your own lists.)
  3. If stumped, try the general tricks.

! LaTeX Error: Environment ... undefined.

An attempt to use an environment that has never been defined.

  1. Check for typos in the \begin{environment} line.
  2. If it is part of a package, check the corresponding \usepackage command.
  3. If stumped, try the general tricks.

! LaTeX Error: File `...' not found

This error is serious because latex will terminate without finishing the document. The missing file may be a personal file that you are trying to \input. Or it may be a package you are trying to load with \usepackage that you do not have installed. If latex is trying to find a .sty, .cls, or .def file, it is a missing package.

  1. If latex is missing a personal file, put it in the same folder as index.tex. Then do not use a path in the \input statement.
  2. If latex is missing a package, try finding the file on the web and put it inside the "texinputs" folder inside "l2h". Note that you may have to run latex on any .ins or .dtx file you find to get the sty file.
  3. If you are running latex though an editor like TeXstudio instead of through l2h, you may need to copy the files inside the "texinputs" folder inside "l2h" to the same folder as your document index.tex.
  4. If your latex is very old, the package might not work. Try to do without the package. Or upgrade latex to a more recent version. Rerun install_l2h after that.
  5. The missing file error is somewhat tricky when making web pages. While making web pages, latex might be looking for the file in the wrong folder. In general, make sure that you put your pictures in the same folder as index.tex. Not somewhere else. Or give latex a complete, (so-called absolute), path to the file. A "./", "../", or "subfolder/" path will not work.
  6. If stumped, try the general tricks.

! LaTeX Error: Float(s) lost.

Like it says; one or more figures, tables, etc., or marginpars have not been typeset. The actual error may be well before the point where the problem is recognized.

  1. You cannot put pictures or tables in minipages or parboxes. Or in footnotes, or anything like that.
  2. Putting something that has a floating location (figures, footnotes, ...) into something that also has a floating location causes this error. After all, where should LaTeX put, say, a footnote to a footnote? That does not make sense.
  3. Is a picture or table in the wrong place?
  4. If stumped, try the general tricks.

! LaTeX Error: Illegal character in array arg.

For "array" read "array" or "tabular" or "multicolumn" or whatever. The argument in which you define the format of the columns seems to be messed up. The normal letters are r, l, and c. Howver, there is also @{} and p{}.

  1. Read up on arrays, tables (tabular), or whatever on http://en.wikibooks.org/wiki/LaTeX/. Then check for typos in the array/, tabular/, multicolumn/, whatever, environment parameters.
  2. If stumped, try the general tricks.

! LaTeX Error: Lonely \item--perhaps a missing list environment.

An item command was found. Latex cannot figure out what list it belongs to.

  1. Like it says? Cut and pasted something inside a list to outside it?
  2. Check the \begin{...} statement of the list for typos.
  3. If stumped, try the general tricks.

! LaTeX Error: Missing \begin{document}

When this happens to me, I have put something printable before the \begin{document} line. Usually I misspelled some nonprintable command, turning it into printable text. But you could actually forget the \begin{document} line itself, I guess.

  1. Do not put any printable text before \begin{document}. Just packages, definitions, and such.
  2. Check everything before \begin{document} for typos or other errors.
  3. Apparently, misuse of \marginsize can also cause this error.
  4. If stumped, try the general tricks.

! LaTeX Error: Missing p-arg in array arg

For "array" read "array" or "tabular" or "multicolumn" or whatever.

  1. While defining columns, there is a p not followed by {width} argument.
  2. Read up on arrays, tables (tabular), or whatever on http://en.wikibooks.org/wiki/LaTeX/. Then check for typos in the array, tabular, multicolumn, whatever, environment parameters.
  3. If stumped, try the general tricks.

! LaTeX Error: Missing @-exp in array arg

For "array" read "array" or "tabular" or "multicolumn" or whatever.

  1. Read up on arrays, tables (tabular), or whatever on http://en.wikibooks.org/wiki/LaTeX/. Then check for typos in the array/, tabular/, multicolumn/, whatever, environment parameters.
  2. If stumped, try the general tricks.

! LaTeX Error: No such counter

A counter is undefined

  1. Do not use \newcounter after \begin{document}.
  2. If you use a special style file, (like one provided by your target journal), some standard counter may have been disabled by the journal style.
  3. If stumped, try the general tricks.

! LaTeX Error: Not in outer par mode.

You put something, (figure, table, marginpar, ...), in the wrong place. They cannot be inside secondary environments.

  1. A figure or table inside a parbox or minipage will not work.
  2. If stumped, try the general tricks.

! LaTeX Error: Option clash for package ...

Your guess is better than mine.

  1. Options to a package conflict with each other.
  2. If stumped, try the general tricks.

! LaTeX Error: \pushtabs and \poptabs don't match.

I think I have used the tabbing environment once, but I cannot remember when. Otherwise I use the tabular environment inside tables.

  1. Check that every \pushtabs is closed by a corresponding \poptabs. You cannot close one \pushtabs by two \poptabs.
  2. If stumped, try the general tricks.

! LaTeX Error: \RequirePackage or \LoadClass in Options Section.

Should not be there.

  1. Ahem! RequirePackage may not be used with \DeclareOption
  2. If stumped, try the general tricks.

! LaTeX Error: Something's wrong--perhaps a missing \item

One thing that is obviously wrong is the supply of meaningful error messages.

  1. Like it says? Did you leave out the starting \item in an enumerate or other list environment?
  2. Apparently, leaving the arguments away in a thebibliography environment can also trigger the above nugget of wisdom.
  3. If stumped, try the general tricks.

! LaTeX Error: Suggested extra height (...) dangerously large.

Gee. You only live once. So live dangerously.

  1. Too big a number in \enlargethispage.
  2. If stumped, try the general tricks.

! LaTeX Error: Tab overflow.

There are only so many tab stops possible. Don't ask how many.

  1. Too many \= in a tabbing environment?
  2. If stumped, try the general tricks.

! LaTeX Error: There's no line here to end

Rather than trying to create more blank space using \\ \\, use \\[25pt]. Been there, done that. If there is no previous \\, use \vspace{12pt}.

  1. If you really need the \\ try putting in a \strut before it.
  2. If stumped, try the general tricks.

! LaTeX Error: This may be a LaTeX bug

Two balloonists got hopelessly lost over California. They lowered their balloon enough that they got within shouting distance of a tall building. That was the headquarters of the Digital Equipment Company. They shouted: "Hello! Hello! Where are we?" A mathematician on one of the top floors answered; "You are in a balloon," he shouted back. That mathematician was Dr. Leslie Lamport, the author of LaTeX.

  1. Yes, this may be a LaTeX bug. Or a lady bug. But it is probably a consequence of an earlier error in your index.tex file.
  2. If stumped, try the general tricks.

! LaTeX Error: This NFSS system isn't set up properly.

Well, set it up properly! Do I have to do everything here myself?

  1. Invalid font used in \DeclareErrorFont.
  2. If stumped, try the general tricks.

! LaTeX Error: Too deeply nested.

You cannot just keep putting list inside list inside list ...

  1. The maximum depth is 4.
  2. If stumped, try the general tricks.

! LaTeX Error: Too many columns in eqnarray environment.

  1. You can only have three (i.e. no more than two &).
  2. Forgot a \\?
  3. If stumped, try the general tricks.

! LaTeX Error: Too many unprocessed floats

LaTeX has been hoarding your figures and tables for a rainy day. However, there is no more room in its small apartment.

  1. The first table or figure that is being hoarded may be a bottle neck. Change it placement options to [htbp] to make it easier to place. Reduce its size. Or use the H placement option of the float package to put it down whether latex likes it or not.
  2. A well placed \clearpage may be an option.
  3. Did you really use that many \marginpar commands? Shame on you!
  4. If stumped, try the general tricks.

! LaTeX Error: Two \LoadClass commands.

That is definitely too much.

  1. If stumped, try the general tricks.

! LaTeX Error: Two \documentclass or \documentstyle commands.

Too much. Too much. Try make do with only one. At the start of index.tex, preferably.

  1. Kill off the second.
  2. If stumped, try the general tricks.

! LaTeX Error: Undefined tab position.

Latex is asked to tab to a column that is not defined.

  1. Did you miscounted the number of tabs, or forgot to start a new line?
  2. If stumped, try the general tricks.

! LaTeX Error: Unknown option ... for package ...

Check for typos and the package documentation.

  1. What options are available may depend on context.
  2. If stumped, try the general tricks.

! LaTeX Error: \usepackage before \documentclass.

\documentclass must come before anything else nontrivial.

  1. Check for typos in the \documentclass command.
  2. Put the \documentclass before anything else besides comments and blank space.
  3. If stumped, try the general tricks.

! LaTeX Error: \verb ended by end of line

  1. A \verb must be of the form \verb!...! where ! can be almost any character not inside ... However, there may be no line breaks inside ...
  2. Make sure that the start character, ! or whatever, is indeed the same as the end character.
  3. If stumped, try the general tricks.

! LaTeX Error: \< in mid line

\< (reduce tab start) should be at the start of a tabbed line.

  1. To get an actual < in the middle of the text, go into math mode. Like $<$.
  2. If stumped, try the general tricks.

! LaTeX Error: ... undefined

Something that you treat as defined (say the command in a \renewcommand) is not defined.

  1. Check for typos in the command, both here and where it was supposedly defined.
  2. Is the definition inside a comment block?
  3. If stumped, try the general tricks.

! Leaders not followed by proper glue

If you use leaders, you probably can figure this out.

  1. If stumped, try the general tricks.

! Limit controls must follow a math operator

  1. If stumped, try the general tricks.

! Math formula deleted: Insufficient ... fonts

  1. If stumped, try the general tricks.

! Misplaced alignment tab character &.

By itself, an & can only be used in tables and the like to separate columns.

  1. If you want a printed &, use \&. Example: Proctor \& Gamble.
  2. A missing/misspelled \begin{tabular} or similar can cause this.
  3. If stumped, try the general tricks.

! Misplaced \omit

The \omit command overrides column formatting in tables and arrays and such.

  1. A \multicolumn statement has an implied \omit. Check its validity. In particular, whether it does not use more columns than there are defined.
  2. A \newcommand within a tabular environment can cause this, I hear.
  3. If stumped, try the general tricks.

! Missing # inserted in alignment preamble

  1. If stumped, try the general tricks.

! Missing $ inserted

Usually, this happens to me if for some arcane reason I try to use a character like _ in the text. That can only be used in math mode (unless preceded by \). So Tex puts a dollar sign in front of it. Needless to say, that misplaced dollar sign will produce further errors. After all, the subsequent text is believed to be math, and the math following the next dollar sign to be text. (So a perfectly valid _ or ^ in that math produces the same error once again.)

  1. Use \_ for an actual underscore and \^{} for a lone caret.
  2. Is something used in the text that can only be used in math mode? If so, enclose it between $ and $. Example: water is H$_2$O (superscripts and subscripts can only be used in math mode).
  3. Is a $ really missing from previous math?
  4. Math may not contain blank lines. If you leave a single blank line in an equation, it will generate the error message ! Missing $ inserted, followed by ! Display math should end with $$. followed by ! LaTeX Error: Bad math environment delimiter. Remove the blank line and all three error messages should disappear.
  5. Now latex2html has a nasty habit of leaving blank lines when it removes the labels from equations. These errors will then show up in its math images processing. In particular, they will show up in images.log. To fix this, put the \label{...} in equations at the end, followed by a %. Furthermore, leave some mathematics on the same line, before the \label{...}%.
  6. Remember that the inside of an \mbox or \hbox is not in math mode unless you enclose it between $ and $. Example: $\alpha\beta=0\mbox{ if $\beta$ is zero}$ needs the $ signs around the second \beta as shown.
  7. If stumped, try the general tricks.

! Missing $$ inserted

TeX has found that it should no longer be in display math mode. Note that in LaTeX you should be using \[ and \], or \begin{displaymath} and \end{displaymath}, not $$ and $$.

  1. Blank lines are not allowed in math mode.
  2. If stumped, try the general tricks.

! Missing = inserted for ...

TBA

  1. If stumped, try the general tricks.

! Missing { inserted

LaTeX decided it really needed a { and inserted one.

  1. This is likely due to some earlier error.
  2. And the insertion is likely to introduce subsequent errors.
  3. Incorrect integral bounds can cause this error.
  4. If stumped, try the general tricks.

! Missing } inserted

LaTeX decided it really needed a } and inserted one.

  1. This is likely due to some earlier error.
  2. And the insertion is likely to introduce subsequent errors.
  3. Check for still-open opening brackets.
  4. If stumped, try the general tricks.

! Missing control sequence inserted

A control sequence means a LaTeX command, like \backslash.

  1. It is \[re]newcommand{\name}... but \[re]newenvironment{name}... Note the backslash. In plain TeX, you have \def\name{...}.
  2. If stumped, try the general tricks.

! Missing delimiter inserted

  1. If stumped, try the general tricks.

! Missing \endcsname inserted

Typically, this occurs when you put a \ in front of an environment name.

  1. Check for the above problem. For example, \begin{\itemize} should be \begin{itemize}.
  2. If stumped, try the general tricks.

! Missing font identifier
  1. Check your
  2. If stumped, try the general tricks.

! Missing number, treated as zero

Missing "number" might actually be a length.

  1. Like it says? Check for presence and correctness of lengths and coordinates behind \parbox, \line, \circle, \put, ....
  2. Remember that 0 is not a valid length. You must say 0in (inch) or 0pt (point) or something like it.
  3. A [..] may have been mistaken for an optional argument. If so, try enclosing it in brackets like {[...]}. Like change \\[text] into \\{[text]}.
  4. A misplaced \protect (before something like a length or a number) can also produce this error.
  5. If stumped, try the general tricks.

! Missing `to' inserted

The "to" is not really used in LaTeX. It uses {} brackets for parameters.

  1. A mispelled command?
  2. If stumped, try the general tricks.

! Not a letter

Hyphenation words must consist of letters and hyphens.

  1. Using discretionary \- hyphens in the actual word is probably the best way to keep LaTeX from nagging you.
  2. If stumped, try the general tricks.

! Number too big

Probably an indication that LaTeX is lost due to some error.

  1. If stumped, try the general tricks.

! OK

OK.

  1. If stumped, try the general tricks.

! Only one # is allowed per tab
  1. If stumped, try the general tricks.

! Output loop---

This should be very nasty, but I have never seen it.

  1. If stumped, try the general tricks.

! Output routine didn't use all of ...

Well, get the unused portion back.

  1. If stumped, try the general tricks.

! Paragraph ended before ... was complete

Parameters of commands, unless defined specially, cannot contain blank lines.

  1. Check for a missing }.
  2. Check for blank lines inside parameters of commands.
  3. If stumped, try the general tricks.

! Parameters must be numbered consecutively

If you have this error, you probably know why.

  1. In latex, you do not normally use plain tex \def definitions. If possible use \[re]newcommand.
  2. If stumped, try the general tricks.

! Patterns can be loaded only by INITEX

I cannot imagine why any new user would want to load abstract hyphenation patterns.

  1. If stumped, try the general tricks.

! Please use ...
  1. Because you ask so nicely?
  2. If stumped, try the general tricks.

! Runaway argument

TeX has noted that an argument of a command does not seem properly closed by a }.

  1. Check that each { has a proper closing }. Watch for mistaking ) for }.
  2. You cannot use a verbatim-line environment (like verbatim, rawhtml, comment, ...) inside something else. They need to stand alone. (Although I have used rawhtml inside a command definition. Nothing is absolute.)

! \script...font ... is undefined (character ...)

In math mode, a special font is needed. It is not loaded

  1. Load it. Like \load{\footnotesize}{\sc} to load the sc (small caps) font in footnote size.
  2. If your installation has only limited fonts, you can probably do without.
  3. If stumped, try the general tricks.

! TeX capacity exceeded, sorry [...]

Nowadays, this is likely to be something wrong with your document.

  1. Line excessively long? Various MS Windows-type software insists to put an entire paragraph of output on a single line in the input file. That can exceed the TeX input line buffer. In TeX, you should break up these long lines. To get a paragraph break, in TeX you use a blank line. Not just a line break.
  2. A missing } makes a parameter size explode?
  3. A circular definition? (Something defined in terms of itself?)
  4. Apparently, using some commands inside a fragile command can cause this. Try temporarily removing the contents.
  5. If stumped, try the general tricks.

! \textfont ... is undefined (character ...)

In math mode, a special font is needed. It is not loaded

  1. Load it. Like \load{\textsize}{\sc}.
  2. If stumped, try the general tricks.

! Text line contains an invalid character
  1. Like it says? Check for weird characters in index.tex. Use a different editor if needed.
  2. If stumped, try the general tricks.

! This can't happen (

  1. If stumped, try the general tricks.

! Too late for ...

  1. If stumped, try the general tricks.

! Too many }'s

Sometimes they are hard to count. Or you may have missed a {.

  1. Missing a \begin{...} statement can cause this.
  2. If stumped, try the general tricks.

! Unbalanced output routine

  1. If stumped, try the general tricks.

! Unbalanced write command

  1. If stumped, try the general tricks.

! Undefined control sequence

A command you are using is not defined by you, or the system.

  1. Did you misspell the command?
  2. Is whatever is supposed to define the command missing or misspelled? (Like the \documentclass command, the \usepackage{...}, the \input{...}, or whatever?)
  3. Is the command used out of context? (Like an \item not in a list?)
  4. Interestingly, a footnote inside a footnote can apparently cause this error.
  5. If stumped, try the general tricks.

! Use of ... does not match its definition

You are using a valid command in the wrong way. In particular, the stuff immediately following the command is not in the right format. (A "command" might really be an environment.)

  1. Did you misspell the command?
  2. Check the proper command format in a LaTeX manual.
  3. Are you using the command itself right, but is something in its parameters not right? Like \put(10,10){\line...} where the \line... is invalid?
  4. Try using {} brackets around command parameters.
  5. If stumped, try the general tricks.

! You already have nine parameters

TeX macro definitions have a maximum of 9 arguments. (Being #1 to #9.) But you are unlikely to hit that limit as a new LaTeX user.

  1. Watch for potential problems with a # character.
  2. If stumped, try the general tricks.

! You can't dump inside a group
  1. Use the toilet already!
  2. If stumped, try the general tricks.

! You can't use `macro parameter character #' in ... mode

A # character is where it should not be.

  1. An actual # must be written as \#.
  2. If stumped, try the general tricks.

! You can't use a prefix with `...'
  1. Who says I can't? I just did, didn't I?
  2. If stumped, try the general tricks.

References:
 Index   Intro to LaTeX