I use LaTeX for typesetting papers. Aside from being essentially platform independent because it is widely ported, LaTeX is "text editor independent" because it uses plain ASCII text files. This makes collaborating on a LaTeX document possible even if your co-author doesn't know LaTeX and prefers to use WordPerfect, for example. ASCII text files are also likely to remain readable for longer than any proprietary or binary format, and since new releases of LaTeX are extremely infrequent, backwards and forwards compatibility are rarely a problem.
Some things are more difficult to do in LaTeX than in a WYSIWYG word processing program, but for academics its strengths in automatically generating cross references, tables of contents, and citations, and its mathematical typesetting, more than make up for other inconveniences.
Getting Started with LaTeX
LaTeX is very powerful, but you don't need to know much to get started with it. I learned the basics of LaTeX from the short introduction found in "Essential LaTeX" and "Essential Mathematical LaTeX"; MIT has a nice intro page, and here are some useful math symbols.
The bookshelf in the DECF had some LaTeX intro references in a binder. Useful reference books are Leslie Lamport's "LaTeX : a document preparation system" and Goossens et al.'s "The LaTeX Companion." You will want to learn how to use bibtex, which makes it easy to automatically generate a bibliography for a particular paper from a master bibliograpy -- see for example Leslie Lamport's book (Appendix B in the 1st edition).
Figures
Another essential that is not covered in "Essential LaTeX" (or the
Lamport book) is how to
include figures. For PostScript figures in .eps or .ps format, add the line
\usepackage{epsfig}
in the preamble of your .tex file and then you can include
figures in the body using e.g.:
\begin{figure}[hbt]
\begin{center}
\psfig{file=FileName.eps,width=3.25in}
\end{center}
\caption[short TOC caption]{\em Caption to appear under the figure goes here.}
\label{ReferenceLabelHere}
\end{figure}
The \em is entirely optional and can be omitted -- I like to make my captions italic so that the reader won't confuse them with the running text. The text enclosed in square brackets [] is also optional; it's a useful feature if you have an automatically generated table of contents with a list of figures and you don't want the whole verbatim caption for the figure to appear in it, but if you won't be making a table of contents omit it.
If your original figure is not postscript, the unix convert utitily (available on kepler) is useful, but it always converts to an intermediate bitmap. For graphs generated in Excel, select the graph, choose a PostScript printer, and print the graph to a file. You may need to edit the generated .prn file to delete the extra non-postscript PJL lines at the very beginning and end; you may also need to edit the bounding box info. On unix, use ps2epsi file.ps file.eps to convert from ps to eps, which calculates and adds the bounding box. (Don't use convert on Excel output because it will replace the scalable postscript commands with a low-res bitmap.)
In AutoCAD, you can create eps files using the psout command from the command line. Assuming you are using a truetype font, you need to type "textfill" and then "1" before doing this or the fonts seem to come out in a shadow sort of mode, at least in AutoCAD 2002.
Comments
In addition to the built-in latex comment command %, I always define a comment command that can deal with comments spanning line breaks.
in the preamble:
\newcommand{\comment}[1]{}
usage example:
\comment{This is a comment and it won't show up in the output even if
it spans more than one line of the input file or the line breaks move around.}
You can also use conditional comments, shown here being used to allow commenting out all figures (very useful for faster previewing).
in the preamble:
\usepackage{ifthen}
\newboolean{includefigs}
\setboolean{includefigs}{true}
\newcommand{\condcomment}[2]{\ifthenelse{#1}{#2}{}}
usage example:
\condcomment{\boolean{includefigs}}{
\begin{figure}
....
\end{figure}
}
LaTeX style sheets a.k.a. classes
The .tex file you write contains the body of your document and some formatting information, but most of the formatting is defined separately in a latex class file with the suffix .cls (or the suffix .sty for the older 2.09 version of latex). If you are using a common format such as "article" your latex installation will already have the style/class installed in a common directory, probably under tex/inputs. Otherwise, you will need a definition of the latex class used. Many scientific journals provide their own LaTeX document classes. Here are some useful pointers:
For a UCB dissertation, the ucthesis.sty file (which I grabbed off the EECS software warehouse) formats everything correctly. No one seems to have updated it for LaTeX2e, but it still works -- just begin your .tex file with \documentstyle instead of \documentclass so that LaTeX knows to go into LaTeX 2.09 backwards compatibility mode.
For ASME publications, LaTeX files can be found at ftp://iel.ucdavis.edu/pub/format/ASME/LaTeX2e/ (Note that the new ASME bibliography format is not a standard bibtex format so be sure to grab the .bst file so that bibtex will know how to format the bibliography. There are some bugs in here it seems with punctuation placement and extra spacing -- you can always edit the generated .bbl file as a workaround.)
The SIGGRAPH document class (with minor variations) is usually what I use for a technical
paper if the conference or journal doesn't provide a LaTeX class of
its own. You can download it from http://www.siggraph.org/publications/instructions/acmsiggraph.zip.
The guidelines for technical papers on the SIGGRAPH Author
Instructions page are helpful in explaining how to use dvips and
ps2pdf to produce good quality pdf files. Note that in general you
should include the lines
\usepackage{times} %use outline Times Roman font for regular text
in the preamble of your .tex file or the pdf file will look pretty awful on
the screen. For equations I also add
\usepackage{mathptm} %use an outline math font for most math text
to the .tex file and use dvips -f -Pcmz to get all my fonts to be
happy Type 1 outline fonts (using version 6 or 6.5 of gs). The current SIGGRAPH instructions
suggest using dvips -GO -Ppdf, but I suspect that may not always work
if your version of gs is older than 6.53 (gs -v will tell you
the version). On some platforms, the dvipdf command seems to do OK.
See also my notes on using CVS for concurrent editing of latex files.
Send
comments to
| Latest update: January, 2005 |