LaTeX is a typesetting program that allows users to write documents and format them to be camera-ready. It is frequently used in scientific fields like mathematics, physics, and engineering where it is important to manipulate equations and graphics. LaTeX provides professional layouts and features for scientific documents like citations that are not available in programs like Microsoft Word. The document provides examples of basic LaTeX code for formatting text and includes information on LaTeX packages that can be used to add additional functionality.
1 of 20
Download to read offline
More Related Content
LATEX.ppt
1. LaTeX
GUJARAT POWER ENGINEERING & RESEARCH INSTITUE,MEVAL
MEHSANA
JUNE 2012
Presented By:
Rajesh Patel
Assistant Professor,
Computer Engineering Department
3. What is LaTeX ?
3
LaTeX is a typesetting program and is an extension of the original program TEX
written by Donald Knuth.
Document markup language.
Latex is a computer language for Generating scientific documentation that is
camera-ready..
What is a typesetting program?
Various stages in the preparation of a document
using computers.
1. The text is entered into the computer.
2. The input text is formatted into lines, paragraphs and pages.
3. The output text is displayed on the computer screen.
4. The final output is printed.
4. 4
LaTeX is the frequent choice in certain fields of sciences, like mathematics,
physics, or engineering.
Professionals in these fields are comfortable with the technical complexity
associated with the text file that looks like a computer program and, more
importantly, scientists and engineers frequently need to manipulate large quantities of
equations and graphics.
Desktop word processors like Microsoft Word are ill-suited for this. Furthermore,
problems with Word include:
Math equations involve a slow "select-point-click" process
Editing math equations are time-consuming
Difficult changing references to bibliography entries, footnotes, tables and
figure numbers
Resulting .doc file is huge when involving figures
Slow screen refresh when figures involved - can't enter/edit/scroll text while
figure is loading
Motivation
5. Comparison
5
Area Ms Word LaTeX
Open source No Yes
Speed- small docs The strength of Word is in
writing short, relatively simple
documents
Writing raw LaTeX is somewhat
slower, because you first write the
contents only and then you generate an
output file with layout in a separate
step.
Speed -big docs w
graphics
Word becomes slow when
handling either very large texts
or texts with large graphics.
Here LaTeX is faster because you write
down only the contents and software
wastes no time thinking about layout.
Ease of use Basic Word features are very easy
to use and everybody can
produce a simple document with
reasonable layout
You will have to initially invest some
hours to learn LaTeX without being
able to immediately produce text.
6. Contd..
6
Layout quality Word type setting quality is ok
for most purposes but its far
from professional.
LaTeX, on the other hand, provides
you with professional layout out of the
box.
Scientific
features
Here the main shortcoming is
that Word does not include a
citation utility. You will need to
purchase additional software to
fill the gap. Bibliography
programmers come with their
own price.
Since LaTeX is open source. Scientists
have written the extensions they
needed.
7. Contd..
7
price + availability This is obvious. You have to pay
for Word and Referencing
software
LaTeX is free of charge. So are
most text editors, like TexShop,
and citation managers, like
BiBDesK, WinEdit etc. are
available.
Compatibility MS Word developers make
almost no effort to facilitate
exchange with foreign
programmes. But even between
flavours of Word there are
compatibility problems, e.g.
WinWord vs. MacWord or
latest version to older version.
This is not the case with LaTeX.
The main output format is PDF,
which is the same over all OSs.
LaTeX editors exist for all types of
systems and are highly
compatible.
8. Open Source Sofwares
TEX file Creation
Latex is a Computer language - one creates and compiles files having names
with a .tex extension. If there are no syntax errors, the resulting output
filename extension is .dvi which stands for device independent. This dvi file
can be processed into a camera-ready format called a Postscript file, having a
.ps extension.
Miktex : miktex-2.0-lvl-1.zip (12.3 MB)
WinEdit: Tex editor
8
9. MiKTEX (pronounced mik-tech) is an up-to-date implementation of TEX and related
programs for Windows (all current variants) on x86 systems. TEX is a typesetting system
invented by D. E. Knuth.
MiKTEXs main features include:
Easy to install: MiKTEX comes with a setup program that allows you to install the
distribution via the Internet.
Integrated package management: missing packages can be installed automatically (on-
the-fly) during run-time
Network friendly: MiKTEX can be run directly from a shared and read-only network
directory
Complete: the MiKTEX distribution contains almost all packages that are freely
redistributable.
Enhanced TEX compiler capabilities
Enhanced previewer capabilities
Open source: MiKTEX source code is available for everyone
9
MiKTEX
10. 10
Example.txt
documentclass{article}
begin{document}
This is my emph{first} document prepared in LaTeX.
end{document}
The first line documentclass{article} tells LATEX that what we want to produce
is an article.
The whole document we want to typeset should be included between
begin{document} and end{document}.
emph is a command to LATEX to typeset the text within the braces in italic1
Sample Example
11. Contd ..
11
A LaTeX document starts with the command documentclass [option] {type}. The most
common document-classes in LaTex are:
1.book
2.report
3.article
4.letter
Available document structure commands:
Book: part{}, chapter{}, section{}, subsection{}, subsubsection{}, paragraph{}, subparagraph{}.
Report: part{}, chapter{}, section{}, subsection{}, subsubsection{}, paragraph{}, subparagraph{}.
Article: part{}, section{}, subsection{}, subsubsection{}, paragraph{}, subparagraph{}.
Letter: A letter does not know the same structuring commands as other formats, but more specific
commands like signature{}, address{}, opening{} and closing{}.
12. Templet.txt
documentclass[11pt]{article}
usepackage{graphicx} % needed for including graphics e.g. PS
topmargin -1.5cm
oddsidemargin -0.04cm
evensidemargin -0.04cm % same as oddsidemargin but for left-hand pages
textwidth 16.59cm
textheight 21.94cm
%pagestyle{empty} % Uncomment if don't want page numbers
parskip 7.2pt % sets spacing between paragraphs
%renewcommand{baselinestretch}{1.5} % Uncomment for 1.5 spacing between lines
parindent 0pt % sets leading space for paragraphs
begin{document}
% Start your text
% Stop your text
end{document}
12
13. Document -latex
begin{center}
The Technical Institute[.75cm]
Certificate
end{center}
noindent This is to certify that Mr. N. O. Vice has undergone a
course at this institute and is qualified to be a Technician.
begin{flushright}
The Director
The Technical Institute
end{flushright}
Here, the commands
begin{center} ... end{center}
typesets the text between them exactly at the center of the page
13
15. begin{center}
{bfserieshuge The TeX nical Institute}[1cm]
{scshapeLARGE Certificate}
end{center}
noindent This is to certify that Mr. N. O. Vice has undergone a
course at this institute and is qualified to be a TeX nical Expert.
begin{flushright}
{sffamily The Director
The TeX nical Institute}
end{flushright}
16. 16
LaTEx Packages
Package Name Description
amsmath It contains the advanced math extensions for LaTeX. Mathematics
amssymb It adds new symbols in to be used in math mode.
graphicx To manage external pictures
Cite Assists in citation management
Color It adds support for colored text. relevant section
Rotating It lets you rotate any kind of object. It is particularly useful for rotating
tables
wrapfig To insert images surrounded by text.
xypic Used to create trees, graphs, (commutative) diagrams, and similar things.
Array it extends the possibility of LaTeX to handle tables, adding new features.
Using it, you can create very complicated and customized tables
hyperref it gives LaTeX the possibility to manage links within the document or to any
URL when you compile in PDF.
17. 17
To use a package already installed on your system, insert a usepackage command in your document
preamble with the package name in curly braces:
usepackage{package_name}
For example, to use the color package, which lets you typeset in colors, you would type:
documentclass[a4paper, oneside]{report}
usepackage{color}
begin{document}
...
end{document}
usepackage{package1,package2,package3}
How to Import Package ?