The main advantage of using TeX systems over the easier-to-use word processing package that we have is in the quality of the output. It is the most commonly used standard for text formatting, and as such is the most popular amongst scientific journals for guaranteeing high quality, standardised output. The flexibility of using pre-formulated macros is a huge advantage; without needing to know anything about page or line layout, the text you've written is in JGR (or whatever) format, complete with their own style of references/citations/figure captions and so forth.
setenv LD_LIBRARY_PATH /usr/openwin/lib:/usr/local/lib
setenv XDVIFONTS /usr/local/tex/tex.rasters/generic
setenv TEXINPUTS .:/usr/local/tex/tex.macros:/usr/local/tex/tex.macros/contrib
Logout and back in again for these changes to take effect, or type source .cshrc in from the cmdtool you're using.
\centerline{\def\head#1{\centerline{\underbar{#1}}\vskip 5mm}}
which will center and underline your heading, leaving 5mm of space before the following text, whenever you write `\head{This is my heading}'. For more information, see the TeX and LaTeX books.
The style files used by LaTeX consist of large numbers of these definitions, written in ways that TeX can read them, and hence the work of constructing these definitions has been done for you.
latex filename
which will produce the device-independent file filename.dvi. It is conventional to call your original file filename.tex, but not essential. TeX produces a similar dvi file.
The dvi files can be viewed by typing:
xdvi filename.dvi &
which will draw up a window on the screen, displaying the dvi file. You can then page forward and backward with the buttons, and use the various shrink factors to view the file at different magnifications. The mouse buttons can be used to zoom in on a little bit of the file at different magnifications - a very useful option!
xdvi can also be controlled by keystrokes; the most useful of these is to vary the shrink size, hence typing `6 s' in the window will take you to shrink size 6. Just typing `s' will take you to the largest magnification that gets the whole page in the window. Also, to go to page 23 of your document, simply type `23 g'. There are lots of other commands; try the on-line man page to see the full list.
The new xdvi uses ghostscript to render PostScript files embedded in the dvi file; this is particularly useful, as you can arrange text suitably around included PostScript plots.
To translate the dvi file into something the printer can cope with, try:
dvips filename.dvi -o filename.ps
which will give you a PostScript file, filename.ps. Note that dvips has a large number of options, allowing you to select just a few pages of the dvi file to translate, choosing formats, setting resolution or magnification etc. It also reverses the page order of your text on the printer, so that it's the right way round when you collect it. If you want your file printed in landscape mode rather than the default portrait mode, this is the time to do it. Also, if you want to save paper by arranging 4 sheets of your file on each A4 PostScript page, dvips has the power - the easiest way is to put the following line at the top of your TeX/LaTeX file:
\special{header=four.pro}
There's more information on the man page, and a summary available by typing dvips with no arguments.
To view the PostScript, type:
gs filename.ps &
which uses ghostscript to view the PostScript files in the form they'll be printed. If you want a closer look, type:
ghostview filename.ps &
which will allow you to page through the document forwards and backwards, go to particular pages, reorientate them, magnify them etc; it has the same useful magnifying glass feature using the mouse buttons that xdvi has. It will also give you give you the PostScript co-ordinates of the cursor in the window, useful if you have any last minute lines to add or remove from your plots.
This is not a conclusive list, but the following files may be of interest:
There are a full suite of AMS style files from the American Mathematical Society. There are also title pages, trademark styles, trees... everything is in /usr/local/tex/tex.macros. I'm hoping to create a directory with documentation on the various macro files we have; you'll have to wait for it, though!
\input epsf
at the top of the text. You can then use a simple box system to include an Encapsulated PostScript file fig.epsf from Unigraph (or wherever) into your text:
\centerline{\epsfysize=5in \epsfbox{ fig.epsf}}
You can control the size with epsfxsize or epsfysize, and stick two side by side using (in TeX for example):
\centerline{\epsfxsize=120mm \epsfbox{ fig1.epsf}
\hskip 22mm \hskip -20mm
\hskip 22mm \epsfxsize=120mm\epsfbox{ fig2.epsf}}
with a similar method in LaTeX.
If you don't have Encapsulated PostScript files, all is not lost - a standard PostScript file can be converted to EPSF by adding a bounding box. This can be done by typing:
bbfig filename.ps > junkfile
gs junkfile
This will display your picture with the bounding box labelled. Simply add the line shown to the top of your filename.ps file, rename it filename.epsf, and delete junkfile.
\input pstricks.tex
\input pst-node.tex
\input pst-coil.tex
More information is available in the manual.
\pspicture(0,0)(10,10) \hskip 10mm % This defines the picture environment
\hskip 2mm \pnode(5,5){Middle} \hskip 12mm % place `Middle' in the middle
\hskip 2mm \pline(0,2)(10,2) \hskip 18mm % draw a horizontal line
\endpspicture
OK, that's a very simple example; there's a slightly more complex example above. Lines, curves, arrows, arcs, regions of particular colour or fill style; all are available. Complex tree diagrams are especially well treated.
Figure 1. A more ambitious use of PSTricks, considering Odd-Oxygen and Odd-Hydrogen chemistry and some of the feedbacks between them.
Figure 2. Use of PSTricks to draw pretty diagrams....
The font files used by TeX and LaTeX are in the /usr/local/tex/tex.rasters/generic subdirectory, linked to the sparcptr subdirectory. These are compressed as * .pk files. Fonts are defined with respect to the base resolution; they correspond to the basic TeX magnification steps of 0, 0.5, 1, 2, 3, 4 and 5, hence we have fonts at the resolutions 400, 438, 480, 576, 691, 830, and 995.
To use these files, TeX and LaTeX need to be able to find the TeX font metric *.tfm files, which are in /usr/local/tex/tex.fonts.
If you're trying to use a font that we don't have, TeX and LaTeX will tell you. The answer is to use Metafont which makes the font up for you. You can then ask Glenn to put it on the system.
Metafont is a programme written by Don Knuth for font design. There aren't many word processing packages that let you design your own letter shapes and styles! In practice there are hundreds of different font styles currently available, in almost as many different languages, and the most commonly used are installed on the system.
If you want to use a font that we don't have, first get the *.mf metafont design file from the TeX Archive. Metafont will use this design file (specifications of Bezier curves fitting the font design) to create a font at the desired resolution. A magnification factor is required to produce a font at the required resolution; the base file for Metafont on the system specifies the base resolution (400 d.p.i.) and printer (sparcptr). This will produce a *.gf font, which will need to be packed down into a *.pk font with the gftopk command. More information is available on the man page by typing `man mf'
There are a number of other variables, but these are the most important.
It is also helpful to set up a few aliases in your .cshrc file, for example:
alias xdv xdvi -s 4 \!*.dvi (so that you can type: xdv filename)
alias dvi dvips \!* -o \!*.ps (so that you can type: dvi filename)
Happy TeX-ing!