MiKTeX (LaTeX compiler, packages, dvips, .dvi viewer, etc.)

The CLAS Linux Group have posted this information on behalf of others. This information is likely dated. Use at your own risk.

Getting the files

  1. Go to the MiKTeX home page: https://miktex.org/
  2. Follow the "Download" link.
  3. Get complete.exe and the Update Package.
  4. Consider subscribing to the mailing lists (one for Q/A, one for update announcements).
  5. Other info there: documentation, info on TeX/LaTeX editors (I use and recommend TextPad), etc.

Installation & configuration

  1. Run complete.exe. I strongly recommend doing the typical installation (which installs everything and needs about 40 MB). If you are tight on disk space, you can install only certain files. Roughly in order of importance, here's the minimum I recommend: Fundamental Files, graphics, AMS-LaTeX, PSUtils, AMS (Type 1), float, psnfss, tools, Eplain Macros, hyperref, pdfTeX, Computer Modern Postscript Fonts
  2. Re-start your computer after installation (to let your new autoexec.bat kick in).
  3. Run update.exe.
  4. Edit the settings in \texmf\dvips\config\local\config.ps to fine-tune things for your printer. This part is a little confusing, but here are a few pointers to hopefully make it simpler:
    (THIS IS THE MOST IMPORTANT) Look for this section:

    ;;; If your default is a4 uncomment the following definition
    ;;; and comment out the letterSize definition.

    @ A4size 210mm 297mm
    @+ %%PaperSize: A4

    ;@ letterSize 8.5in 11in

    Change which lines are commented so it looks like this:

    ;;; If your default is a4 uncomment the following definition
    ;;; and comment out the letterSize definition.

    ;@ A4size 210mm 297mm
    ;@+ %%PaperSize: A4

    @ letterSize 8.5in 11in

    Look for this section:

    ;;; METAFONT mode to be used when generating fonts.
    M ljfour

    This "mode" (ljfour) will probably work okay (especially if you have a Laserjet printer), but if you notice anything funny going on later in your printouts, you might want to change the mode to something else that better matches your printer. The best advice I have is to look at the file \texmf\metafont\misc\modes.mf and search for your printer make & model. Then look for a line like mode_def = ... for your printer and replace ljfour in config.ps with the new mode (eg., you might needljfive, ljfivemp, deskjet, etc.).
    Look for this section:

    ;;; Vertical and horizontal resolution.
    D 600

    Change the 600 if necessary to match the resolution (dpi) of your printer.

  5. Important: From the start menu, do Start > Programs > MiKTeX > Maintenance > Refresh Filename Database. You should do this every time you do one of the following:
    Install or update Ghostscript/GSview.
    Add any files (eg. new LaTeX .sty files or other packages) to the \texmf or \localtexmf directory structures.
    Get suspicious that something isn't working quite right (refresh the filename database early and often!)
  6. Start the DVI Viewer (YAP) that comes with MiKTeX (Start > Programs > MiKTeX > DVI Viewer). Select Tools > Options from the menu. In the "Display" tab, choose a "Mode" which most closely matches your printer (try to choose one that matches what you selected for \texmf\dvips\config\local\config.ps). For "Paper Size", choose "Letter". In the "Printer" tab, select the same "Mode" as you did for the "Display" tab.
  7. If you have any new packages (LaTeX .sty files, etc.) that you want to use, you should add them to the \localtexmf directory structure.
    Maybe it's just superstition, but I typically create a subdirectory \localtexmf\tex\latex\<package name> whenever I add a new package, put my new .sty and other files in that directory, and refresh the MiKTeX filename database (see above).
    If you have a more complicated package to add, it will hopefully come with documentation to help you.
    When in doubt, scan through the \texmf directory structure, guess where things would probably fit in there, and put your files in analagous directories under \localtexmf.
    Alternatively, you can place .sty files in the same directory as your .tex document. (This might make more sense anyway, if you want to keep everything together).