Research Computing >> Software >> TEX, LATEX >> MiKTEX installation
The following instructions are based on an installation in a Windows 2000 workstation. It goes through the steps necessary to install MiKTeX, GhostScript and GhostView (necessary tools to deal with PostScript files), a text editor (WinEdt) and a utility to convert Windows Metafile (WMF) graphics into Encapsulated PostScript graphics (WMF). If you have suggestions about this page and tips that might help other users, please e-mail them to email@example.com.
For Emacs installation in a Windows NT environment, refer to Installing and Running NTEmacs/AucTeX with MikTeX, a page written by Kent Daniel.
Please note that Research Computing does not troubleshoot problems with LATEX, MiKTEX or Scientific WorkPlace documents.
- Go to the MikTeX web page (www.miktex.org) and choose "Download", "Stable Release" on the left panel. Click on "MikTeX Install now" and save the file ("setup.exe") to a temporary directory in your computer.
- Launching "setup.exe" will start the MikTeX installation wizard. Click on "Next" and select "Download only".
- MikTeX offers three package sets. We suggest you choose the "Large" option. The "Total" option includes the source code to all the packages.
- The MikTeX installation wizard will then present a list of possible servers for download. Scroll down and select a location within the US.
- Select a destination folder in the hard drive (for example, "c:\temp\miktex") and start downloading. This should take a few minutes, after which the wizard will finish.
- Open the folder where the MikTeX packages were downloaded. Double-click on "setup.exe". This will launch the installation wizard once again.
- Choose "Install", "Large package set". If the wizard does not display the correct path to the downloaded files, click on browse to find that folder.
- The next decision is whether to install a shared or private MikTeX environment. We suggest that you choose to "Install a shared MikTeX environment". MiKTeX distinguishes not only among different users, but also between local and network logins. Thus, if you installed the software while logged on to the Kellogg network and then decide to login locally to your machine, you would be unable to run MiKTeX unless the installation is shared.
- The installation wizard will prompt you to select two directories: a "texmf" and a "localtexmf". The "localtexmf" directory will contain any customizations and packages you add. We suggest you create a "tex" directory where "texmf" and "localtexmf" will be subdirectories. The installation wizard can do this for you, as long as you type "\tex" before the suggested location (i.e., write "c:\tex\texmf" instead of "c:\texmf", and "c:\tex\localtexmf" in place of "c:\localtexmf"). The installation itself will take a few minutes.
- Once the installation is finished, open the c:\tex\localtexmf folder and create two folders named "bibtex" and "tex". Open the "tex" folder and create a "latex" folder inside. This reproduces the same directory structure as in c:\tex\texmf. In the "c:\tex\localtexmf\bibtex" directory you can keep you BIB files and related material; install any new packages in "c:\tex\localtexmf\tex\latex" .
Using MiKTeX and Scientific WorkPlace:
If you also use Scientific WorkPlace and want to be able to edit files using both environments:
- Copy the "tcilatex.tex" file from the "\swp50\TCITeX\TeX\LaTeX\SWmacros" directory to "\tex\localtexmf\tex\latex".
- To make MikTeX register this change, launch the "MiKTeX Options" program (the installation wizard creates a MiKTeX group under Programs) and select the "General" tab. Click on the "Refresh Now" button under "File name database". If you prefer line commands, open a command window and type "
initexmf -u" at the command prompt (or from a Start, Run prompt).
Scientific WorkPlace will be able to read files modified in MiKTeX, unless there is a LaTeX related error -- Scientific WorkPlace will then truncate the file. Should this happen, do not save the document; read it in a text editor, find and correct the LaTeX error.
Note also that Scientific WorkPlace (under the Typeset, Expert Settings menu) allows you to change the default printer driver settings (the LaTeX formatter) and the Preview Settings (the DVI viewer) from the default TrueTex formatter and DVI viewer to the MiKTeX formatter and DVI viewer (YAP) or other equivalent tools. This is documented in the Scientific WorkPlace manuals and in the SWP 'unofficial homepage' (for SWP 3.0).
Adding a package:
One of the advantages of MiKTeX is that the addition of LaTeX packages is relatively transparent (vis à vis other LaTeX installations). Most packages can be added using the MiKTeX Package Manager, included in the MiKTeX installation, by selecting the package from a list and adding it. In additional pages, we have example of how to install the eurosans package and the setspace package.
The example below shows how to install a package not included in the Package Manager list: the "prosper" class to create LaTeX transparencies. When this page was originally written, "prosper" did not appear in the Package Manager.
- Point your browser to the www.ctan.org web site.
- Click on "Search" and look for "prosper"
- Prosper will be in "macros/latex/contrib/supported/prosper". Click on the corresponding link and, in the next page, click on "entire directory".
- Next, you will be prompted to select a location from which to download. Select, for example, the tug.ctan.org (Colchester, Vermont) site.
Note: CTAN places a "cookie" in "C:\Documents and Settings\netid\Cookies" called "firstname.lastname@example.org" (where netid is your netid) that keeps the location you selected for download. In subsequent visits, you will not be prompted to choose a location unless you delete that cookie.
- The next page will allow you to download the entire directory as a ZIP file (click on ".zip"). Download this file to "c:\tex\localtexmf\tex\latex".
- Extract the files. If your ZIP utility asks you whether to restore the original folders, do so. This will create a subdirectory in localtexmf\tex\latex called "prosper".
- To make MikTeX register this addition, launch the "MiKTeX Options" program (the installation wizard creates a MiKTeX group under Programs) and select the "General" tab. Click on the "Refresh Now" button under "File name database". If you prefer line commands, open a command window and type "
initexmf -u" at the command prompt (or from a Start, Run prompt).
- If interested about some further information about this particular package, please refer to the Prosper web page or to the lecture notes for the LaTeX workshop.
GhostScript and GhostView are a PostScript language interpreter and viewer, respectively. They can be downloaded from www.cs.wisc.edu/~ghost. These tools are indispensable to deal with PS files if you use MiKTeX, but are also handy to view PS files or to determine the bounding box of an EPS graphic when trying to define it in a LaTeX document.
- Download both programs to a temporary directory in your computer.
- Install GhostScript first, by double-clicking on "gs700w32.exe". The installer will ask you to select a destination, for example, "c:\Program Files\gs" and whether you want to add a shortcut to the program to the "All users" profile (so that anyone logged into your workstation may see the program).
- Next, install GhostView, by double-clicking on "gsv40w32.exe". The installer will offer the choice of associating PS and EPS files with GhostView (option selected by default) and also the possibility of associating PDF files with GhostView. We suggest that you leave PDF files associated with Acrobat. The installer will also prompt for a location (for example, "c:\Program Files\Ghostgum") and whether to add a shortcut to the "All users" profile.
- After installing GhostScript and GhostView, right-click on "My computer" and select "Properties" from the context menu (alternatively, open the "System" control panel). Select the "Advanced" tab and click on the "Environment variables" button. Under user variables, select PATH and click on the edit button. Add the following two directories to the path: "C:\Program Files\gs\gs7.00\bin" and "C:\Program Files\Ghostgum\gsview" (without quotes and making sure there is a semi-colon between each directory. Your path could look like the following:
C:\tex\texmf\miktex\bin;C:\tex\localtexmf;C:\Program Files\SSH Communications Security\SSH Secure Shell;c:\sqlany50\win32;c:\sqlany50\win;C:\Program Files\gs\gs7.00\bin;C:\Program Files\Ghostgum\gsview
This step makes GhostView and GhostScript available to MiKTeX and for use from the command line.
There are several good editors (such as Emacs or WinTeX) that can be used with LaTeX (refer to our page on text editors). Here we suggest the use of a shareware program ($40 per license) called WinEdt, which works well with MiKTeX. Note that if you do not register the program, after one month WinEdt will start prompting you to register about every couple of minutes while you have the program open.
WinEdt comes with several batch files that use the programs installed with MiKTeX and associate them with buttons in WinEdt.
- Download the WinEdt installer from www.winedt.com to a temporary directory in your hard drive (for example, c:\temp).
- Double-click on the downloaded file (winedt5.exe) to expand the installation files. You may expand them to a subdirectory, for example, "c:\temp\winedt".
- If you uncompressed to "c:\temp\winedt", open that folder and double-click on "setup.exe". That will install this editor and create the WinEdt group under the Programs menu.
As mentioned, WinEdt has several convenient features in its default toolbar:
One can compile the current document by clicking on the "texify" button. This will launch MikTeX's DVI viewer, YAP, displaying the compiled document. To convert this to a PDF file, click on the DVIPS button, and then on the PS2PDF button (which uses GhostScript to convert the PS file into a PDF file). The latter will also launch Acrobat.
The batch files used by WinEdt can be found in "c:\Program Files\WinEdt\Bin".
MikTeX cannot handle Windows Metafiles (WMF, for example, Maple images generated in Scientific WorkPlace). wmf2eps is a shareware utility ($20) to convert Windows Metafiles (WMF) into Encapsulated Postscript (EPS) files. You can perform this conversion by downloading the WMF2EPS shareware utility ($20).
- Download WMF2EPS to a temporary directory in your hard drive.
- expand the downloaded file ("WMF2EPS1.32.ZIP") to the directory of your choice, for example, "c:\Program Files\wmf2eps".
- WMF2EPS requires a postscript driver. You may install the (pseudo)-printer-definition file shipped with the program, "WMF2EPS2.PPD", which uses the built in standard PostScript driver of Windows 2000. The following instructions come from the "Troubleshooting" section in the program's help files:
- Double-click on "Add printer" under "Settings", "Printers" in the Start menu. Add a local printer and select "FILE:" as the port. Then select "Have disk" and click on the "Browse" button to point to "c:\Program Files\wmf2eps\PSprint\Win2000\Standard\W2kPrint.INF". Windows will display the name of the selected printer (WMF2EPS Color PS L2). Click on "next". Windows will allow you to change the name of the printer and also if the printer will be the default ("No" should be selected). In the next two screens, select "Do not share this printer" and do not print a test page.
- "WMF2EPS Color PS L2" appears now in the list of printers. Right-click on its icon and select "Properties" from the context menu. In the "General" tab, click on the "Printing Preferences" button and then on the "Advanced" button. As shown in the graphic below, there are two options you need to change: (1) Under "Paper/Output", make sure the Paper Size is set to "Postscript Custom Page Size". (2) Under "PostScript Options" look for the "PostScript Output Option" (if you do not see anything under PostScript Options, click on the "+" next to it to expand the sub menu) and select "Encapsulated PostScript (EPS)". Click on "OK" to apply the change and close the properties dialog box.
- You may add the program's path ("c:\Program Files\wmf2eps") to the user environment variables as discussed in the GhostScript installation section (#4), which enables you to call the program from any command window.
- Since WMF2EPS does not create a group under the Start menu, you may manually add a shortcut to the program, (c:\Program Files\wmf2eps\wmf2eps.exe) to one of the existing groups.
Converting an Excel chart to EPS with wmf2eps
- In Excel, select your chart and copy it.
- Launch wmf2eps and select "Edit" > "Paste". You will see a window that gives you a choice between WMF or EMF. Click on "Paste WMF". WMF2EPS will prompt you to save the WMF file -- chose a location and save it. The name you give to the WMF will be the same given to the EPS version.
- You should now see your graphic in WMF2EPS. To proceed with the conversion, either click on the "Convert Graph" icon (see mouse pointer in the screen shot below) or select "Current" from the "EPS-conversion" menu.
Converting a WMF to EPS with wmf2eps
- Launch wmf2eps.
- Under the EPS-Conversion menu, select "Conversion Setup":
Under "EPS processing", click on change and select "WMF2EPS Color PS L2" from the list of printers. This setting will be stored by the program for future use.
- Choose "Open Graphics" from the file menu to select the WMF file to be converted.
- Once the graphic is open, select "Current" from the "EPS-Conversion" menu. wmf2eps will translate the file to EPS, saving it with the same name (with extension EPS) in the same directory where the original file is. When the conversion is done, wmf2eps produces a sound.
- Batch conversions: If you have to convert various WMF files in a directory, "Open Graphics" in the File menu allows you to select several WMF files at a time. All the selected WMF files will be open. To convert them to EPS, select "All files" from the EPS-Conversion menu.
Other useful utilities
- Excel2LaTeX: This is an add-in that allows you to convert Excel tables into Latex tables (tabular environment). This add-in is also available in CTAN. To install it, simply download and save in a directory in your PC. Open Excel, select "Add-ins" from the Tools menu. Click on the Browse button and locate Excel2Latex. Click OK.You will find a new menu item (Convert Table to LaTeX) under the Tools menu.
- TeXaide: A Graphical user interface to create LaTeX equation which you can then paste into a document.