Running LaTeX on Your Windows Computer
July 4, 2013
Mark Senn

## Installing LaTeX

I now recommend using TeX Live instead of MikTeX. TeX Live is also available for Linux and Unix. MacTeX is based on TeX Live and is for Macs. See TeX Live and Installing TeX Live 2011 on Windows 7 for instructions on how to install TeX Live. Ignore the below instructions—they are all about MikTeX.

1. Go to http://www.miktex.org/2.9/Setup.aspx and click on Download "Basic MiKTeX" Installer''. Run it and accept all defaults except select Preferred paper: Letter''.
Detailed instructions for this step:
1. Goto http://www.miktex.org/2.9/Setup.aspx.
2. Click on Download "Basic MiKTeX" Installer''.
3. Save the basic-miktex-2.9.4250.exe file. Note where it is being saved so you can left-double-click on it in the next step.
4. Left-double-click (press left mouse button twice in rapid succession) on basic-miktex-2.9.4250.exe.
5. Copying Conditions
Read the Copying Conditions''.
Left-click on the I accept the MiKTeX copying conditions.'' check box.
Left-click the Next'' button.
6. Shared Installation
Left-click on the Anyone who uses this computer (all users)'' radio button.
Left-click the Next'' button.
7. Installation Directory
Left-click the Next'' button.
8. Settings
Change the Preferred Paper:'' drop down box to Letter''.
Left-click the Next'' button.
9. Information
Left-click the Start'' button.
10. Executing
Wait until the Next'' button is highlighted---this may take a several minutes depending on speed of your computer.
Left-click the Next'' button.
11. Completing the MiKTeX Setup Wizard
Ignore the To exit the wizard click Finish.'' message.
Left-click the Close'' button.
2. Update the miktex-bin package.
Detailed instructions for this step:
1. Do Start => Programs => MiKTeX 2.9 => Update to start the MiKTeX updater.
2. Left-click the Next'' button.
3. Left-click the Next'' button.
4. Select only the miktex-bin package.
5. Left-click the Next'' button.
6. Left-click the Finish'' button.
3. Update all packages.
Detailed instructions for this step:
1. Do Start => Programs => MiKTeX 2.9 => Update to start the MiKTeX updater.
2. Left-click the Next'' button.
3. Left-click the Next'' button.
4. Select all packages.
5. Left-click the Next'' button.
6. Left-click the Finish'' button.
4. Go to http://www.texniccenter.org/resources/downloads/29 and left click on TeXnicCenter 1 RC 1 Installer''. Run it and accept all defaults except select Create a link on the desktop''.
Detailed instructions for this step:
2. Left-click on SourceForge.net'' next to TeXnicCenter Setup, Version 1 Beta 7.01 ('Greengrass')'' in the Downloads'' column.
3. Save the TXCSetup_1Beta7_01.exe file. Note where it is being saved so you can left-double-click on it in the next step.
4. Left-double-click on TXCSetup_1Beta7_01.exe.
5. Welcome to the TeXnicCenter Setup Wizard.
Left-click the Next'' button.
Left-click on the I accept the agreement'' radio button.
Left-click the Next'' button.
7. Select Destination Location
Left-click the Next'' button.
8. Select Components
Left-click the Next'' button.
Left-click the Next'' button.
Select Create a link on the desktop''.
Select Add TeXnicCenter to the 'Send To' menu''.
Left-click the Next'' button.
Left-click the Install'' button.
12. Completing the TeXnicCenter Setup Wizard
Left-click the Finish'' button.

## Running LaTeX

TeXnicCenter should now be installed. Below are three exercises to get familiar with it.

### Short Device-Independent File Exercise

1. Left-double-click on the TeXnicCenter icon on the desktop to start TeXnicCenter.

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

I've had one report stating using "Local TeX Files" didn't work but "LocalTeXFiles" (note no spaces) did. I have not tested this. You may want to use "LocalTeXFiles".

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.9 => 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.9 => 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/my-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/my-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.

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
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.