WHERE TO FIND LATEX PACKAGES:
There are many, many latex packages available on the web. If you're looking for a way to do something in latex, chances are you can find the package at ctan.org or a mirror site.
LOCAL DOCUMENTATION:
To see if a latex package is installed on your system, look for <package name>.sty. Oftentimes there is a corresponding DVI documentation file; look for <package name>.dvi or <package name>.dvi.gz.
USEFUL LATEX PACKAGES:
\url{http://www.npaci.edu/Horizon}
WRITING LATEX COMMANDS:
A latex command can be defined as follows:
\newcommand{\<name of command>}{<body>}
For example,
\newcommand{\twok}{$2k \times 2k$\xspace}
See above for explanation of xspace. Or
\newcommand{\starttext} { \pagenumbering{arabic} \setcounter{page}{1} \pagestyle{plain} }
To use a command that you defined, just type
\<name of command>
within the text. For example,
for the \twok experiments. We also found that theor
\starttext
You can also have arguments in your commands like a function. You specify the number of arguments as an optional argument to \newcommand. You can then access them using #<arg_num>. For example,
\newcommand{\setcenterfigwidth}[1] { \renewcommand{\@fig@spec}{width} \setlength{\@fig@scalar}{#1} }
You can also have one optional argument. To specify, use the second optional argument to \newcommand. This also allows you to specify the default value of the optional argument. For example,
\newcommand{\landscapefig}[4][width=\textheight] { \begin{sidewaysfigure}[htbp] \centering \epsfig{file=figures/#2.eps,#1} \caption[#4]{\label{#2}#3} \end{sidewaysfigure} }
The first argument (i.e. #1) will be the optional argument. The required arguments follow in order.
MY FIGURE PACKAGE:
I wrote a small package that simplifies the use of figures for me. It is available here. It provides the following commands:
\setfiguredirectory{DIRECTORY} sets the figure directory to DIRECTORY. This package will then look for all figures in DIRECTORY. The default figure directory is '.'.
\centerfig[OPT]{FILENAME}{CAPTION}{TOC CAPTION} centers a eps figure. The label for the figure will be FILENAME.
OPT is a spec string argument to epsfig. E.g. width=4in, height=5in. Note that OPT will overide the default spec string 'height=3.65in'
FILENAME is the name of the eps file without the .eps. Default is to look for the figure in the current directory unless it has been reset with \setfiguredirectory.
CAPTION is the caption for the figure.
TOC CAPTION is the caption that will be displayed in the document's table of contents
\pairfig{FILENAME1}{FILENAME2}{CAPTION}{TOC CAPTION} inserts a a pair of figures on a single page one on top of the other. The figures will have sublabels (a) and (b) respectively.
FILENAME1 is the name of the first eps file without the .eps.
FILENAME2 is the name of the second eps file without the .eps.
CAPTION, and TOC CAPTION are described in centerfig.