SlideShare une entreprise Scribd logo
LaTeX tutorial
Syed Shazli
Most of the material taken from
Monash University
Online material available from Googling…
Preface
 LaTeX is a typesetting system (not a word
processor).
 It is most suited to producing scientific and
mathematical documents of high
typographical quality.
Why not MS Word?
Advantages and Disadvantages (1)
 Advantages of LaTeX over WYSIWYG:
 professionally crafted layouts are available
 the typesetting of mathematical formulae is
supported in a convenient way
 users need only to learn a few simple commands,
which specify the logical structure of a document.
Advantages and Disadvantages (2)
 Advantages of LaTeX over WYSIWYG:
 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
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
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
Spaces
 Whitespace characters (e.g. blank, tab, single
linebreak) 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 of several spaces after a
word.
An empty line starts a new
paragraph.
It does not matter whether you enter one or
several spaces after a word.
An empty line starts a new paragraph.
Spaces
It does not
matter whether
you enter one of
several spaces
after a word.
An empty line
starts a new
paragraph.
It does not matter
whether you enter one
or several spaces
after a word.
An empty line starts a
new paragraph.
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.
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.
LaTeX Commands (2)
I read that Knuth divides
people working with TeX
into TeXnicians and
TeXperts. Today is March
25th, 2004.
I read that Knuth
divides people
working with
TeX{} into
TeX{}nicians and
TeX perts. Today
is today.
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.
LaTeX Commands (4)
This is emphasized
text.
Please start a new line
right here!
Thank you!
This is
emph{emphasized} text.
Please start a new line
right here!linebreak
Thank you!
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.
This text is processed. % A comment
isn’t
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, cssethesis, 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{...}
Input File Structure (2)
 When all the setup work is done, you start the
body of the text with the command:
begin{document}
 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
Parts of a LaTeX Document:
documentclass
 First line of all LaTeX documents specifies
the {type} of the document and the
[stylesheet] used.
{article}
{report}
{book}
{letter}
Basic Classes
documentclass[ieee]{article}
A Simple LaTeX Document
documentclass{article}
begin{document}
This is some sample text.
end{document}
A more realistic LaTeX file
documentclass[a4paper,11pt]{article}
usepackage{latexsym}
author{S.~Shazli}
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}
Sections
section{Section Title}
subsection{Title}
subsubsection{Title}
Font size
tiny scriptsize footnotesize
small normalsize
large Large
LARGE huge
Huge
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
To find the square of
the hypotenuse, add a
squared to b squared
to find c squared,
e.g. .
It’s as easy as that!
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$. It’s
as easy as that!
2
2
2
c
b
a 

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}
Typesetting Mathematics
x = frac{-b pm sqrt{b^2-4ac} } {2a}
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
 (note that label and ref are used with figures and tables too)
… it is clear that
e > 0. (1)
From Equation 1 it follows that
...
ldots it is clear
that
begin{equation}
epsilon > 0.
label{eq:eps}
end{equation}
From
Equation~ref{eq:eps}
it follows that
ldots
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|.]
Including Graphics
 LaTeX2e includes a standard package for
including PostScript graphics in your
document. Load it using
usepackage{graphics}
 A figure can be included using, for example,
begin{figure}[ht]
begin{center}
includegraphics[width=140mm]{mypic.ps}
end{center}
caption{An example of a figure.}
label{fig:example}
end{figure}
Figures and Tables
 Figures & Tables cannot be broken between
pages
 They are “floated”
begin{figure}
includegraphics{sample}
caption{A sample figure.}
end{figure}
 Columns
 begin{tabular}{|…|…|}
 end{tabular}
 Rows
 & - Split text into columns
  - End a row
 hline - Draw line under row
 e.g. 123123 & 34.00 hline
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
Tabular
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 5 Big
Today 3 Small
Cross-referencing
label{marker}
ref{marker}
pageref{marker}
 Example:
