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



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

This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
entering extended mode
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, loaded.

 ! LaTeX Error: Missing \begin{document}.

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


Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
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?

  • 1
    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

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.

  • 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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