Running LaTeX on Windows at ITaP
May 2, 2008
Mark Senn

TeXnicCenter is installed. Below are three exercises to get familiar with it.

Short Device-Independent File Exercise

  1. TeXnicCenter is installed.

  2. Do File => New... .

  3. Enter these lines in the main part of the window:
\documentclass{report}
\begin{document}
This is page 1.
\newpage
This is page 2.
\newpage
This is page 3.
\end{document}

  1. Do File => Save As... and save the file as short.tex.

  2. Do Project => Create with active file as main file.
    Select Language ``en''.
    Select Dialect ``US''.
    Left-click OK.

  3. At the top of the edit window, select DVI output.
    UseTo Produce This Output
              DeVice Independent
    Portable Document Format
    PostScript
    If you don't see "LaTeX=>DVI", left click the mouse on the down arrow to the right of what you do see and select "LaTeX=>DVI".

  4. Press F7 key (Build => Build Output) to process the short.tex file and make a short.dvi (DeVice Independent) file. Note that the window splits and the bottom half contains the ``Output Bar'' with messages from LaTeX. The last line should be
    0 Error(s), 0 Warning(s), 0 Bad Box(es), 2 Page(s)

  5. Press F5 key (Build => View Output) to preview the output. This should start a new yap (Yet Another Previewer) window on the screen.

  6. Experiment with these yap commands:
    UseTo
    F11 keyenter or leave full-screen mode
    ngo to next page
    pgo to previous page
    qquit
    show one page per window
    show two facing pages per window
    display a one page wide scroll
    display a two page wide scroll
    display ruler (left-click and then left-click on output---do shift-left-click for vertical ruler), the ruler is is only used for measuring, not setting margins, tabs, etc.
    move output on screen (left-click , left-click on output and while holding left mouse key down move mouse)
    magnify (left-click and then left-click on output)

  7. Go to LaTeX input window and intentionally introduce some errors. Change
            This is page 1.
    to
            This is an \alpha page 1.
    and
            This is page 2.
    to
            \error This is page 2.

  8. Press F7 key. Note the message about errors in the Output Bar.

  9. Press F9 key to go to the first error and change ``\alpha'' to ``$\alpha$''. \alpha is a math mode command. The first $ (or you can use ``\('') causes LaTeX to go from text to text math mode; the second $ (or you can use ``\)'') causes LaTeX to go from text math to text mode.

  10. Press F9 key again to go to the next error. False alarm---fixing the above error will fix this one also.

  11. Press F9 key again to go the the next error and remove ``\error ''.

  12. Press the F7 key.

  13. Press the F5 key.

  14. If you want to print the entire document you could left-click the printer icon on the yap window. Warning: on my computer even I select a range a pages my entire document gets printed using this procedure. Workaround: do LaTeX => PDF instead of LaTeX => DVI processing and use your PDF reader to only print out selected pages of the output.

    If your pages print in reverse order: in the Print Setup dialog box try left clicking ``Properties'' then left click on the ``Features'' tab to select ``Start Printing from Last Page''.

  15. Go to near beginning of edit window and left-click. Left-click on and experiment with finding text.

  16. Go to near beginning of edit window and left-click. Left-click on and experiment with replacing text.

  17. Do File => Exit in the edit window to leave TeXnicCenter.

Setup an Inputs Directory

Set up an inputs directory so the files in it can be used by LaTeX while in another directory

Choose somewhere to make a \Local TeX Files\tex\latex\misc subdirectory that you have write access. I chose C:\Documents and Settings\mark\My Documents\Local TeX Files\tex\latex\misc.

Detailed instructions for this step:
  1. Do Start => Programs => MiKTeX 2.5 => Help => Manual.
  2. Left click on ``6.2 Walkthrough: Registering Your Own Root Directory'' under ``4. Maintenance''.
  3. Follow the instructions that start with ``You use MiKTeX Options to register'' two paragraphs before Figure 4.5 and continue to the end. Instead of using C:\Local TeX Files, use the directory you just created.

