Arnold - Math 475, Fall 2007

LaTeX Setup and Tutorial

Introduction

LaTeX works like this:

First, you use a text editor (we'll be using the freeware Texmaker) to create a LaTeX document.

 

Now you are ready to download the text editor, Texmaker.

  1. Go to http://www.xm1math.net/texmaker/index.html
  2. Click on "Download" at the top of the page.
  3. Now click under the appropriate platform.  If you are using windows, click on Executable file for win32 systems : texmakerwin32_install.exe
  4. Now click "Run" (or click save, save the installer to the desktop, and then double click the icon).
  5. Windows will ask "Unknown publisher, install anyway?".  Click "run".
  6. The Setup wizard will now open.  Click the box "I agree" then click "install" and keep clicking "next" until the setup is complete.  Don't change any of the defaults.
  7. At the end, click close.

 

Creating a simple document using LaTeX

Now we're finally ready to write a document in LaTeX. The instructions below will take you through the process of creating a very simple document.
  1. Open: Texmaker from the Start menu.  You may want to put a shortcut on your desktop.
  2. Write: In the upper right box, type this:

\documentclass{article} 
\begin{document} 
Hello universe! 
\end{document}

 

    3.  Save: Save this file as "universe.tex" to whatever directory you choose. Be sure the extension is "tex" and NOT "txt". Also be sure to select "All Files" under the "Save as Type" menu before you save.

    4.  Compile:  Now click on the little "Latex" icon on the toolbar.  You should get a message below the window which reads  "Process Started" "Process exited normally".

    5. View: Now click the lion icon on the tool bar to bring up Yap.

 

Texmaker has a special command called "Quick Build".  If you click on the button to the left of the "Latex" button, Texmaker will show you the log file in the lower window with any errors highlighted in red.

 

Handling compiling errors

LaTeX is a very picky typesetting program, and a lot of tiny things can cause compiling errors. By following the instructions below you will introduce an error into your universe.tex file and then see how to deal with it.
  1. Change your universe.tex file so that it looks like this:

     

     
    \documentclass{article}
    \begin{document}
    Howdy universe!
    The & is a special character.
    \end{document}

     

  2. Save universe.tex and try to compile it (steps 3 and 4 above). If you hit the "Latex" button, it will say "Process started", "Process exited with errors".  But if you hit the "Quick Build" button, you will get the error message in the window below "Misplaced alignment tab character &".

     

  3. In LaTeX, the "&" character is used for tabbing (alignment) in certain environments, but it is not a legal character on its own; that is what the first line of the error message above is saying - that the character "&" is being used somewhere it shouldn't. The "l.4" at the beginning of the next line of the error message tells you that the error is on line 4 (it says "lowercase ell dot four" not "one dot four" at the beginning of the line). Notice also that the line breaks where the compiler thinks your error might be: at the "&" character.

    4.   To fix the problem, you could "comment out" the entire line by placing a % at the beginning of the line.  Try this and compile again.

    5.  Or you can do as LaTeX suggests, and put a "\" in front of the &.  Remove the % and try this.

Printing a finished LaTeX document

If you want to print right from the computer you are working on, it's easy; just choose "Print" from the "File" menu of the Yap viewer.  Don't print from the Texmaker window, because you will only be printing the LaTeX code, not the finished product.

If you want to print from a computer that does NOT have LaTeX installed (or is you want to send your file to someone who does not have LaTeX installed, but needs to see your beautiful typeset file), do the following: Instead of clicking the "Latex" button, click the PDFLaTeX button to the right.  This creates your document as a .PDF file.  Then either click the Adobe button to view the file, or click on the file itself in the directory.  Now you have a file that you can print on almost any computer.

 

Thanks to Laura Taalman for assistance with this document.