LaTeX

Visit the AoPS Book Store.

Please note: These pages are no longer updated and maintained. We have moved all the information in these pages into the AoPSWiki, which are updated and improved by the AoPS Community. Click here to go to the corresponding page in the AoPSWiki.

To create your first LaTeX document, start by opening a new file in TeXnicCenter. Start TeXnicCenter if you haven't already done so. To open a new file in TeXnicCenter, click File in the upper left, then click New. A blank document should open. Type the following lines (or copy and paste them):

\documentclass{article}
\begin{document}
Hello, world!
\end{document}

Note that it is curly braces surrounding the words "article" and "document" in the above example, not parentheses. As you will see, curly braces are used everywhere in LaTeX.

Save the document (press Ctrl-S or click File, then Save) as 'Hello' (don't include the quote marks in the name) in a folder of your choice. The file will appear in your folder as 'Hello.tex.' We will call this the source file.

In order to create a finished LaTeX document, we need to compile the source file. First, make sure that the bar near the top of the TeXnicCenter window reads "LaTeX => PDF"; if it doesn't, change it so that it does. Then to compile the file, do any one of the following:

  • Select "Build" -> "Current File" -> "Build" from the top menu bar
  • Click on the "Build Current File" icon (it's the down-pointing arrow over the stack of papers, just to the right of the "LaTeX => PDF" bar)
  • Press Ctrl-F7

You'll see some system messages scroll in the "Output" panel at the bottom of the window, and then eventually you should (hopefully) see the line "0 Error(s), 0 Warning(s), 0 Bad Box(es), 1 Page(s)". This means that your document (a PDF file) is ready.

To view your document, do any one of the following:

  • Select "Build -> "View Output" from the top menu bar
  • Click on the "View Output" icons (it's the magnifying glass over the sheet of paper, just to the right of the "Build Current File" icon from above)
  • Press F5

This will open up Adobe Reader and show your finished document. You can print the document from Adobe Reader if you like.

Congratulations! You've created your first LaTeX document!

Now you're ready to learn more about layout and mathematics in LaTeX.

Want to learn how to tackle those tough MATHCOUNTS and AMC counting and probability problems? Check out Art of Problem Solving's Introduction to Counting & Probability by David Patrick.
© Copyright 2008 AoPS Incorporated. All Rights Reserved. • FoundationPrivacyContact Us