# Running LaTeX

Running LaTeX

Now that you know what a LATEX document could look like, let's create a simple document. In PCTeX click on the File menu, and then New. In the New Filename box type a name with no spaces, ending in .tex (I called mine first.tex). Make sure the location: box is somewhere you can find the file. In Alpha click on the File menu, and then click New. Next click on the File menu and click Save As... In the Save As box type a name with no spaces, ending in .tex. If you are using another editor the process will be similar, but not exactly the same. Inside the file you created type:


\documentclass{article}

\begin{document}

Hello world!

\end{document}



and save the file. In Aquamacs you can convert to a pdf by first clicking the nondescript fuzzy animal with the letters pdf under it. If there are no errors then you can see the typeset document by clicking the button with the image of glasses and letters pdf under it. If Aquamacs finds an error a warning button will appear. If you click on it you will cycle through all detected errors, and Aquamacs will do its best to find where the error is.

In PCTeX click on the typeset button and if there are no errors you will see the output file. If you do see an error skip ahead to the Finding errors and warnings section for some additional help.

Every LATEX document has a preamble and a main body. In any LATEX document the preamble is everything before the line \begin{document}. This document has a one line preamble, but in general you can create new commands and include packages in the preamble. Commands will be discussed later, but packages will not be discussed in depth. The line \doucmentclass{article} must be the first line of every LATEX document. It is possible to use different document classes, besides article, but that is beyond the scope of this class.

The main body of the text is everything between the lines \begin{document} and \end{document}. Everything you wish to appear in the output file must be between these lines.