Using TeX and LaTeX This document explains the use of TeX and LaTeX on the Departmental sun machines. It is not intended to teach users how to format documents. See the section on User Guides for more information. Please take the time to read through the entire document - it's not very long. NOTE that TeX and LaTeX are not the departmental standard documentation systems (use mkdoc et al.), and the Computing Officers will not answer questions on TeX or LaTeX. 1. Getting Started ------------------ As an older version of TeX has been in existance for some time, users may be in one of three categories as far as getting started with TeX is concerned. 1) The user needs to do nothing - TeX is already set up correctly, 2) the user needs to add a single command to a dot file, and 3) the user has an outdated TeX setup which needs to be modified. The first two cases require similar action - that is examining the .bashrc or .cshrc files to see if the line texsetup is present. If it is not, then this line should go after the comment line in the appropriate file (.bashrc for bash users and .cshrc for tcsh users) indicating the place for users to insert their own alterations. This will give the user access to the TeX suite of software. (You may need to log out and log in before being able to use TeX or LaTeX). The third category of user will have sets of lines defining environment variables such as TEXFORMATS, TEXINPUTS, MFINPUTS, MFBASE, etc. in the .bashrc or .cshrc files. The lines referring to /usr/local/pack/tex should be removed, and replaced with the texsetup command as outlined above. Note that some users will want to include one of their own directories in TEXINPUTS. If this is the case then it should be added to the environment variable after the texsetup command using a line such as setenv TEXINPUTS "/home/fred/tex:$TEXINPUTS" or export TEXINPUTS="/home/fred/tex:$TEXINPUTS" 2. Usage -------- To run LaTeX on a file simply type latex filename.tex Similarly, TeX may be run on a file by typing tex filename.tex Users with more specific font requirements may wish to use a modified version of LaTeX, called NFSS Latex. For these users, a third command may be invoked, namely nfsslatex filename.tex A completely new version of LaTeX, LaTeX2e, has been introduced. The system is available by using the command line latex2e filename.tex Support for this final system is just getting off the ground, so don't expect miracles with it yet. Running any of these commands will produce, assuming no fatal errors, a device independent (dvi) file with the extension ".dvi". This file may be previewed, or converted to PostScript. To preview a file, use the command xdvi filename.dvi on a workstation. This will start up a new window displaying the formatted document. The document may be converted into PostScript for printing, or previewing using ghostview, with dvips. To print the file, simply type dvips filename.dvi | lpr -Pps5 or dvips -Pps5 filename.dvi using the name of your favourite PostScript printer. The PostScript file may also be saved by redirecting the output to a file instead of piping to a printer, that is dvips filename.dvi > filename.ps [ Note that if a particular font size is not available, dvips may take longer than normal to convert a file as it will attempt to create the font at that size. Once created, the font will be available for further invocations of dvips, and no delay will be experienced. ] If you wish to produce 2-up or 4-up documents on ps5 or ps6, then it is suggested that you use the command dvips -Pps5x2 filename.dvi or dvips -Pps5x4 filename.dvi as this will improve the quality of the resulting output. 3. Support ---------- Support for the TeX software is currently being carried out by Dave Laurenson (D.I.Laurenson@ee.ed.ac.uk). Users who have problems running these programs should contact him - Note however, that this support extends only to the programs and associated style files. Users wishing assistance with formatting a document should consult a User Guide before contacting the support. 4. User Guides -------------- The definitive guide to document writing using LaTeX can be found in "LaTeX - A Document Preparation System" written by Leslie Lamport and published by Addison Wesley. Other books on the use of LaTeX are also available. TeX users are directed to "The TeX Book" by Donald Knuth. A simple guide to the use of LaTeX can be found in /home/tex3_1415/share/texmf/tex/latex/base/small.tex. A second file, in the same directory, called sample.tex gives more examples on usage. These files may be formatted by simply typing latex small.tex and latex sample.tex A document describing the possible style options for LaTeX can be found in /home/tex3_1415/doc/local_guide.tex, along with the preformatted dvi file, local_guide.dvi. As this guide changes with new features being added to the system, users are dissuaded from printing this out. Previewing using xdvi is the preferred means of accessing the information. In this directory, other information files can be found on additional LaTeX packages and features. Again, users are encouraged to preview these files rather than printing them. There is also a set of Web documentation to be found at http://www.ee.ed.ac.uk/~ltex/