LaTeX Basics for Unix
Problem:I need the basics relating to LaTeX.
LaTeX works on the assumption that you should primarily be concerned with the content of your work (about which you probably know a lot) rather than how to typeset the paragraphs, section headings, lists, and other details so that they look good (about which most people know very little).
LaTeX also takes care of some more significant details for you. These include the following:
- Often you may want to refer to a particular section or page of your text.
But as you edit the work, the section or page number may change. By using
refcommands, LaTeX will automatically handle all of these references for you.
- Citations and Bibliography
- Using the
citecommand, LaTeX will automatically generate references based on your bibliography. In addition, the companion program BibTeX can automatically generate the entire bibliography for you based on an external bibliography file. See the article on Bibliographies with LaTeX.
- Rather than appearing in the middle of text, it is usually best for figures to "float" to the top or bottom of a page. LaTeX makes this very easy.
Input to LaTeX is a text file that is marked to indicate the logical content of various parts. This file is converted by LaTeX into a dvi file, which is essentially an intermediate format. You can then convert the dvi file to another format, such as postscript or pdf.
For example, let's say you just finished writing the file `foo.tex'
(LaTeX and TeX input files traditionally have the extension `.tex').
To create the dvi file, type
latex foo.tex. LaTeX spits out a
bunch of information as it goes, and if there weren't any syntax problems,
you have the file `foo.dvi'. You can view the graphical layout with
a program called xdvi by typing
xdvi foo.dvi & (alternatively,
you can just type
xdvi & and you will get a menu to pick the
file). You'll probably find some things you want to change, so you modify the
tex file and run LaTeX again (I typically iterate this many times).
At some point, you want to print, for which you can use the program
converts dvi files to ps files). The typical setting is to automatically print,
dvips foo.dvi will generate a postscript file and print
it out on your default printer without ever saving the postscript file. If
you'd like to save the postscript file or print to another printer, use the
`-o' option followed by the name of the output file. For example
-o foo.ps foo.dvi will convert `foo.dvi' to `foo.ps'
without printing anything. You can then print this on any printer you'd like,
send it to someone, or save it .
Of course, all of this assumes that you can generate a proper LaTeX file in the first place. There are a number of online tutorials and references. A few of them are listed below:
- Getting Started with LaTeX
- How to Learn LaTeX
- LaTeX Tutorial
- LaTeX Help 1.1 (a reference rather than a guide for beginners)
- LaTeX Symbols (just a visual chart of most available symbols)