Resources
Using TeX in the UITS Windows NT Sites
This document describes the use of TeX/LaTeX, etc. in the Indiana University Bloomington UITS Public Computing Sites running Windows NT. The author of each topic is indicated; please refer questions about the content to the author, not the maintainer of this page (unless they happen to be the same person). Please direct problems with accessing or viewing this page to Jonathan Duncan.
Contents
- General Information
- Printing the DVI File
- Automatic Font Generation
- More Advanced Stuff
- Resources
- Reporting Bugs
General Information
Welcome to the UITS STC/Mathematics Department TeX installation. This is departmentally sponsored non-supported special request software.
Description
The original TeX program was written by Donald Knuth and the LaTeX macro packages by Leslie Lamport. These programs have become the standard for mathematical typesetting. They are provided here as non-supported special request software for use by faculty, staff, and students who need to typeset research papers and prepare classroom notes and tests with complicated mathematical content. If your document contains fewer than five equations and you don't already know how to use TeX, you may be better off using fully supported software such as WordPerfect. TeX and LaTeX are not mouse driven programs and they cannot be learned by experimentation without reading a book or looking at examples.While the core TeX program is the same everywhere, different suppliers provide it along with fonts, previewers, tools, and so forth. Such a collection of programs that includes TeX is usually called a distribution. The distribution that we have installed on these computers is MiKTeX 1.20, built by Christian Schenk. The project web page is located at http://www.snafu.de/~cschenk/miktex/index.html. Actually, what we have here is a slightly stripped down version of the full distribution. For those in the know, we have installed the following components: All level-1 components; All level-2 components except latexger.zip; pdftex.zip.
This particular installation provides the Plain TeX and LaTeX2e formats. LaTeX2e is 99% compatible with LaTeX 2.09 (i.e., earlier versions of LaTeX) documents. If your document doesn't work, there are two possibilities. One, you are doing something strange with macros that you shouldn't be doing in the first place. Two, you are using a macro package that somebody else wrote that is doing something strange. In this case, you should find out if there is a newer version of the macro package. It is rare that this happens. The AMSTeX format is not provided in this installation. However, AMSLaTeX is provided as a package for LaTeX2e; this provides all the functionality of AMSTeX. Likewise, the AMSFonts package is also available, if you want to use the AMS fonts such as blackboard bold without loading in the AMSLaTeX package. AMSLaTeX is version 1.2, and AMSFonts is version 2.2. See the notes at the end of this documentation for references on how to use TeX/Latex/AMSLaTeX.
Basic Operation
There are four commands relating to TeX that are available from the Windows NT Command Prompt. These are tex, latex, yap, and dvips. yap should also be available from the Start Menu. Use an editor like notepad or emacs to edit your document. Then open a command line window (Start->Programs->Utilities->Command Prompt); this will open a window that is running the Windows NT command line interpreter which is very similar to MS-DOS. If you are familiar with the X window system, think of it as an xterm, but with a DOS style command line instead of Unix. Use the cd command to change to the directory with your document (don't forget that under Windows NT, '\' is used with directories, not '/'), and then run tex or latex from the command line by typing:tex filename.texor
latex filename.texas appropriate. Both commands produce a "device indpendent" (DVI) file called filename.dvi. You can also produce PDF files by running either pdftex or pdflatex. While PDF is a better format for putting documents on the web, DVI files tend to be smaller and look better. To preview and print the document use yap if you generate DVI files or Adobe Acrobat Reader if you generate PDF files. dvips can be used from the command line to convert your TeX document to PostScript; in general, though, you can do this from within yap.
Because these programs were compiled for use under Windows NT, they should understand long filenames. However, the Student Lockers do not understand long filenames, so if you are using your Student Locker, you should avoid them by using the DOS "8.3" filename convention. That is, the filename must consist of at most 8 characters, followed by an optional period and three letter extension. So, for example, final.tex is safe, but m118final.tex and final.texdoc are not. Using the short filenames is also important if you plan on saving your work to floppy disk for use on other computers.
Hints
Probably the easiest sequence of edit/tex/view/edit is to edit your file using one of the Windows editors, run tex or latex from the Command Prompt, then start up yap from the Startup Menu. Note that you do not need to exit the editor, the MS-DOS window, or yap during the cycle of edit/tex/view/edit; yap will automatically reload the DVI file if it has changed (e.g., if you have just re-run tex). yap will automatically generate any fonts your document requires that are not supplied by the system, as well as display any embedded PostScript images.
Search Paths
The TeX installation under NT conforms to the TeX Directory Structure. Since many people have their own private macro files, or may wish to use a package not supplied with this TeX installation, a provision has been made for searching student lockers, provided you have logged onto your student locker account. By default, your student locker will be searched after the system input directories; this is because of some technical issues with the installation. The following indicates the paths searched, in order, for the various components of TeX (directories on r: drive are part of the installation--you can look at them, but you can't change them). "The current directory" means whatever directory you are in when you run tex. After the current directory, the sequence of paths is first searched on r:, then m:\texmf (if you have logged onto your student locker and the directory exists), then c:\temp\texmf. So latex will search for input files in the current directory, then r:\texmf\tex\latex, r:\texmf\tex\generic, r:\texmf\tex, m:\texmf\tex\latex,..., c:\temp\texmf\tex. Note that dynamically generated files (such as font files) will always be placed in an appropriate subdirectory of c:\temp\texmf.- Input files:
- The current directory.
- \texmf\tex\latex (latex only) or \texmf\tex\plain (tex only) and all subdirectories.
- \texmf\tex\generic and all subdirectories.
- \texmf\tex and all subdirectories.
- Format files (note that if you are adventurous, you can build your
own formats, and they will be located before the system formats):
- The current directory.
- \texmf\miktex\fmt and all subdirectories.
- TFM Font files:
- The current directory.
- \texmf\fonts\tfm and all subdirectories.
- PK Font files (dpi indicates the font resolution):
- The current directory.
- \texmf\fonts\pk\ljfour\...\dpidpi.
- METAFONT Input files:
- The current directory.
- \texmf\metafont and all subdirectories.
- \texmf\fonts\source and all subdirectories.
LaTeX Packages
The following LaTeX2e packages are provided with this installation:
- AMSLaTeX 1.2r. Provides extended facilities
for formatting mathematics. This also provides the various
AMS document classes for submissions to AMS journals.
Package name:
amslatex, along with other packages to selectively load components. Documentation: r:\texmf\doc\latex\amslatex\amsldoc.dvi. - AMSFonts 2.2. Provides the Euler (including
Fraktur), Cyrillic, and Blackboard Bold fonts, along with some
extra Computer Modern fonts. Package name:
amsfonts,amssymb. Documentation: r:\texmf\doc\fonts\amsfonts\amsfonts.dvi. - Babel 3.6. Facilities for typesetting in
non-English languages. Package name: various (e.g.,
german,french). Documentation: r:\texmf\doc\generic\babel\user.dvi. - Graphics. Facilities for
including graphics and doing "graphics-like" operations in
LaTeX. Especially good for including PostScript graphics.
This package is set up by default to use
dvipsas an output device. Package name:graphics. Documentation: r:\texmf\doc\latex\graphics\grfguide.dvi. - Tools. Just what it says. This is actually a slew of miscellaneous packages, most of which provide improvements over basic LaTeX environments. Documentation: in r:\texmf\doc\latex\tools. You will have to look at everything to see if there is something you want here.
- Hypertext Referencing. You turn labels into
hypertext links, provided the DVI previewer supports it. For this
installation, you should use pdftex. Package name:
hyperref. Documentation: r:\texmf\doc\latex\hyperref\manual.pdf. - PSNFSS. Allows you to use PostScript fonts in
your document instead of the standard Computer Modern fonts.
Package name: various (e.g.,
times,helvetica). Documentation: none (you're on your own for this).
Programs Provided
The following is a list of the programs provided by this installation that
most users might need. There are also a slew of font-related programs
(e.g., afm2tfm, gftopk, etc.) that aren't
mentioned here; if you don't know what they are, you probably don't need
to.
-
tex,pdftex,latex,pdflatex: You should already know what these are. -
yap: DVI previewer. Please save paper by using this almost exclusively to see your document. You can also print from this program. -
dvips: DVI to PostScript converter. For the most part you should not need to use this directly unless you have special needs for converting to PostScript. -
bibtex: A bibliography database management tool for use with LaTeX. -
makeindex: An index-preparing tool for use with LaTeX.
Documentation
There is a fair amount of documentation available in this installation. In the above discussion of the various packages available, the location of the documentation of each package is indicated. The root directory for all documentation is r:\texmf\doc; all documentation is in subdirectories of this directory. The documentation comes in both plain text and DVI files. The following is a list of some of the documentation that is not specific to LaTeX packages:
- BiBTeX: r:\texmf\doc\bibtex\base\btxdoc.dvi.
- DVIPS: r:\texmf\doc\dvips\dvips.dvi.
- MakeIndex: r:\texmf\doc\makeindex\makeindex.dvi.
- MikTeX (a.k.a. general information about this installation): r:\texmf\doc\miktex\miktex.hlp (windows help document) or r:\texmf\doc\miktex\miktex.html (Netscape or IE document).
License and More Information
Eric Olson, Norman Danner
Back to the Top
Printing the DVI File
DVI files can be printed either from yap or using dvips. Printing from yap is just like printing from any other Windows application; select File->Print..., select the pages you want, and click on "OK".
If your document contains PostScript and you select File->Print..., yap will tell you that you must use File->Print PostScript... (yes: it can tell what menu option you should have chosen, but cannot choose for you). In the dialogue box that appears, "Print to File" should be selected, even though you want to print to a printer. The "file" field should be filled in with a rather bizarre looking name, which actually stands for the default printer for the workstation you are logged on to. If you want the PostScript output to go to an actual file, just change the name to the file you want to use.
You can also use dvips from the command line to convert your DVI file to a PostScript file. This means learning the command line options for dvips. If you run the program with no arguments (not even a filename), it will print a summary of the usage; for more information, see the documentation in r:\texmf\doc\dvips\dvips.dvi.
Norman Danner
Mon Jul 7 17:01:13 EST 1997
Back to the Top
Automatic Font Generation
Automatic font generation is supported by both yap and dvips. What this means is that if you typeset a document that requires a font at some size that is not supplied by the system installation, the PK font at the necessary size will created automatically for you. This also means that if you want to, you can use your own fonts (provided you have the METAFONT source for them), and, provided you have the METAFONT source correctly installed in your student locker, these fonts will also be automatically generated (even the TFM files, when you run tex). A couple things are worth pointing out:
- Fonts can only be generated if the METAFONT source is available. For the font families provided by this installation (Computer Modern, LaTeX, and AMSFonts), this is already taken care of; if you want to use a different font family, you'll need to get the source yourself.
- If you find yourself needing to have fonts generated regularly, it would be a good idea to store copies of the generated fonts on your student locker. When a font is generated, it is placed in c:\temp\texmf\fonts\pk\ljfour\...\dpidpi, where dpi is the size of the font. If you copy the font file (which will be named something like cmr10.pk) to m:\texmf\fonts\pk\ljfour\...\dpidpi, then that font will no longer have to be generated each time you need it.
Norman Danner
Tue Aug 19 22:57:45 EST 1997
Back to the Top
More Advanced Stuff
Filename Database
All of the programs can make use of a "filename database" for finding input files (including font files). This significantly speeds up processing when input files can be found in many possible subdirectories (such as when searching for font files). If you notice tex or latex running very slowly when it has to find input files on your student locker, you may wish to create a filename database for it. To do so, type initexmf --update-fndb=m:\texmf. For more on the initexmf command, see the MiKTeX online documentataion.Norman Danner
Thu Jul 8 21:43:25 EST 1999
Back to the Top
Personal Configuration
MiKTeX is highly configurable with respect to search paths, where dynamically generated files are placed, etc. If you want to learn more, look at the entries under "MiKTeX Configuration Files" and "The MiKTeX Configuration Utility" in the MiKTeX documentation.Using TeX with Emacs
As you may know, Emacs provides commands that allow you to run TeX on documents, and view and print the resulting .dvi files. Some of the more important commands are:
`C-c C-f'
Invoke TeX on the current file (`tex-file').
`C-c C-k'
Kill the TeX subprocess (`tex-kill-job').
`C-c C-p'
Print the output from the last `C-c C-r', `C-c C-b', or `C-c C-f'
command (`tex-print').
`C-c C-v'
Preview the output from the last `C-c C-r', `C-c C-b', or `C-c
C-f' command (`tex-view').
(this is copied verbatim from the on-line Emacs documentation, under
"TeX Mode").
As printing and viewing are machine-dependent, some variables need to be set in order that the above commands work properly. If you put the following lines into a file called _emacs on your student locker, then everything will be set correctly:
(add-hook 'tex-shell-hook
(function (lambda ()
(auto-fill-mode 0)
(setq tex-dvi-view-command "yap *")
(setq tex-dvi-print-command "dvips *")
(defun tex-set-up ()
(shell-command "set PATH=%PATH%;r:\texmf\miktex\bin")))))
(add-hook 'latex-mode-hook
(function (lambda ()
(setq tex-file "latex *"))))
Norman Danner
Tue Aug 19 22:45:43 EST 1997
Back to the Top
Resources
Books
There are a number of books available for using TeX and LaTeX. You should almost definitely pick up one or two; on-line resources will almost never be sufficient.The TeXbook, by Donald Knuth (Addison-Wesley) is the standard book on TeX. However, it might not be the best for learning from, although some (including the author of this web page) swear by it.
LaTeX: A Document Preparation System, by Leslie Lamport (Addison-Wesley) is the standard reference for LaTeX; there is now a LaTeX2e version out.
The LaTeX Companion, by Michael Goosens, Frank Mittelbach, and Alexander Samarin (Addison-Wesley) is a reference for LaTeX2e; it assumes knowledge of LaTeX 2.09. It has a nice discussion of the major packages, and is basically required if you need to do anything slightly beyond the basics with LaTeX.
Math into LaTeX2e: An Introduction to LaTeX and AMSLaTeX, by George Gratzer, is a reference for using AMSLaTeX 1.2 with LaTeX2e.
Online Resources
- A LaTeX Quick Start guide is available. This guide is designed to get you writing a LaTeX document as quickly as possible, instead of completely explaining how LaTeX works. It is under development, so please feel free to send the author comments about it.
- The TeX User's Group Frequently Asked Questions. This is a searchable document, but it is located in England, so during the day it is likely to be a very slow link.
- LaTeX2e Command Reference. This is much more a command reference than a tutorial.
- LaTeX2e Classes and Packages. This has documentation for all of the classes and many of the packages that come with LaTeX2e, and well as documentation for all LaTeX2e (not TeX) commands. Some of it is "source code documentation", which is very technical and detailed.
- Lists of symbols. These documents are in PostScript format; when you click on a link, an external viewer should be spawned. Most relevantly, this means you probably can't view these files if you are using a text-based browser.
- The MiKTeX online documentation. You can find this as a Windows Help file under the Start Menu (Start->Departmentally Sponsored-> Math->MiKTeX->Help->MiKTeX Guide), or you can look at the HTML version.
Norman Danner
Thu Jul 8 21:43:25 EST 1999
Back to the Top
Reporting Bugs
This TeX installation is considered "unsupported" software, so UITS is not responsible for providing support. However, if you find a serious bug in the installation, please let Jonathan Duncan (joduncan@indiana.edu) know. Please do not direct general questions about how to use TeX, where to find macros, etc. to Jonathan. Acceptable questions are ones like "TeX says 'Fatal format error' when I run it. What do I do?" Unacceptable questions are ones like "How do I get rid of the page numbers in my TeX document?"
Norman Danner
Thu Jul 8 21:43:25 EST 1999
Back to the Top

