Latex in the Microlabs

A brief introduction by ES, version of 13 Oct 2005.

The word "Latex" refers to both a markup language, and the software for transforming that language into finished documents. Latex is essential to mathematicians, for whom it has become the standard document format. It is also valuable to other scholars who must work with unusual symbols and fonts -- chemists, linguists, musicians, etc. But it may also be useful to people who, writing ordinary text, simply want to take advantage of Latex's other excellent features -- e.g., its creation of PDF's with hyperlinked text, and its automatic generation of page justification, hyphenation, indexes, tables of contents, etc.

Latex software can be downloaded for free, but installing it can be tricky, particularly if you're unfamiliar with the program. Latex is already installed and available for all Vanderbilt students, in the Arts and Sciences Microlabs -- Garland, Branscomb, etc. Here are some brief instructions for its use:

  1. (Skip this first step if you do not already have a document file to work with, and you intend to start from scratch.)

    If you already have a source file to work with -- e.g., on a floppy desk or at some accessible location on the network, save a copy onto the computer's hard disk -- e.g., under "D:\My documents".

  2. Go to: Start, All Programs, Word Processing, Tex, TeXnicCenter. (See illustration.)

    (Actually, you could use TeXShell or WinShell, but I'm recommending TeXnicCenter at this time. TexShell has far fewer features, and I'm not as familiar with WinShell.)

  3. Click either the "New" button (if you're starting a new document from scratch) or the "Open" button (if you're opening an existing document). See illustration below.

  4. Editing. Do some editing (in the editing pane -- see illustration). Note the "Find", "Replace", and "Bookmark" buttons, which may be helpful during editing. At this point you actually have to know something of the Latex markup language. Basics can be learned easily just by looking at a few examples; you might start with the one in the illustration on this page. If you want to learn more, there's plenty of free documentation available online, as well as books available for purchase.

  5. (This step is only needed if you've started a new file from scratch, and is only needed once for that file. In all other cases you can skip this step.) Click on the "Save" button, and give your file a filename. It will get saved under "D:\My Documents", or somewhere like that. What you're saving is actually the "source" file, which should have a filename ending in ".tex".

  6. Make sure that the selected output profile is "LaTeX ==> DVI"; that's what I'd recommend for most editing. If it's not set to that output mode, click on the downward-pointing triangle (labeled "Mode" in the illustration above) to change to that output profile.

    (If you want a PDF file when you've finished all your editing, you might change the mode to "LaTeX ==> PDF". But I don't recommend that mode for editing.)

  7. Click on the "Compile" button. This will automatically save your ".tex" file, thus preserving any changes you've made in it. Then this will also create, and save to disk, a file with filename ending in ".dvi" (or if you already had a "dvi" file on the hard disk, this procedure will overwrite your old "dvi" file with an updated one).

  8. During the compilation, you may see text scrolling through the "output pane" at the bottom of the TeXnicCenter window. It may pause occasionally. It may take a particularly long time (as much as a minute or two) the first time that you run the program.

    If you see a message like "(There were 3 error messages)", just ignore it. It is just an idiosyncrasy of the interaction between Miktex (the real tex program underneath what you're doing) and TeXnicCenter (the graphical front end that you're using, which is more user-friendly than Miktex itself).

  9. Wait for the message in the gray box at the bottom of the output pane, which says "LaTeX-Result:" That will tell you whether you really got any errors. If you got any errors, an easy way to find them is to click on the "Nexterror" button (see top of illustration). This "interactive error handling" is a big convenience that TeXnicCenter has over some other tex editor/shell programs.

    To the right of the "Next error" button (not circled on my illustration) are the buttons for "Previous error", "Next warning", "Previous warning", "Next bad box", and "Previous bad box". Beginners can ignore those for now.

  10. Click on the "View" button at the top of the TeXnicCenter window. This should open the program Yap (or update its contents, if the program is already open). See illustration below.

    If you don't see the Yap program, it might be hiding behind some other program, or it might be minimized. Look for its entry on the taskbar at the bottom of the screen, and click on that entry to bring the Yap program window into view.

  11. Go back to editing the source file in the editing pane. Repeat this cycle as many times as needed. You may want to position your TeXnicCenter and Yap windows so that you can see both at the same time. Also, you will find forward and inverse search to be helpful, particularly in longer documents. Those search capabilities are one of the reasons for prefering TeXnicCenter over many other editor/shell programs, and preferring Yap over many other viewer programs (including, for instance, Acrobat Reader).

  12. When you're all done, you may want to create a PDF copy, as mentioned earlier. Also, be sure to save your files, either onto a floppy disk or a thumbdrive, or onto some network location. Student files left on a Microlab computer are not guaranteed to still be there the next time you come back!