Thesis/Dissertation PostScript File Exercise

  1. Get the files the example thesis uses and your thesis could use and put them in the misc subdirectory of the inputs directory you just created:
    puthesis.cls
    notoccite.sty
    pulongtable.sty

  2. Do Start => Programs => MiKTeX 2.5 => Settings, click on the General tab, and then click on the Refresh FNDB button to refresh the file name data base so LaTeX knows where these three shared files are. The file name data base is an index containing file names and which directory they're in.

  3. Get the template files if you don't already have them.
    Detailed instructions for this step:
    1. Warning: This step might destroy any template.zip file you now have.
      Get http://engineering.purdue.edu/~mark/puthesis/template/itap-windows-texniccenter/template.zip (last updated March 24, 2007) .
    2. Warning: This step might destroy any template subdirectory you now have.
      Unzip the template.zip file. This will make a template subdirectory. See your local documentation or computer administrator if you need help unzipping the file.

  4. In Windows, double-left-click on template subdirectory.

  5. In Windows, double-left-click on the thesis.tex file---this should automatically start TeXnicCenter.

  6. Do Project => Create with active file as main file.
    Select "Uses BibTeX". This document uses BibTeX to produce its bibliography.
    Select Language ``en''.
    Select Dialect ``US''.
    Left-click OK.

  7. Press F7 key.
    You may get a warning message about subfigure.sty missing---if so, left-click INSTALL. This should automatically try to install a subfigure.sty file from the Internet. If you can't get the file automatically, get it from the Comprehensive TeX Archive Network (CTAN).

  8. Check the Output Bar after LaTeX has processed the document. Errors mean something is probably wrong. Warnings mean something may be wrong. Bad Boxes mean something is taking up too much horizontal or vertical space and may be protruding into the margin.

  9. Press F5 key.
    Yoy may get a warning message about the document can't be rendered properly and be asked if you want to switch to the Dvips render method. Left-click Yes so Encapsulated PostScript figures are properly displayed.

  10. Experiment with clicking some items in the Navigator window, just to the left of the main window. It goes directly to the corresponding location in whatever file is needed.

  11. Experiment with clicking the four icons at the bottom of the Navigator window.

  12. Click on the in the Navigator Window or Output Bar to close those windows and make the edit window bigger. Use the View menu if you want either of those windows back.

  13. Did you notice that the table of contents was empty. On the first run LaTeX collected information for the table of contents. Press F7 again to incorporate that information in your document and F5 if you want to see the new version of your document.

  14. Do File => Exit in the edit window to leave TeXnicCenter.

Thesis/Dissertation PDF File Exercise

  1. Get the ntemplate (note the "n") files if you don't already have them.
    Detailed instructions for this step:
    1. Warning: This step might destroy any ntemplate.zip file you now have.
      Get http://engineering.purdue.edu/~mark/puthesis/template/itap-windows-texniccenter/ntemplate.zip (last updated September 27, 2007) .
    2. Warning: This step might destroy any ntemplate subdirectory you now have.
      Unzip the ntemplate.zip file. This will make a ntemplate subdirectory. See your local documentation or computer administrator if you need help unzipping the file.

  2. In Windows, double-left-click on ntemplate subdirectory.

  3. In Windows, double-left-click on the thesis.tex file---this should automatically start TeXnicCenter.

  4. Do Project => Create with active file as main file.
    Select "Uses BibTeX". This document uses BibTeX to produce its bibliography.
    Select Language ``en''.
    Select Dialect ``US''.
    Left-click OK.

  5. Use Adobe Reader to preview PDF files.
    Detailed instructions for this step:
    1. Do Build => Define Output Profiles...
    2. Left click on "Viewer" tab.
    3. Left click on "LaTeX => PDF" in left hand column.
    4. Insure all the options are like this:
    5. Change the "Path of executable" to be the complete filename to Adobe Reader. I used
          C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32
      on my home computer.
    6. Left click on "OK".

  6. Make sure you have LaTeX => PDF selected at the top of the edit window.

  7. Press F7 key.

  8. Check the Output Bar after LaTeX has processed the document. Errors mean something is probably wrong. Warnings mean something may be wrong. Bad Boxes mean something is taking up too much horizontal or vertical space and may be protruding into the margin.

  9. Press the F5 key.

  10. Notice that the table of contents is empty. On the first run LaTeX collected information for the table of contents. Press F7 again to incorporate that information in your document and F5 if you want to see the new version of your document.

  11. Do File => Exit in the Adobe Reader window to leave Adobe Reader.

  12. Do File => Exit in the edit window to leave TeXnicCenter.

Revised: May 2, 2008
Created: March 12, 2007