Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

\documentclass[letterpaper,draft,12pt]{article}

\begin{document}

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
(./civil.tex
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.
 ...                                              

l.1 
     ��\documentclass[letterpaper,draft,12pt]{article}
? 

(/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size12.clo)
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
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

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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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