Latex Vtu Ws
Latex Vtu Ws
Latex Vtu Ws
1/4/2010
1/4/2010
COVERAGE
Basic structure and essentials of Latex Syntax and Symantics of Latex
Dr T.N.Nagabhushan
Generating Figure/Graphs, Structure of the VTU template, Actual compilation, Running through the Thesis tex file Hands on
Dr S.K.Padma
1/4/2010
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
1/4/2010
1/4/2010
1/4/2010
The design of a whole new layout is difficult and takes a lot of time.
Templates help you here
1/4/2010
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 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. 11
1/4/2010
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.
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
1/4/2010
14
1/4/2010
15
1/4/2010
16
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 isnt
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
Now you enter the text mixed with some useful LaTeX commands. At the end of the document you use the
\end{document}
command, which tells LaTeX to finish. Anything which follows this command will be ignored by LaTeX
1/4/2010 20
\documentclass
{article} {report} {book} {letter}
Basic Classes
First line of all LaTeX documents specifies the {type} of the document and the [stylesheet] used.
\documentclass[ieee]{article}
1/4/2010
21
1/4/2010
22
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
To find the square of the hypotenuse, add a squared to b squared to find c squared, e.g. $a^2 + b^2 = c^2$. Its as easy as that! To find the square of the hypotenuse, add a squared to b squared to find c squared, e.g. a 2 + b 2 = c 2 . Its as easy as that!
1/4/2010
27
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}
1/4/2010
28
Typesetting Mathematics
x = \frac{-b \pm \sqrt{b^2-4ac} } {2a}
1/4/2010
29
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
it is clear that > 0. (1) \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)
1/4/2010 31
Typesetting Mathematics
Matrices are produced using the \textbf{array} environment. Example:
The \emph{characteristic polynomial} $\chi(\lambda)$ of the $3 \times 3$~matrix \[ \left( \begin{array}{ccc} a & b & c \\ d & e & f \\ g & h & i \end{array} \right)\] is given by the formula \[ \chi(\lambda) = \left| \begin{array}{ccc} \lambda - a & -b & -c \\ -d & \lambda - e & -f \\ -g & -h & \lambda - i \end{array} \right|.\]
1/4/2010 32
Including Graphics
LaTeX2e includes a standard package for including PostScript graphics in your document. Load it using
\usepackage{graphics}
Tabular
Columns
Two Columns
l = automatically adjust size, left justify r = automatically adjust size, right justify p = set size e.g p{4.7cm} c = centre text
\begin{tabular}{|||} \end{tabular}
Rows
& - Split text into columns \\ - 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}
Price 5 3
1/4/2010
36
Cross-referencing
\label{marker} \ref{marker} \pageref{marker} Example: \section{Introduction} \label{intro}
As mentioned in section \ref{intro} in page pageref{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
1/4/2010
39
month note number organization pages publisher school series title type=Ph.D. dissertation volume year
40
1/4/2010
44
1/4/2010
45
1/4/2010
46
1/4/2010
47
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
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
Output Formats
.dvi .ps .pdf .rtf .html .xml Device Independent Post Script PDF Rich Text Format HTML XML
1/4/2010
52
myfile.ps
53
THANK YOU
1/4/2010
54