section{Introduction}
label{intro}
…
As mentioned in section ref{intro} in page pageref{intro}
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
Bibliographies
By far the most
commonly used feature
is color (e.g.
[1,2,3]), usually
computed in a colour
space thought to be
“perceptually
accurate” (e.g. HSV
[3] or CIE [4].
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
 Example BibTeX entries from a .bib file:
@book{AhR1975,
author = {N. Ahmed and K. Rao},
title = {Orthogonal transforms for digital signal
processing},
publisher = {Springer-Verlag},
year = {1975},
address = {New York},
}
@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
 The simplest way to run LaTeX on a source
document is to do so at the UNIX command
line:
 These will be:
>latex test.tex
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
 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.
Your Latex File Your Bibtex File
Latex compile x3
Bibtex compile x2
Latex compile x3
Your Postscript File
dvips compile x1
Device independent
output .dvi
(a text file)
Creating Latex Files
Output Formats
 .dvi Device Independent
 .ps Post Script
 .pdf PDF
 .rtf Rich Text Format
 .html HTML
 .xml XML
1
Further reading
 http://www.ctan.org/tex-archive/info/lshort/english/
 Google

Contenu connexe

Similaire à LaTeX_tutorial_Syed_Jan09.ppt

Latex Notes
Latex NotesLatex Notes
Latex Notes
Sudhanshu Janwadkar
 
Latex Tuitorial
Latex TuitorialLatex Tuitorial
Latex Tuitorial
ankitsinghaniya
 
Latex workshop
Latex workshopLatex workshop
Latex workshop
Aisha Abdullahi
 
La tex basics
La tex basicsLa tex basics
La tex basics
awverret
 
latex document for IT workshop Lab . B.Tech
latex document for IT workshop Lab . B.Techlatex document for IT workshop Lab . B.Tech
latex document for IT workshop Lab . B.Tech
Sandhya Gandham
 
Latex for beginners
Latex for beginnersLatex for beginners
Latex for beginners
Kaushik Naik
 
latex.pptx
latex.pptxlatex.pptx
latex.pptx
muhammadzeeshan607
 
Learn Latex
Learn LatexLearn Latex
Learn Latex
Haitham El-Ghareeb
 
LaTeX for B.Sc. Mathematics,an introduction
LaTeX for B.Sc. Mathematics,an introductionLaTeX for B.Sc. Mathematics,an introduction
LaTeX for B.Sc. Mathematics,an introduction
jayakumarc9
 
latex-workshop Dr: Mohamed A. Alrshah
latex-workshop Dr: Mohamed A. Alrshahlatex-workshop Dr: Mohamed A. Alrshah
latex-workshop Dr: Mohamed A. Alrshah
Abdulazim N.Elaati
 
Chap03 scr
Chap03 scrChap03 scr
Chap03 scr
Hirwanto Iwan
 
Introduction to Overleaf Workshop
Introduction to Overleaf WorkshopIntroduction to Overleaf Workshop
Introduction to Overleaf Workshop
Olga Scrivner
 
Introduction to LaTeX
Introduction to LaTeXIntroduction to LaTeX
Introduction to LaTeX
sahirbhatnagar
 
Introduction to Latex
Introduction to LatexIntroduction to Latex
Introduction to Latex
Mohamed Alrshah
 
Latex - Companion for a Researcher - A Review.ppt
Latex - Companion for a Researcher - A Review.pptLatex - Companion for a Researcher - A Review.ppt
Latex - Companion for a Researcher - A Review.ppt
LadallaRajKumar
 
Latex - now it is easy!
Latex - now it is easy!Latex - now it is easy!
Latex - now it is easy!
Arundeepsidhu
 
LaTeX Survival Guide
LaTeX Survival Guide LaTeX Survival Guide
LaTeX Survival Guide
Dylan Seychell
 
Latex
LatexLatex
Latex hafida-benhidour-19-12-2016
Latex hafida-benhidour-19-12-2016Latex hafida-benhidour-19-12-2016
Latex hafida-benhidour-19-12-2016
مركز البحوث الأقسام العلمية
 
Latex intro
Latex introLatex intro
Latex intro
NEERAJ BAGHEL
 

Similaire à LaTeX_tutorial_Syed_Jan09.ppt (20)

Latex Notes
Latex NotesLatex Notes
Latex Notes
 
Latex Tuitorial
Latex TuitorialLatex Tuitorial
Latex Tuitorial
 
Latex workshop
Latex workshopLatex workshop
Latex workshop
 
La tex basics
La tex basicsLa tex basics
La tex basics
 
latex document for IT workshop Lab . B.Tech
latex document for IT workshop Lab . B.Techlatex document for IT workshop Lab . B.Tech
latex document for IT workshop Lab . B.Tech
 
Latex for beginners
Latex for beginnersLatex for beginners
Latex for beginners
 
latex.pptx
latex.pptxlatex.pptx
latex.pptx
 
Learn Latex
Learn LatexLearn Latex
Learn Latex
 
LaTeX for B.Sc. Mathematics,an introduction
LaTeX for B.Sc. Mathematics,an introductionLaTeX for B.Sc. Mathematics,an introduction
LaTeX for B.Sc. Mathematics,an introduction
 
latex-workshop Dr: Mohamed A. Alrshah
latex-workshop Dr: Mohamed A. Alrshahlatex-workshop Dr: Mohamed A. Alrshah
latex-workshop Dr: Mohamed A. Alrshah
 
Chap03 scr
Chap03 scrChap03 scr
Chap03 scr
 
Introduction to Overleaf Workshop
Introduction to Overleaf WorkshopIntroduction to Overleaf Workshop
Introduction to Overleaf Workshop
 
Introduction to LaTeX
Introduction to LaTeXIntroduction to LaTeX
Introduction to LaTeX
 
Introduction to Latex
Introduction to LatexIntroduction to Latex
Introduction to Latex
 
Latex - Companion for a Researcher - A Review.ppt
Latex - Companion for a Researcher - A Review.pptLatex - Companion for a Researcher - A Review.ppt
Latex - Companion for a Researcher - A Review.ppt
 
Latex - now it is easy!
Latex - now it is easy!Latex - now it is easy!
Latex - now it is easy!
 
LaTeX Survival Guide
LaTeX Survival Guide LaTeX Survival Guide
LaTeX Survival Guide
 
Latex
LatexLatex
Latex
 
Latex hafida-benhidour-19-12-2016
Latex hafida-benhidour-19-12-2016Latex hafida-benhidour-19-12-2016
Latex hafida-benhidour-19-12-2016
 
Latex intro
Latex introLatex intro
Latex intro
 

Dernier

Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
devvsandy
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
Marcin Chrost
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 

Dernier (20)

Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 

LaTeX_tutorial_Syed_Jan09.ppt

  • 2. Most of the material taken from Monash University Online material available from Googling…
  • 3. Preface  LaTeX is a typesetting system (not a word processor).  It is most suited to producing scientific and mathematical documents of high typographical quality.
  • 4. Why not MS Word?
  • 5. Advantages and Disadvantages (1)  Advantages of LaTeX over WYSIWYG:  professionally crafted layouts are available  the typesetting of mathematical formulae is supported in a convenient way  users need only to learn a few simple commands, which specify the logical structure of a document.
  • 6. Advantages and Disadvantages (2)  Advantages of LaTeX over WYSIWYG:  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
  • 7. 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
  • 8. 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
  • 9. Spaces  Whitespace characters (e.g. blank, tab, single linebreak) 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 of several spaces after a word. An empty line starts a new paragraph. It does not matter whether you enter one or several spaces after a word. An empty line starts a new paragraph.
  • 10. Spaces It does not matter whether you enter one of several spaces after a word. An empty line starts a new paragraph. It does not matter whether you enter one or several spaces after a word. An empty line starts a new paragraph.
  • 11. 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.
  • 12. 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.
  • 13. LaTeX Commands (2) I read that Knuth divides people working with TeX into TeXnicians and TeXperts. Today is March 25th, 2004. I read that Knuth divides people working with TeX{} into TeX{}nicians and TeX perts. Today is today.
  • 14. 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.
  • 15. LaTeX Commands (4) This is emphasized text. Please start a new line right here! Thank you! This is emph{emphasized} text. Please start a new line right here!linebreak Thank you!
  • 16. 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. This text is processed. % A comment isn’t
  • 17. 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, cssethesis, 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{...}
  • 18. Input File Structure (2)  When all the setup work is done, you start the body of the text with the command: begin{document}  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
  • 19. Parts of a LaTeX Document: documentclass  First line of all LaTeX documents specifies the {type} of the document and the [stylesheet] used. {article} {report} {book} {letter} Basic Classes documentclass[ieee]{article}
  • 20. A Simple LaTeX Document documentclass{article} begin{document} This is some sample text. end{document}
  • 21. A more realistic LaTeX file documentclass[a4paper,11pt]{article} usepackage{latexsym} author{S.~Shazli} 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}
  • 23. Font size tiny scriptsize footnotesize small normalsize large Large LARGE huge Huge
  • 24. 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
  • 25. To find the square of the hypotenuse, add a squared to b squared to find c squared, e.g. . It’s as easy as that! 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$. It’s as easy as that! 2 2 2 c b a  
  • 26. 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}
  • 27. Typesetting Mathematics x = frac{-b pm sqrt{b^2-4ac} } {2a}
  • 28. 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  (note that label and ref are used with figures and tables too) … it is clear that e > 0. (1) From Equation 1 it follows that ... ldots it is clear that begin{equation} epsilon > 0. label{eq:eps} end{equation} From Equation~ref{eq:eps} it follows that ldots
  • 29. 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|.]
  • 30. Including Graphics  LaTeX2e includes a standard package for including PostScript graphics in your document. Load it using usepackage{graphics}  A figure can be included using, for example, begin{figure}[ht] begin{center} includegraphics[width=140mm]{mypic.ps} end{center} caption{An example of a figure.} label{fig:example} end{figure}
  • 31. Figures and Tables  Figures & Tables cannot be broken between pages  They are “floated” begin{figure} includegraphics{sample} caption{A sample figure.} end{figure}
  • 32.  Columns  begin{tabular}{|…|…|}  end{tabular}  Rows  & - Split text into columns  - End a row  hline - Draw line under row  e.g. 123123 & 34.00 hline 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 Tabular
  • 33. 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 5 Big Today 3 Small
  • 35. 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
  • 36. Bibliographies By far the most commonly used feature is color (e.g. [1,2,3]), usually computed in a colour space thought to be “perceptually accurate” (e.g. HSV [3] or CIE [4]. 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}).
  • 37. Bibliographies  Example BibTeX entries from a .bib file: @book{AhR1975, author = {N. Ahmed and K. Rao}, title = {Orthogonal transforms for digital signal processing}, publisher = {Springer-Verlag}, year = {1975}, address = {New York}, } @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...}, }
  • 38. Running LaTeX  The simplest way to run LaTeX on a source document is to do so at the UNIX command line:  These will be: >latex test.tex 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
  • 39. 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.
  • 40. Your Latex File Your Bibtex File Latex compile x3 Bibtex compile x2 Latex compile x3 Your Postscript File dvips compile x1 Device independent output .dvi (a text file) Creating Latex Files
  • 41. Output Formats  .dvi Device Independent  .ps Post Script  .pdf PDF  .rtf Rich Text Format  .html HTML  .xml XML 1