Take the 2-minute tour ×

My tex document has the following as the first two lines:



When I run: latex civil.tex I get the following output:

entering extended mode
LaTeX2e <2009/09/24>
yphenation, loaded.

 ! LaTeX Error: Missing \begin{document}.

 See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.


Overfull \hbox (20.0pt too wide) in paragraph at lines 1--284
[1]) (./civil.aux) [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]
[15] [16] [17] [18] [19] [20] (./civil.aux) )
Output written on civil.dvi (20 pages, 72800 bytes).
Transcript written on civil.log.

I'm kind of new to this, I don't know what is wrong. The document generates but the first page is blank. The rest of the document generated seems right, except that it looks like it is using a book layout (on the letterpaper the text doesn't take up that much space).

Any suggestions?

share|improve this question
Some editors, especially on Windows, put a BOM (byte order mark) at the beginning of a text file. Check in the preferences of yours. –  egreg Jul 15 '11 at 21:17

2 Answers 2

up vote 7 down vote accepted

You have some non printable characters in your TeX-file before \documentclass. Delete the line and write it new should help, if you cannot see these two characters in your editor to delete only these two ones.

share|improve this answer
How silly of me. I saw those characters there and thought nothing of it. I ended up having to create a new file copy all of the contents of the other file except the first line (documentclass line) then manually type that line again in the new file. I tried just deleting the previous files first line and retyping and those characters were always there. This might be because that file was originally a project Gutenberg file. Strange. Thank you! –  chadgh Jul 15 '11 at 21:19

As Herbert says, you have garbage on the first line. Most likely, this is a UTF-8 BOM, which is sometimes inserted by various editors. Make sure to set your editor not to use this BOM when editing .tex files.

share|improve this answer

Your Answer


