|
LaTeX
This page is intented to intoduce you to LaTeX, so that you
can typeset documents of high quality, especially those
containing a lot of mathematical expressions. Using LaTeX
you can produce articles, books, reports, theses, posters, etc.
There are many LaTeX tutorials and sources of information on the internet.
This page only covers the material that is relevant for almost all applications;
syntax and structure of the source files are not discussed on this page.
If you want to have a more thorough (and lengthy!) information,
there are a couple of good options:
It takes a moderate effort to learn LaTeX. However, once you have
learnt the basics (the syntax and how to compile), you can typeset any kind
of documents with high quality results. First step is to obtain the basic LaTeX
software system. Available distributions for the most important platforms can be
downloaded from
CTAN.
LaTeX Software
The following programs are needed to create LaTeX documents under Windows:
- A TeX/LaTeX implementation for Windows
- The TeX/LaTeX distribution that I use is MiKTeX.
This distribution already includes Yap: a DVI previewer.
- A PostScript and PDF interpreter
- GhostScript is the most common PostScript interpreter. You
can download it from the wisc.edu website.
- A PostScript/PDF viewer
- GSView (install GhostScript first), it is also available at
wisc.edu website.
Even though PDF files can be viewed with GSView,
Acrobat Reader is
more popular for this purpose.
- A text editor
- A plain text editor such as Notepad can be used to type a
LaTeX source file. However, there are IDEs which provide excellent
tools for editing and compiling simultaneously. On Windows, WinEdt
is an excellent IDE; another options are TeXnicCenter and WinShell, which are
available at CTAN/systems/win32.
LaTeX is available in most Linux distributions. For example,
Quantian includes
a LaTeX distribution and several specialized editors. I currently use Quantian
0.6.9.3 and prefer to use
Kile for editing LaTeX documents. In addition,
I have Red Hat Linux 9 on my Desktop, which already has LaTeX installed.
The only additional thing I had to do was create an Integrated Development Environment with NEdit. The following technical note describes how
to create the IDE:
- R. Evans, Introductory Note 622: Creating an IDE for LaTeX on Linux with NEdit. UK: Cardiff University, 2003.
[pdf]
However, there are also others LaTeX editors for using on Linux systems.
According to each distribution, those are already included or must be installed.
Command sequence to produce a document
Once you have a LaTeX source (TEX file) containing your document, the next step is
to compile it. To illustrate the process, we will consider this
source file and an encapsulated postscript
picture (samplefig.eps). Then, at the prompt,
enter:
latex example.tex
Several output files (example.log, example.dvi, etc) will be created. Resultant
document can be viewed from the DVI file as follows (UNIX environments):
xdvi example.dvi
Or using the following command in a Windows system:
yap example.dvi
If any error occurs, it will be listed on the LOG file. If there are unresolved
cross references, run latex again. DVI file cannot be
printed directly; in consequence, DVI file must be converted to PostScript
by using the program dvips:
dvips example.dvi
After that, example.ps file can be viewed or printed with the Ghostview
program or with other PostScript viewer available in your platform. Finally,
the PostScript file can be converted to PDF (e.g. for e-mailing or posting on
the internet) by using the ps2pdf program:
ps2pdf example.ps
Nonetheless, most LaTeX users prefer an IDE instead of the command line
procedure cited above. In this case, compiling is reduced to clicking on the
appropiate buttons. We illustrate the process for WinEdt. In other LaTeX IDEs,
sequence should be very similar (consult information on the Help menu of your
LaTeX editor):
- Compile TEX file: click on
(Run again if
there are unresolved cross references)
- View DVI file: click on
- Convert DVI file to PostScript: click on
- View/Print PS file: click on
- Convert PS file to PDF: click on
- View/Print PDF file: click on
A shortcut for steps 1 and 2 is usually included. In WinEdt,
compiles TeX file and opens Yap
previewer by a single click.
BIBTeX is an additional program to produce bibliography from a bibliographic
database contained in a BIB file. Details of syntax can be found in Section 3
of Greenberg's book.
Consider now a source TeX file, an
EPS picture and this BIB file. Now,
command sequence must include execution of bibtex program:
latex example2.tex
bibtex example2.tex
latex example2.tex
xdvi example2.dvi
...
Sequence of buttons in WinEdt would be: —›
—› —›
...
To import a picture into LaTeX, it should be an EPS file. However, there is
another program in LaTeX distributions called PDFLaTeX, which produces a PDF file
directly from the TEX source code and handles figures in JPG and PDF formats.
Consider the following files: example3.tex,
samplefig.pdf; the final document example3.pdf
is obtained by executing PDFLaTeX:
pdflatex example3.tex
Or by pressing the PDFLaTeX button in WinEdt: , the
PDF file can be viewed/printed in Acrobat Reader: . A
shorcut for these two steps is carried out with the following button:
.
Creating Presentations in LaTeX
Even though there are many ways to make slides in LaTeX, I have been using PDFLaTeX for making presentations.
To compile the LaTeX source code for the example presentation, you need to download this zip file. Then, extract files to a folder in your texmf directory
(For MiKTeX users, I recommend extracting them to C:\texmf\tex\latex) and refresh
the file name database: MiKTeX Options -> General -> Refresh Now.
A good option for MS Office users is TexPoint, which is a Powerpoint add-in that enables the easy use of LaTeX symbols and formulas in Powerpoint presentations. See this sample presentation.
Sample templates
- Books:
-
- Articles:
-
- Slides:
-
|