Professional Documents
Culture Documents
Latex Tutorial: Syed Shazli
Latex Tutorial: Syed Shazli
Syed Shazli
Preface
Advantages and
Disadvantages
(1)
Advantages of LaTeX over
WYSIWYG:
Advantages and
Disadvantages
(2) WYSIWYG:
Advantages of LaTeX over
Advantages and
Disadvantages
(3)
LaTeX also has some disadvantages:
Spaces
Special Characters
LaTeX Commands
Comments
Spaces
Spaces
It does not matter
whether you enter one
or several spaces
after a word.
An empty line starts a
new paragraph.
It does not
matter whether
you enter one of
several spaces
after a word.
An empty line
starts a new
paragraph.
Special Characters
$&%#_{}~^\
Some of these characters can be used in
your documents by adding a prefix backslash
(escape character):
$ & % # _ { }
\$ \& \% \# \_ \{ \}
This is emphasized
text.
Comments
This text is
processed.
Basic Classes
\documentclass{article}
\begin{document}
This is some sample text.
\end{document}
Sections
\section{Section Title}
\subsection{Title}
\subsubsection{Title}
Font size
\tiny \scriptsize
\footnotesize
\small \normalsize
\large \Large
\LARGE \huge
\Huge
Page Styles
Typesetting Mathematics
Typesetting Mathematics
Greek Symbols
\alpha, \beta, \gamma
Superscript, Subscript
x^y
x_y
Calculus
\int_0^\infty
\frac{\partial u}{\partial x}
x_y^z
\int{\int}
Typesetting Mathematics
x = \frac{-b \pm \sqrt{b^2-4ac} } {2a}
Typesetting Mathematics
\ldots it is clear
that
\begin{equation}
\epsilon > 0.
\label{eq:eps}
\end{equation}
From
Equation~\ref{eq:eps}
it follows that
\ldots
(note that \label and \ref are used with figures and tables too)
Typesetting Mathematics
Including Graphics
\begin{figure}
\includegraphics{sample}
\caption{A sample figure.}
\end{figure}
Tabular
Columns
Two Columns
\begin{tabular}{|||}
\end{tabular}
Rows
l = automatically adjust
size, left justify
r = automatically adjust
size, right justify
p = set size
e.g p{4.7cm}
c = centre text
Example of table
\begin{tabular}{|l|r|c|} \hline
Date & Price & Size \\ \hline
Yesterday & 5 & Big \\ \hline
Today & 3 & Small \\ \hline
\end{tabular}
Date
Price
Size
Yesterday
Big
Today
Small
Cross-referencing
\label{marker}
\ref{marker}
\pageref{marker}
Example:
\section{Introduction}
\label{intro}
Bibliographies
Bibliographies
By far the most
commonly used feature
is color (e.g.\
\cite{NBE1993,JaV1996
,SmC1996a}), usually
computed in a color
space thought to be
``perceptually accurate''
(e.g. HSV
\cite{SmC1996a} or CIE
\cite{STL1997}).
Bibliographies
@book{AhR1975,
author =
title =
publisher =
year =
address =
}
@inproceedings{Aus1989,
author =
{James Austin and A. Phantom and
Also Phantom},
title =
{High Speed Invariant Recognition Using
Adaptive
Neural Networks},
booktitle =
{IEE 3rd International Conference on Image
Processing and its Applications},
year =
{1989},
pages =
{28--32},
abstract =
{A method is described which...},
}
Running LaTeX
test.aux
# the auxiliary file that LaTeX will use in subsequent
passes to resolve references to figures, tables, citations etc.
test.log
# a log file that contains information about the LaTeX
run
test.dvi
# the DeVice Independent output file. This is the
typeset document, ready for conversion to postscript or other printable
formats
Running LaTeX
Latex compile x3
Bibtex compile x2
Latex compile x3
Device independent
output .dvi
dvips compile x1
Your Postscript File
Output Formats
.dvi
.ps
.pdf
.rtf
.html
.xml
Device Independent
Post Script
PDF
Rich Text Format
HTML
XML
Further reading
http://www.ctan.org/tex-archive/info/lshort/english/