next up previous
Next: xfig Up: Presentation Tools Previous: Presentation Tools

LATEX

LATEX (or, more specifically, LATEX$2_\varepsilon$) is a powerful text formatting language. Much like code, a LATEX document contains text commands that are compiled into the finished product (typically a postscript file). The language is best illustrated by example:

% this is a comment
\documentclass[12pt]{article}
\begin{document}

\section{Introduction}

Latex (or \LaTeX) is a powerful text formatting language.
You can write in \textit{italics} or \textbf{bold face}.  You can
\underline{underline} and $\overline{\mbox{overline}}$.
Best of all, you can do equations:
\begin{equation}
  E = mc^2
\end{equation}
or arrays of equations:
\begin{eqnarray}
  \dot{x} & = & z \\
  \dot{z} & = & x + z
\end{eqnarray}
Even integrals!
\begin{equation}
  M = \int_x \int_y \int_z \rho(x,y,z)\, dz\,dy\,dx
\end{equation}

\subsection{Here's a subsection}

Here's a table:

\begin{table}[h]
\begin{tabular}{l|c|r}
Left & Center & Right \\
\hline
1 & 2 & 3 \\
4 & 5 & 6
\end{tabular}
\end{table}

Here's how you start a new paragraph (just leave a blank line).
Notice how the line is indented.

\subsubsection*{Here's a subsubsection without a number}

Here's how you might include a figure:

\begin{figure}
  \resizebox{\textwidth}{!}{\includegraphics{myfigure.eps}}
  \caption{Caption goes here.}
\end{figure}

(you'll need a \usepackage{graphics} command in the preamble).

\subsubsection*{And here's a numbered list:}
\begin{enumerate}
\item Item 1.
\item Item 2.
\item etc.
\end{enumerate}

\end{document}

As you can see, LATEX contains powerful equation typesetting tools and supports both embedded tables and figures. Naturally, the document you are currently reading was written in LATEX (and converted to HTML for the course website using the latex2html utility).

To compile a LATEX document, just type latex mydocument.tex, where mydocument.tex is the name of your document. This creates a dvi file which can be viewed in a window with xdvi or converted to postscript with dvips (use ghostview or gv to view a postscript document in a window). If you want PDF output, use the convert utility: convert mydocument.ps mydocument.pdf (use acroread to view a PDF document in a window).

A nice LATEX tutorial is available here:

http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf?action=/starter/
There are also extensive lists of special symbols that you might find useful:
http://www.ctan.org/tex-archive/info/symbols/comprehensive/symbols-a4.pdf
(these documents are all part of the Comprehensive TEX Archive Network at http://www.ctan.org/).


next up previous
Next: xfig Up: Presentation Tools Previous: Presentation Tools
Massimo Ricotti 2009-01-26