By

Mrs. Mini.T.I

Assistant Professor

Department of mathematics

Mar Dionysius College, Pazhanji

Thrissur

LaTeX

LaTeX is a program for typesetting documents on a computer. It may be pronounced "La-Tech" with "La" as in last and "Tech" as in technology. Note the special arrangement of capital letters in LaTeX.It was created by L.Lamport based on Tex designed by D.Knuth.It is very suitable for producing scientific and mathematical documents of typographical quality.

LaTeX allows you to focus on the content of a document without wasting time on typesetting and page layout. LaTeX is not a WYSIWYG program You may think at first that LaTeX is mysterious and complicated. However, after a little practice, you are likely to find it easier than WYSIWYG systems.

LaTeX Files

The Input File

The input to LaTeX is plain text with commands showing the structure of the document and the special symbols needed. The input to LaTeX is an ASCII text file. The file name must have the file extension .tex.

Document Classes

The main document classes supported by Latex are book,article, letter, report, etc.

All LaTeX commands begin with backslash \ character.

The first line in this latex source file is \documentclass[options]{class},

For example \documentclass[12pt]{article},this is to produce a

document in the form of an article.

Next comes the body of the document with the command

\begin{document} at the beginning and

\end{document} at the end

An example of a very simple document is shown below

INPUT

\documentclass[a4paper,12pt]{article}

\begin{document}

This is an example of a very simple

document containing only one sentence.

\end{document}

OUTPUT

This is an example of a very simple

document containing only one sentence.

Writing Ordinary Text in the Input File

Paragraphs

Type ordinary text in the usual way. An empty line, obtained by

pressing the [Enter] key twice, marks the end of a paragraph.

To break a line without marking the end of the paragraph use a

double backslash \\.

Special Characters

Special characters that cannot be typed in the usual way are as follows:

$ & % # { } _ ^ ~ \

However, some of them can be made to appear in your text with the

help of the backslash as follows:

\$ \& \% \# \{ \} \_

Quote Marks

Do not use the double quote " for quotations. Instead use one or two `

marks (` or ``) for opening a quotation and one or two ' marks (' or '')

for closing the quotation.

Hyphens and Dashes

Use - for hyphens in words, -- for short dashes in number ranges, and

--- for long dashes in sentence punctuation.

Emphasis

Use \emph{text} to emphasize text. This prints the text between the

brackets in italics.

Spacing

LaTeX manages the spacing of words automatically. However, in

some cases we must control the spacing with special commands.

Use \, to produce a small space, for example between a number and

a unit symbol: 64\,km.

LaTeX assumes that a full stop after a small letter marks the end of a

sentence and inserts a long space before the next word. To prevent

this use \ followed by a single space. Use ~ to make a hard space as

in Fig.~5.

When a full stop comes after a capital letter LaTeX assumes the full

stop marks an abbreviation and not the end of a sentence. Use \@. to

mark a full stop at the end of a sentence ending with a capital letter:

DIVIDING THE DOCUMENT

Sections in the document are generated using sectioning

commands

\section{section heading}

\subsection{...}

\subsubsection{...}

Command to generate the table of contents is

\tableofcontents

Example

INPUT

\documentclass{article}

\begin{document}

\tableofcontents

\section{Animals}

This document defines sections.

\subsection{Domestic}

This document also defines subsections.

\subsubsection{cats and dogs}

Cats and dogs are domestic animals.

\end{document}

OUTPUT

Contents

1.Animals 1

1.1 Domestic……………….1

1.1.1 Cats and dogs…..1

1.Animals

This document defines sections.

1.1 Domestic

This document also defines subsections.

1.1.1 Cats and dogs

Cats and dogs are domestic animals

ENVIRONMENTS

Environments decide the way in which the text is to be formatted.

numbered lists, table,equations, quotations, justifications, figure,

etc. are some of the environments.

Environments are defined like :

\begin{environment name}

your text

\end{environment name}

Example

Input

documentclass{article}

\begin{document}

\begin{flushleft} A bulleted list. \end{flushleft}

\begin{itemize} \item dog \item cat \end{itemize}

\begin{center} A numbered List. \end{center}

\begin{enumerate} \item dog \item cat \end{enumerate}

\begin{flushright} This text is right justified. \end{flushright}

\begin{quote}

Any text inside quote\\ environment will appe-\\ ar as typed.\\

\end{quote}

Output

A bulleted list.

. dog

. cat

A numbered List.

1. dog

2. cat

This text is right justified.

Any text inside quote

environment will appe-

ar as typed.

TITLES

The title is generated using the following commands

\title{your title}

\author{author name}

\date{date to appear in title}

\maketitle

EXAMPLE

INPUT

\documentclass[12pt]{article}

\title{Gnus of the World}

\ author{R .Dather \and J.Pennings \and B.Talkmore}

\date{26 March 2011}

\begin {document}

\make title

Matter

\end {document}

OUTPUT

Gnus of the world

R .Dather J.Pennings B.Talkmore

26 March 2011

Matter

MATHEMATICS

Math Mode Environments

To insert mathematical expressions into a line of text use $ at the

beginning and end of the expression.

Example: The solution of the equation $3x - 2 = 7$ is $x = 3$.

An unnumbered centered equation is displayed using the commands

\[ and \] as follows:

The distributive law of multiplication over addition is:

\[ a(b + c) = ab + ac \]

A numbered centered equation is displayed as follows:

\begin{equation}

a(b+c)=ab+ac

\end{equation}

There many commands for typesetting mathematics in math mode

environments.

A few of the simple commands are given below

In the examples below the brackets { and } are used to group

symbols into expressions treated as single units in the mathematical

structures.

Common Structures

a', a'', ...

Primes: a', a", ...

x_i, x_{i+1}

Subscripts: xi, xi+1

x^2, x^{m+n}

Superscripts: x2, xm+n

\sqrt{expression}

The square root of the expression in brackets.

\frac{numerator}{denominator}

A double line fraction.

\int_a^b f(x)\,dx

The integral from a to b of f(x) with respect to x. Note the small

space between f(x) and dx.

Common Mathematical Symbols

\ldots, \cdots

Three dots (...) at the bottom of the line, and three dots in the

center of the line (···).

\pm, \times, \leq, \geq, \approx

Plus or minus +, times ×, less than or equal , greater than or

equal , approximately equal.

\circ

A small circle useful as a superscript indicating degrees.

\alpha, \beta, \gamma, \delta, ...

Lower case Greek letters.

\Gamma, \Delta, ...

Upper case Greek letters. Note that they start with a capital

letter.

\exp x, \ln(1+x), \sin \theta, \cos(A+B)

CONCLUSION

LATEX encourages authors not to worry too much about the

appearance of their documents but to concentrate on getting the right

content. You prepare your document using a plain text editor, and the

formatting is specified by commands embedded in your document.

The appearance of your document is decided by LaTeX, but you

need to specify it using some commands.

3