Escolar Documentos
Profissional Documentos
Cultura Documentos
1/4/2010 2
What You Need ….
REDHAT LINUX OS Ver 4
Any PC ( PIV, PV, ,,,,)
Latex Manual
1/4/2010 3
COVERAGE
Basic structure and Generating
essentials of Latex Figure/Graphs,
Syntax and Symantics Structure of the VTU
of Latex – template,
Dr T.N.Nagabhushan Actual compilation,
Running through the
Thesis tex file
Hands on
Dr S.K.Padma
1/4/2010 4
Preface
LaTeX is a typesetting system (not a word
processor).
It is most suited to producing scientific and
mathematical documents of high
typographical quality.
1/4/2010 5
Why not MS Word?
1/4/2010 6
Advantages and Disadvantages (1)
Advantages of LaTeX over WYSIWYG:
1/4/2010 7
Advantages and Disadvantages (2)
Advantages of LaTeX
complex structures such as footnotes,
references, table of contents, and bibliographies
can be generated easily
for many typographical tasks not directly supported by
basic LaTeX, there exist free add-on packages
LaTeX is highly portable and free
1/4/2010 8
Advantages and Disadvantages (3)
LaTeX also has some disadvantages:
What you see is not what you get.
Is this really a disadvantage? Why are you thinking about
layout instead of content?
The design of a whole new layout is difficult and takes
a lot of time.
Templates help you here
1/4/2010 9
LaTeX Input Files
The input for LaTeX is a plain ASCII text file.
You can create it with any text editor.
It contains
the text of the document
commands which tell LaTeX how to typeset the text.
Spaces
Special Characters
LaTeX Commands
Comments
1/4/2010 10
Spaces
Whitespace characters (e.g. blank, tab, single
line break) are treated uniformly as “space”
by LaTeX.
Several consecutive whitespace characters are
treated as one “space”.
An empty line between two lines of text
defines the end of a paragraph.
Several empty lines are treated in the same way
as one empty line.
It does not matter whether you enter one or It does not matter whether you
several spaces after a word. enter one of several spaces after a
word.
An empty line starts a new paragraph. An empty line starts a new
paragraph.
1/4/2010 11
Spaces
1/4/2010 12
Special Characters
The following symbols are reserved
characters, that
have a special meaning in LaTeX
$&%#_{}~^\
Some of these characters can be used in
your documents by adding a prefix backslash
(escape character):
$ & % # _ { } \$ \& \% \# \_ \{ \}
The other symbols (and many more!) can be
printed with special commands in
mathematical formulae.
1/4/2010 13
LaTeX Commands (1)
LaTeX commands are case sensitive and
take one of two formats:
They start with a backslash \ and have a name
consisting only of letters.
They consist of a backslash and exactly one special
character.
1/4/2010 14
LaTeX Commands (2)
I read that Knuth divides I read that Knuth
people working with TeX divides people
into TeXnicians and working with
TeXperts. Today is March \TeX{} into
25th, 2004. \TeX{}nicians and
\TeX perts. Today
is \today.
1/4/2010 15
LaTeX Commands (3)
Some commands take a parameter which has to be
given between curly braces { } after the command
name.
Some commands support optional parameters
which are added after the command name in
square brackets [ ].
The next example uses some LaTeX commands.
1/4/2010 16
LaTeX Commands (4)
1/4/2010 17
Comments
When LaTeX encounters a % character while
processing an input file, it ignores the rest of
the present line.
This is useful for adding notes to the input
file, which will not show up in the printed
version.
This text is processed. % A comment
isn’t
This text is
processed.
1/4/2010 18
Input File Structure (1)
When LaTeX2e processes an input file it expects it
to follow a certain structure. Every input file starts
with the command:
\documentclass{...}
This specifies what sort of document you intend to write
(article, letter, book, thesis, etc.)
After that, you can include global style commands or
you can load packages which add new features to
the LaTeX system. To load a package you use the
command:
\usepackage{...}
1/4/2010 19
Input File Structure (2)
When all the setup work is done, you start the
body of the text with the command:
\begin{document}
\documentclass[ieee]{article}
1/4/2010 21
A Simple LaTeX Document
\documentclass{article}
\begin{document}
This is some sample text.
\end{document}
1/4/2010 22
A more realistic LaTeX file
\documentclass[a4paper,11pt]{article}
\usepackage{latexsym}
\author{XYZ}
\title{Dependable Nanocomputing Lab}
\begin{document}
\maketitle
\tableofcontents
\section{Introduction}
Here begins my first article \ldots
\section{Conclusions}
\ldots{} and here it ends.
\end{document}
1/4/2010 23
Sections
\section{Section Title}
\subsection{Title}
\subsubsection{Title}
1/4/2010 24
Font size
\tiny \scriptsize \footnotesize
\small \normalsize
\large \Large
\LARGE \huge
\Huge
1/4/2010 25
Page Styles
LaTeX supports three predefined header/footer
combinations. These are known as page styles.
The style parameter of the \pagestyle{style}
command defines which one to use:
plain prints the page numbers on the bottom of the page
in the middle of the footer (default page style)
headings prints the current chapter heading and the page
number on each page. Footer is empty
empty - both header and footer empty
More elaborate headers and footers can be created
using the fancyheadings package
1/4/2010 26
Typesetting Mathematics
LaTeX has a special mode for typesetting
mathematics, called “math mode”.
Within a paragraph, math mode is entered
between $ characters, or by using the
\begin{math} and \end{math} commands
1/4/2010 27
Typesetting Mathematics
Greek Symbols
\alpha, \beta, \gamma
Superscript, Subscript
x^y x_y x_y^z
Calculus
\int_0^\infty \int{\int}
\frac{\partial u}{\partial x}
1/4/2010 28
Typesetting Mathematics
1/4/2010 29
Some more Math equations
\begin{center}
{\large
$$ y=\frac{a^3+2c_{x}}{1+\sqrt{b_{x}}} $$ \\
\vspace{0.2in}
$$ Q=\sum_{i=1}^{j}\int_{\mu}^{\infty}f(x_{j})dx
$$ \\
\vspace{0.2in}
$$ \Psi = \oint_{-
\infty}^{\infty}f_{xy}({\frac{\partial
Qx}{\partial Qy}})^{\Im_{\pi}^ \prime} $$ \\ }
1/4/2010 30
Typesetting Mathematics
In a research paper or thesis, you will often want to number
equations and refer to them in the text
This is done using the equation environment, and the
commands \label and \ref
1/4/2010 33
Figures and Tables
Figures & Tables cannot be broken between
pages
1/4/2010 34
Tabular
Two Columns
Columns
l = automatically adjust
\begin{tabular}{|…|…|}
size, left justify
\end{tabular} r = automatically adjust
size, right justify
Rows p = set size
e.g p{4.7cm}
& - Split text into columns
c = centre text
\\ - End a row
\hline - Draw line under row
e.g. 123123 & 34.00\\ \hline
1/4/2010 35
Example of table
\begin{tabular}{|l|r|c|} \hline
Date & Price & Size \\ \hline
Yesterday & 5 & Big \\ \hline
Today & 3 & Small \\ \hline
\end{tabular}
Today 3 Small
1/4/2010 36
Cross-referencing
\label{marker}
\ref{marker}
\pageref{marker}
Example:
\section{Introduction}
\label{intro}
…
1/4/2010 37
Bibliographies
Articles can be referred to in the text using
the \cite command
The details of the cited articles are stored in
BibTeX format, in a “.bib” file.
BibTeX resolves the citations in the LaTeX
file and generates the required bibliography
1/4/2010 38
Types of Documents BibTex can handle
ARTICLE MISC
BOOK PHDTHESIS
BOOKLET PROCEEDINGS
INBOOK TECHREPORT
INCOLLECTION UNPUBLISHED
INPROCEEDINGS
MANUAL
1/4/2010 39
Each Document type can have the following
entries
address month
author note
booktitle number
chapter organization
crossref pages
edition publisher
editor school
howpublished series
institution title
journal type=“Ph.D. dissertation”
key volume
language year
1/4/2010 40
Sample BibTex
Book Entry
(mybib.bib)
@BOOK{Press,
author="W.H. Press",
title="Numerical Recipes in C: The Art of
Scientific Computing",
publisher="Cambridge University Press",
year=1992,
}
1/4/2010 41
Sample BibTex
Technical Report Entry
@TECHREPORT{Berk,
author="Lex A. Berk and L.S. Bernstein
and D.C. Robertson",
title="MODTRAN: a moderate resolution
model for LOWTRAN 7",
number="GL-TR-89-0122",
institution="Spectral Science",
address = "Burlington, MA",
year = 1989
}
1/4/2010 42
Sample BibTex
Ph.D. Dissertation Entry
@PHDTHESIS{Kuo,
author="Jan-Tai Kuo",
title="The Influence of Hydrodynamic
Transport on Phytoplankton Dynamics
in Homogeneous Lakes",
school="Cornell University",
address="Ithaca, NY",
year=1981,
}
1/4/2010 43
Sample BibTex
Master’s Thesis Entry
@MASTERSTHESIS{Knobelspiesse,
author="Kirk D. Knobelspiesse",
title="Atmospheric Compensation for SeaWIFS Images
of Lake Superior Utilizing Spatial Information",
school="Rochester Institute of Technology",
addess="Rochester, NY",
month=Sep,
year=2000,
}
1/4/2010 44
Sample BibTex
Article Entry
@ARTICLE{Vodacek,
author="Anthony Vodacek and F.E. Hoge and R.N. Swift
and J.K. Yungel and E.T. Peltzer and N.V. Blough",
title="The use of in situ and airborne fluorescence
measurements to determine UV absorption
coefficients and DOC concentrations in surface
waters",
journal="Limnology and Oceanography",
volume=40,
number=2,
year=1995,
pages="411--415",
}
1/4/2010 45
Sample BibTex
Booklet Entry
@BOOKLET{Sherwood,
author="D.A. Sherwood",
title="Phosphorus Loads Entering Long Pond, A
Small Embayment of Lake Ontario near
Rochester, New York",
howpublished="USGS Fact Sheet 128-99",
pages=4,
month="November",
year=1999,
}
1/4/2010 46
Sample BibTex
Proceedings Entry
@INPROCEEDINGS{Stoermer,
author="E.F. Stoermer",
title="Nearshore phytoplankton populations in
the Grand Haven, Michigan vicinity during
thermal bar conditions",
booktitle="Proceedings of the 11th Conference
on Great Lakes Research",
pages="137--150",
year=1968,
}
1/4/2010 47
Commands to Build and
View Document
To use xdvi viewer
% latex bib.tex
% bibtex bib.aux
% latex bib.tex
% latex bib.tex
% xdvi bib.dvi
1/4/2010 48
Running LaTeX
The simplest way to run LaTeX on a source
document is to do so at the UNIX command
line:
>latex test.tex
1/4/2010 49
Running LaTeX
We can view the document we have
created using a DVI viewer. The most
common one under UNIX is xdvi. Type
>xdvi test
to see the typeset document
It is important to realise that LaTeX
sometimes needs to be run several times to
resolve all references.
1/4/2010 50
Creating Latex Files
Bibtex compile x2
Latex compile x3
1/4/2010 52
How to run LaTeX
myfile.tex
print
1/4/2010 53
THANK YOU
1/4/2010 54