# first LaTeX file

I installed MiKTeX and ran a test file on TeXworks, but am getting an error message.

\documentclass{article}
\begin{document}
This is some sample text.
\end{document}


I get this error message when attempting to compile to a PDF:

This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9)
entering extended mode
("C:\Documents and Settings\USER\Desktop\TeX\tex\plain\vertex\test.tex"
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, greek, gujarati, hindi, hungarian, icelandic, indonesian, inter
lingua, irish, italian, kannada, kurmanji, latin, latvian, lithuanian, malayala
m, marathi, mongolian, mongolianlmc, monogreek, ngerman, nynorsk, oriya, panjab
i, pinyin, polish, portuguese, romanian, russian, sanskrit, serbian, slovak, sl
ovenian, spanish, swedish, swissgerman, tamil, telugu, turkish, turkmen, ukengl
ish, ukrainian, uppersorbian, usenglishmax, welsh, loaded.
! Undefined control sequence.
l.1 \topmatter

?


Now I believe this is happening because my test.tex. file is not in the tex\plain\vertex directory, however, I can't figure out how to make TeXworks automatically look in the directory I want.

Also, when I try one of the templates from tex\plain\vertex, I get the same error message as well.

-
Where did you save your real test.tex? –  Ulrike Fischer Jun 3 '13 at 15:55
USER\Desktop\TeX\Workspace –  jsan Jun 3 '13 at 15:58
I don't think the one you've described is the problem you really have... In fact the error refers to a \topmatter command that can't be found in your example. I think you are compiling one of the examples found in /tex/plain/vertex folder with pdflatex instead of with pdftex (or plain TeX) –  karlkoeller Jun 3 '13 at 15:58
Well as the file mentioned in your error is in \USER\Desktop\TeX\tex\plain\vertex this seems to indicated that you created the folder Workspace inside the main texmf-tree of miktex (which you seemed to have named TeX). Don't do this. Miktex doesn't like if if you try to compile things inside a texmf tree. Put your own documents in some external folder. E.g. USER\Documents\TeX. –  Ulrike Fischer Jun 3 '13 at 16:21
^ That did it! Thanks –  jsan Jun 3 '13 at 16:36

As the file mentioned in your error is in \USER\Desktop\TeX\tex\plain\vertex this seems to indicated that you created the folder Workspace inside the main texmf tree of miktex (which normally is named something like miktex 2.9 but which you seemed to have named TeX).
Don't do this. Miktex doesn't like if if you try to compile tex files which resides in a texmf tree. It finds files in a texmf tree only through the FNDB - which means that you would have to recreate the FNDB before the compilation (so that is can find the .tex and after the compilation (so that it can find the .aux) and again after your created e.g. a .bbl.