SlideShare a Scribd company logo
1 of 31
Download to read offline
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics
Introduction to LATEX
Suddhasheel Ghosh
Department of Civil Engineering,
Jawaharlal Nehru Engineering College
Aurangabad, Maharashtra
431003
LATEX for Technical and Scientific Documents
January 12 - 16, 2015
Day I
shudh@JNEC LATEX@ JNEC 1 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics
Outline
1 Why should we use LATEX
Etymology
2 Parts of a LATEX document
The Preamble
The body
Text styles
3 Mathematical typesetting
4 Graphics
Tables
shudh@JNEC LATEX@ JNEC 2 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Etymology
Outline
1 Why should we use LATEX
Etymology
2 Parts of a LATEX document
The Preamble
The body
Text styles
3 Mathematical typesetting
4 Graphics
Tables
shudh@JNEC LATEX@ JNEC 3 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Etymology
Why should we use LATEX
Motivation
Free Software (I do not have to worry about viruses and
software piracy)
Rendering mathematics is easier
No worries about setting the font size and styles again and
again
Because I am tired of figures and tables jumping from here and
there
Because I want my sections and subsections autonumbered
Because my fingers are tired with a click-find-click approach
What all do I have to do?
Remember the basic structure of a document
Remember a few macros
shudh@JNEC LATEX@ JNEC 4 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Etymology
Etymology of LATEX
... the origins
Initially TEX was developed by Donald Knuth
Leslie Lamport extended the software to LATEX
TEX is pronounced ‘Tech’ and was initially written as τ χ
LATEX stands for Lamport TEX and is pronounced as ‘Lay-Tech’
However, many pronounce it as ‘Lateks’ (as in rubber)
What can we do with LATEX?
We can create research papers, reports, thesis, presentations,
posters and leaflets.
shudh@JNEC LATEX@ JNEC 5 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Etymology
In this workshop:
Day 1: Introduction to LATEX
Day 2: Typesetting Mathematics
Day 3: Writing your thesis / technical report
Day 4: Make your presentations
Day 5: Basics of science communication
shudh@JNEC LATEX@ JNEC 6 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Etymology
Where do I get LATEX?
...and use it
LaTeX Software
For Windows:
www.miktex.org
Download a complete DVD as torrent from www.texlive.org
For Linux:
Download a complete DVD as torrent from www.texlive.org
Part of the Ubuntu Linux distribution (sudo apt-get
install texlive)
shudh@JNEC LATEX@ JNEC 7 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Etymology
Writing files in LATEX
... and getting outputs
The LATEX “code” is written in a .tex file
LaTeX package compiles the file to produce PDF, DVI or PS files
Windows editors (IDE)
WinEdit
TeXNicCenter
LyX (What you see is what you get type)
Linux editors (IDE)
Texworks
TeXStudio
TeXMaker
LyX
shudh@JNEC LATEX@ JNEC 8 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Preamble Body Style
Outline
1 Why should we use LATEX
Etymology
2 Parts of a LATEX document
The Preamble
The body
Text styles
3 Mathematical typesetting
4 Graphics
Tables
shudh@JNEC LATEX@ JNEC 9 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Preamble Body Style
Parts of a LATEX document
Preamble
Style or class of a document
Packages to be used
Macro definitions
Body
Sections and subsections
Tables and figures
Body text
shudh@JNEC LATEX@ JNEC 10 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Preamble Body Style
Parts of a LATEX document
The preamble
Makes announcements
Style of the document
Packages to be used
Definitions of macros
shudh@JNEC LATEX@ JNEC 11 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Preamble Body Style
Let us get our hands dirty!
The Preamble
We shall use the base class article
documentclass{article}
Want A4 paper size? Two-sided document?
documentclass[a4paper,twoside]{article}
What about setting the margins?
usepackage[top=2cm,bottom=4cm,left=1.5cm,
right=3cm,assymetric]{geometry}
Therefore, overall settings for A4 size paper, and margins:
documentclass[a4paper,twoside]{article}
usepackage[top=2cm,bottom=4cm,left=1.5cm,right=3cm,
asymmetric]{geometry}
shudh@JNEC LATEX@ JNEC 12 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Preamble Body Style
Let us get our hands dirty
...and let’s start writing papers
Announce the title, the author and date
title{My first LaTeX
paper}
author{Suddhasheel Ghosh}
%write here or the date
appears automatically
date{}
And then declare the contents of the document:
begin{document}
%this puts the title on
top
maketitle
end{document}
Here LaTeX, title, author, date, begin, end are all macros.
Macros are like functions. Anything between the braces “{}”, is the
argument to the function / macro.
shudh@JNEC LATEX@ JNEC 13 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Preamble Body Style
Let us get our hands dirty
Bold, italics, slanted underline
We can have {bf bold
text}, {textit
italicised text},
{sl slanted text}
and
underline{underlined
text}.
We can have bold text, italicised text, slanted text and
underlined text.
shudh@JNEC LATEX@ JNEC 14 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Preamble Body Style
Let us get our hands dirty
Subscripts and superscripts
In your preamble, add the following line
usepackage{fixltx2e}
and inside the body write:
It is found that heighttextsubscript{apple tree} is
different than heighttextsubscript{orange tree}
and we obtain:
It is found that heightapple tree is different than
heightorange tree
shudh@JNEC LATEX@ JNEC 15 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Preamble Body Style
Let us get our hands dirty
Line spacing
Line spacing can be set to single line, one and a half line, double line
spacings, and any other customized spacings. In the preamble, use
usepackage{setspace}
... and in the body write any one:
singlespacing
onehalfspacing
doublspacing
setstretch{1.1}
shudh@JNEC LATEX@ JNEC 16 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Preamble Body Style
Let us get our hands dirty
Coloured text
In your preamble, add the following line
usepackage{color}
%this gives about 16 colour options
Alternatively, one can write:
usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
%Gives about 16+64+150
colours
Therefore, we can have red coloured text, and a blue coloured text,
and back to the black colour, by
Therefore, we can have {color{red}red coloured text},
and a {color{blue}blue coloured text}, and back to
the black colour.
shudh@JNEC LATEX@ JNEC 17 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Preamble Body Style
Let us get our hands dirty
Itemized and numbered lists
begin{itemize}
item Item 1
item Item 2
item Item 3
end{itemize}
begin{enumerate}
item Item 1
item Item 2
item Item 3
end{enumerate}
Item 1
Item 2
Item 3
1 Item 1
2 Item 2
3 Item 3
Can you guess how we get multilevel lists?
shudh@JNEC LATEX@ JNEC 18 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Preamble Body Style
Let us get our hands dirty
Typesetting environments
LaTeX has various environments, which start and end with the
begin and end commands.
abstract
equation
center
raggedright
For example
begin{abstract}
Tomatoes have long been
considered as the
cause of kidney
stones. Researches
have been trying to
eliminate this trait
of the tomatoes
through genetic
engineering.
end{abstract}
shudh@JNEC LATEX@ JNEC 19 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Preamble Body Style
Let us get our hands dirty
Font sizes
Sample
Sample
Sample
Sample
Sample
Sample
Sample
Sample
Sample
Sample
tiny Sample
scriptsize
Sample
footnotesize
Sample
small Sample
normalsize
Sample
large Sample
Large Sample
LARGE Sample
huge Sample
Huge Sample
shudh@JNEC LATEX@ JNEC 20 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics
Outline
1 Why should we use LATEX
Etymology
2 Parts of a LATEX document
The Preamble
The body
Text styles
3 Mathematical typesetting
4 Graphics
Tables
shudh@JNEC LATEX@ JNEC 21 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics
Playing with mathematics text
Mathematics environments
There are two kinds of math used in LATEX.
Inline math
Display math
About any point $x$ in a
metric space $M$ we define the
open ball of radius $r > 0$
about $x$ as the set
$$
B(x;r) = {y in M :
d(x,y) < r}.
$$
About any point x in a metric
space M we define the open ball
of radius r > 0 about x as the set
B(x;r) = {y ∈ M : d(x,y) < r}.
shudh@JNEC LATEX@ JNEC 22 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics
Typesetting equations
Numbered equations
Numbered equations can be typeset by using
begin{equation}
R(x,y) =
frac{Ax^3+Bx^2+Cx+D}{Ey^3
+ Fy + G}
end{equation}
R(x,y) =
Ax3
+Bx2
+Cx+D
Ey3 +Fy +G
(1)
shudh@JNEC LATEX@ JNEC 23 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Tables
Outline
1 Why should we use LATEX
Etymology
2 Parts of a LATEX document
The Preamble
The body
Text styles
3 Mathematical typesetting
4 Graphics
Tables
shudh@JNEC LATEX@ JNEC 24 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Tables
Inserting images
To include a graphics file duck.jpg in a LATEX file, type in the
preamble
%in the preamble
usepackage{graphicx}
and in the body
includegraphics{duck.jpg}
And, here it is:
shudh@JNEC LATEX@ JNEC 25 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Tables
Inserting images
..and numbering them
A paper would require numbering the images.
begin{figure}
centering
includegraphics{duck.jpg}
caption{A
picture
of a
duck
used at
muggle
homes
as a
toy}
end{figure}
Figure 1: A picture of a duck
used at muggle homes as a
toy
shudh@JNEC LATEX@ JNEC 26 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Tables
Inserting graphs in a LaTeX file
A gnuplot and LATEX combo
Start gnuplot, and write the following codes:
set term tikz color solid
size 4in,3in
set output "sin.tex"
set xr [-2*pi:2*pi]
plot sin(x) with lines
exit
In your preamble, use the following
usepackage{gnuplot-lua-tikz}
and, in the body, wherever you wish to insert the figure, type
input{sin}
shudh@JNEC LATEX@ JNEC 27 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Tables
Inserting graphs in a LaTeX file
A gnuplot and LATEX combo
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
-6 -4 -2 0 2 4 6
sin(x)
shudh@JNEC LATEX@ JNEC 28 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Tables
Inserting tables
Tables require the tabular environment.
begin{tabular}{lccc}
{} &Judge 1 &Judge 2 &Judge 3 hline
Katrina &7 &9 &10 
Karishma &9 &10 &7 
Kareena &10 &7 &9 hline
end{tabular}
will give:
Judge 1 Judge 2 Judge 3
Katrina 7 9 10
Karishma 9 10 7
Kareena 10 7 9
shudh@JNEC LATEX@ JNEC 29 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Tables
Inserting tables
... and numbering them
begin{table}
begin{tabular}{lccc}
{} &Judge 1
&Judge 2
&Judge 3
hline
Katrina &7 &9
&10 
Karishma &9 &10
&7 
Kareena &10 &7
&9 hline
end{tabular}
caption{Scores
given by the
judges for
different
participants
in a beauty
competition.
end{table}
Judge 1 Judge 2 Judge 3
Katrina 7 9 10
Karishma 9 10 7
Kareena 10 7 9
Table 1: Scores given by the judges for different
participants in a beauty competition.
Meanings:
lccc: Left,centered,centered,centered
hline: Horizontal line
: Line break
&: Tab character
shudh@JNEC LATEX@ JNEC 30 / 31
SU
D
D
H
ASH
EEL.CO
M
Motivation Parts Math Graphics Tables
In the upcoming sessions
Typesetting advanced mathematics
Typesetting aligned and multiline equations
Typesetting Matrices
Vector notations: Cross product, dot product, bold vectors
shudh@JNEC LATEX@ JNEC 31 / 31

More Related Content

What's hot

Interesting applications of graph theory
Interesting applications of graph theoryInteresting applications of graph theory
Interesting applications of graph theory
Tech_MX
 

What's hot (20)

Latex slides
Latex slidesLatex slides
Latex slides
 
LaTeX Introduction for Word Users
LaTeX Introduction for Word UsersLaTeX Introduction for Word Users
LaTeX Introduction for Word Users
 
Latex for beginner
Latex for beginnerLatex for beginner
Latex for beginner
 
The LaTeX Workshop: Typesetting Mathematics with LaTeX
The LaTeX Workshop: Typesetting Mathematics with LaTeXThe LaTeX Workshop: Typesetting Mathematics with LaTeX
The LaTeX Workshop: Typesetting Mathematics with LaTeX
 
LaTex Tutorial
LaTex TutorialLaTex Tutorial
LaTex Tutorial
 
Editing documents with LaTeX
Editing documents with LaTeXEditing documents with LaTeX
Editing documents with LaTeX
 
Learn Latex
Learn LatexLearn Latex
Learn Latex
 
Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to Matlab
 
Optimal binary search tree dynamic programming
Optimal binary search tree   dynamic programmingOptimal binary search tree   dynamic programming
Optimal binary search tree dynamic programming
 
DIFFERENTIAL EQUATIONS
DIFFERENTIAL EQUATIONSDIFFERENTIAL EQUATIONS
DIFFERENTIAL EQUATIONS
 
Interpolation
InterpolationInterpolation
Interpolation
 
documents writing with LATEX
documents writing with LATEXdocuments writing with LATEX
documents writing with LATEX
 
Introduction to LaTeX (For Word users)
 Introduction to LaTeX (For Word users) Introduction to LaTeX (For Word users)
Introduction to LaTeX (For Word users)
 
Kruskal's algorithm
Kruskal's algorithmKruskal's algorithm
Kruskal's algorithm
 
LaTeX Basics
LaTeX BasicsLaTeX Basics
LaTeX Basics
 
Partial differential equations
Partial differential equationsPartial differential equations
Partial differential equations
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
Latex Tutorial by Dr. M. C. Hanumantharaju
Latex Tutorial by Dr. M. C. HanumantharajuLatex Tutorial by Dr. M. C. Hanumantharaju
Latex Tutorial by Dr. M. C. Hanumantharaju
 
Introduction to graph theory (All chapter)
Introduction to graph theory (All chapter)Introduction to graph theory (All chapter)
Introduction to graph theory (All chapter)
 
Interesting applications of graph theory
Interesting applications of graph theoryInteresting applications of graph theory
Interesting applications of graph theory
 

Viewers also liked

Viewers also liked (8)

45324291 a-good-ph d-student
45324291 a-good-ph d-student45324291 a-good-ph d-student
45324291 a-good-ph d-student
 
Typesetting Theses / Reports with LaTeX : Workshop Day 3
Typesetting Theses / Reports with LaTeX : Workshop Day 3Typesetting Theses / Reports with LaTeX : Workshop Day 3
Typesetting Theses / Reports with LaTeX : Workshop Day 3
 
Making presentations with LaTeX: Workshop Day 4
Making presentations with LaTeX: Workshop Day 4Making presentations with LaTeX: Workshop Day 4
Making presentations with LaTeX: Workshop Day 4
 
Typesetting Mathematics with LaTeX - Day 2
Typesetting Mathematics with LaTeX - Day 2Typesetting Mathematics with LaTeX - Day 2
Typesetting Mathematics with LaTeX - Day 2
 
The LaTeX Workshop: Document design in LaTeX: Invocation
The LaTeX Workshop: Document design in LaTeX: InvocationThe LaTeX Workshop: Document design in LaTeX: Invocation
The LaTeX Workshop: Document design in LaTeX: Invocation
 
Point Collocation Method used in the solving of Differential Equations, parti...
Point Collocation Method used in the solving of Differential Equations, parti...Point Collocation Method used in the solving of Differential Equations, parti...
Point Collocation Method used in the solving of Differential Equations, parti...
 
How to Create a Slideshare Account
How to Create a Slideshare AccountHow to Create a Slideshare Account
How to Create a Slideshare Account
 
Design of FIR filters
Design of FIR filtersDesign of FIR filters
Design of FIR filters
 

Similar to Introduction to LaTeX - Workshop Day 1

Introduction to R
Introduction to RIntroduction to R
Introduction to R
Rajib Layek
 
INFORMATIVE ESSAYThe purpose of the Informative Essay assignme.docx
INFORMATIVE ESSAYThe purpose of the Informative Essay assignme.docxINFORMATIVE ESSAYThe purpose of the Informative Essay assignme.docx
INFORMATIVE ESSAYThe purpose of the Informative Essay assignme.docx
carliotwaycave
 
chap 6 - Example şift
chap 6 - Example şiftchap 6 - Example şift
chap 6 - Example şift
ermis26
 
Advanced data structures slide 1 2
Advanced data structures slide 1 2Advanced data structures slide 1 2
Advanced data structures slide 1 2
jomerson remorosa
 

Similar to Introduction to LaTeX - Workshop Day 1 (20)

Scala as a Declarative Language
Scala as a Declarative LanguageScala as a Declarative Language
Scala as a Declarative Language
 
La tex basics
La tex basicsLa tex basics
La tex basics
 
Latex hafida-benhidour-19-12-2016
Latex hafida-benhidour-19-12-2016Latex hafida-benhidour-19-12-2016
Latex hafida-benhidour-19-12-2016
 
Chap11 scr
Chap11 scrChap11 scr
Chap11 scr
 
R programming slides
R  programming slidesR  programming slides
R programming slides
 
Mathematical Modeling With Maple
Mathematical Modeling With MapleMathematical Modeling With Maple
Mathematical Modeling With Maple
 
RANDOM TESTS COMBINING MATHEMATICA PACKAGE AND LATEX COMPILER
RANDOM TESTS COMBINING MATHEMATICA PACKAGE AND LATEX COMPILERRANDOM TESTS COMBINING MATHEMATICA PACKAGE AND LATEX COMPILER
RANDOM TESTS COMBINING MATHEMATICA PACKAGE AND LATEX COMPILER
 
LaTeX_tutorial_Syed_Jan09.ppt
LaTeX_tutorial_Syed_Jan09.pptLaTeX_tutorial_Syed_Jan09.ppt
LaTeX_tutorial_Syed_Jan09.ppt
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
INFORMATIVE ESSAYThe purpose of the Informative Essay assignme.docx
INFORMATIVE ESSAYThe purpose of the Informative Essay assignme.docxINFORMATIVE ESSAYThe purpose of the Informative Essay assignme.docx
INFORMATIVE ESSAYThe purpose of the Informative Essay assignme.docx
 
chap 6 - Example şift
chap 6 - Example şiftchap 6 - Example şift
chap 6 - Example şift
 
Functional Programming in Pattern-Match-Oriented Programming Style <Programmi...
Functional Programming in Pattern-Match-Oriented Programming Style <Programmi...Functional Programming in Pattern-Match-Oriented Programming Style <Programmi...
Functional Programming in Pattern-Match-Oriented Programming Style <Programmi...
 
Anything but simple Mathematica
Anything but simple MathematicaAnything but simple Mathematica
Anything but simple Mathematica
 
Mathematica for Physicits
Mathematica for PhysicitsMathematica for Physicits
Mathematica for Physicits
 
Computer project
Computer projectComputer project
Computer project
 
Matlab1
Matlab1Matlab1
Matlab1
 
Advanced data structures slide 1 2
Advanced data structures slide 1 2Advanced data structures slide 1 2
Advanced data structures slide 1 2
 
theory of computation lecture 01
theory of computation lecture 01theory of computation lecture 01
theory of computation lecture 01
 
Linear algebra and vector analysis presentation
Linear algebra and vector analysis presentationLinear algebra and vector analysis presentation
Linear algebra and vector analysis presentation
 
A common fixed point theorem for two random operators using random mann itera...
A common fixed point theorem for two random operators using random mann itera...A common fixed point theorem for two random operators using random mann itera...
A common fixed point theorem for two random operators using random mann itera...
 

More from Suddhasheel GHOSH, PhD

Expert Lecture on GPS at UIET, CSJM, Kanpur
Expert Lecture on GPS at UIET, CSJM, KanpurExpert Lecture on GPS at UIET, CSJM, Kanpur
Expert Lecture on GPS at UIET, CSJM, Kanpur
Suddhasheel GHOSH, PhD
 

More from Suddhasheel GHOSH, PhD (7)

FEM Introduction: Solving ODE-BVP using the Galerkin's Method
FEM Introduction: Solving ODE-BVP using the Galerkin's MethodFEM Introduction: Solving ODE-BVP using the Galerkin's Method
FEM Introduction: Solving ODE-BVP using the Galerkin's Method
 
Solve ODE - BVP through the Least Squares Method
Solve ODE - BVP through the Least Squares MethodSolve ODE - BVP through the Least Squares Method
Solve ODE - BVP through the Least Squares Method
 
Map Calculaton using GRASS
Map Calculaton using GRASSMap Calculaton using GRASS
Map Calculaton using GRASS
 
Watershed Analysis with GRASS
Watershed Analysis with GRASSWatershed Analysis with GRASS
Watershed Analysis with GRASS
 
Research Prospects with Geoinformatics
Research Prospects with GeoinformaticsResearch Prospects with Geoinformatics
Research Prospects with Geoinformatics
 
Prepare your literature review
Prepare your literature reviewPrepare your literature review
Prepare your literature review
 
Expert Lecture on GPS at UIET, CSJM, Kanpur
Expert Lecture on GPS at UIET, CSJM, KanpurExpert Lecture on GPS at UIET, CSJM, Kanpur
Expert Lecture on GPS at UIET, CSJM, Kanpur
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Recently uploaded (20)

Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

Introduction to LaTeX - Workshop Day 1

  • 1. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Introduction to LATEX Suddhasheel Ghosh Department of Civil Engineering, Jawaharlal Nehru Engineering College Aurangabad, Maharashtra 431003 LATEX for Technical and Scientific Documents January 12 - 16, 2015 Day I shudh@JNEC LATEX@ JNEC 1 / 31
  • 2. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Outline 1 Why should we use LATEX Etymology 2 Parts of a LATEX document The Preamble The body Text styles 3 Mathematical typesetting 4 Graphics Tables shudh@JNEC LATEX@ JNEC 2 / 31
  • 3. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Etymology Outline 1 Why should we use LATEX Etymology 2 Parts of a LATEX document The Preamble The body Text styles 3 Mathematical typesetting 4 Graphics Tables shudh@JNEC LATEX@ JNEC 3 / 31
  • 4. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Etymology Why should we use LATEX Motivation Free Software (I do not have to worry about viruses and software piracy) Rendering mathematics is easier No worries about setting the font size and styles again and again Because I am tired of figures and tables jumping from here and there Because I want my sections and subsections autonumbered Because my fingers are tired with a click-find-click approach What all do I have to do? Remember the basic structure of a document Remember a few macros shudh@JNEC LATEX@ JNEC 4 / 31
  • 5. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Etymology Etymology of LATEX ... the origins Initially TEX was developed by Donald Knuth Leslie Lamport extended the software to LATEX TEX is pronounced ‘Tech’ and was initially written as τ χ LATEX stands for Lamport TEX and is pronounced as ‘Lay-Tech’ However, many pronounce it as ‘Lateks’ (as in rubber) What can we do with LATEX? We can create research papers, reports, thesis, presentations, posters and leaflets. shudh@JNEC LATEX@ JNEC 5 / 31
  • 6. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Etymology In this workshop: Day 1: Introduction to LATEX Day 2: Typesetting Mathematics Day 3: Writing your thesis / technical report Day 4: Make your presentations Day 5: Basics of science communication shudh@JNEC LATEX@ JNEC 6 / 31
  • 7. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Etymology Where do I get LATEX? ...and use it LaTeX Software For Windows: www.miktex.org Download a complete DVD as torrent from www.texlive.org For Linux: Download a complete DVD as torrent from www.texlive.org Part of the Ubuntu Linux distribution (sudo apt-get install texlive) shudh@JNEC LATEX@ JNEC 7 / 31
  • 8. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Etymology Writing files in LATEX ... and getting outputs The LATEX “code” is written in a .tex file LaTeX package compiles the file to produce PDF, DVI or PS files Windows editors (IDE) WinEdit TeXNicCenter LyX (What you see is what you get type) Linux editors (IDE) Texworks TeXStudio TeXMaker LyX shudh@JNEC LATEX@ JNEC 8 / 31
  • 9. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Preamble Body Style Outline 1 Why should we use LATEX Etymology 2 Parts of a LATEX document The Preamble The body Text styles 3 Mathematical typesetting 4 Graphics Tables shudh@JNEC LATEX@ JNEC 9 / 31
  • 10. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Preamble Body Style Parts of a LATEX document Preamble Style or class of a document Packages to be used Macro definitions Body Sections and subsections Tables and figures Body text shudh@JNEC LATEX@ JNEC 10 / 31
  • 11. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Preamble Body Style Parts of a LATEX document The preamble Makes announcements Style of the document Packages to be used Definitions of macros shudh@JNEC LATEX@ JNEC 11 / 31
  • 12. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Preamble Body Style Let us get our hands dirty! The Preamble We shall use the base class article documentclass{article} Want A4 paper size? Two-sided document? documentclass[a4paper,twoside]{article} What about setting the margins? usepackage[top=2cm,bottom=4cm,left=1.5cm, right=3cm,assymetric]{geometry} Therefore, overall settings for A4 size paper, and margins: documentclass[a4paper,twoside]{article} usepackage[top=2cm,bottom=4cm,left=1.5cm,right=3cm, asymmetric]{geometry} shudh@JNEC LATEX@ JNEC 12 / 31
  • 13. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Preamble Body Style Let us get our hands dirty ...and let’s start writing papers Announce the title, the author and date title{My first LaTeX paper} author{Suddhasheel Ghosh} %write here or the date appears automatically date{} And then declare the contents of the document: begin{document} %this puts the title on top maketitle end{document} Here LaTeX, title, author, date, begin, end are all macros. Macros are like functions. Anything between the braces “{}”, is the argument to the function / macro. shudh@JNEC LATEX@ JNEC 13 / 31
  • 14. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Preamble Body Style Let us get our hands dirty Bold, italics, slanted underline We can have {bf bold text}, {textit italicised text}, {sl slanted text} and underline{underlined text}. We can have bold text, italicised text, slanted text and underlined text. shudh@JNEC LATEX@ JNEC 14 / 31
  • 15. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Preamble Body Style Let us get our hands dirty Subscripts and superscripts In your preamble, add the following line usepackage{fixltx2e} and inside the body write: It is found that heighttextsubscript{apple tree} is different than heighttextsubscript{orange tree} and we obtain: It is found that heightapple tree is different than heightorange tree shudh@JNEC LATEX@ JNEC 15 / 31
  • 16. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Preamble Body Style Let us get our hands dirty Line spacing Line spacing can be set to single line, one and a half line, double line spacings, and any other customized spacings. In the preamble, use usepackage{setspace} ... and in the body write any one: singlespacing onehalfspacing doublspacing setstretch{1.1} shudh@JNEC LATEX@ JNEC 16 / 31
  • 17. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Preamble Body Style Let us get our hands dirty Coloured text In your preamble, add the following line usepackage{color} %this gives about 16 colour options Alternatively, one can write: usepackage[usenames,dvipsnames,svgnames,table]{xcolor} %Gives about 16+64+150 colours Therefore, we can have red coloured text, and a blue coloured text, and back to the black colour, by Therefore, we can have {color{red}red coloured text}, and a {color{blue}blue coloured text}, and back to the black colour. shudh@JNEC LATEX@ JNEC 17 / 31
  • 18. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Preamble Body Style Let us get our hands dirty Itemized and numbered lists begin{itemize} item Item 1 item Item 2 item Item 3 end{itemize} begin{enumerate} item Item 1 item Item 2 item Item 3 end{enumerate} Item 1 Item 2 Item 3 1 Item 1 2 Item 2 3 Item 3 Can you guess how we get multilevel lists? shudh@JNEC LATEX@ JNEC 18 / 31
  • 19. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Preamble Body Style Let us get our hands dirty Typesetting environments LaTeX has various environments, which start and end with the begin and end commands. abstract equation center raggedright For example begin{abstract} Tomatoes have long been considered as the cause of kidney stones. Researches have been trying to eliminate this trait of the tomatoes through genetic engineering. end{abstract} shudh@JNEC LATEX@ JNEC 19 / 31
  • 20. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Preamble Body Style Let us get our hands dirty Font sizes Sample Sample Sample Sample Sample Sample Sample Sample Sample Sample tiny Sample scriptsize Sample footnotesize Sample small Sample normalsize Sample large Sample Large Sample LARGE Sample huge Sample Huge Sample shudh@JNEC LATEX@ JNEC 20 / 31
  • 21. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Outline 1 Why should we use LATEX Etymology 2 Parts of a LATEX document The Preamble The body Text styles 3 Mathematical typesetting 4 Graphics Tables shudh@JNEC LATEX@ JNEC 21 / 31
  • 22. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Playing with mathematics text Mathematics environments There are two kinds of math used in LATEX. Inline math Display math About any point $x$ in a metric space $M$ we define the open ball of radius $r > 0$ about $x$ as the set $$ B(x;r) = {y in M : d(x,y) < r}. $$ About any point x in a metric space M we define the open ball of radius r > 0 about x as the set B(x;r) = {y ∈ M : d(x,y) < r}. shudh@JNEC LATEX@ JNEC 22 / 31
  • 23. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Typesetting equations Numbered equations Numbered equations can be typeset by using begin{equation} R(x,y) = frac{Ax^3+Bx^2+Cx+D}{Ey^3 + Fy + G} end{equation} R(x,y) = Ax3 +Bx2 +Cx+D Ey3 +Fy +G (1) shudh@JNEC LATEX@ JNEC 23 / 31
  • 24. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Tables Outline 1 Why should we use LATEX Etymology 2 Parts of a LATEX document The Preamble The body Text styles 3 Mathematical typesetting 4 Graphics Tables shudh@JNEC LATEX@ JNEC 24 / 31
  • 25. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Tables Inserting images To include a graphics file duck.jpg in a LATEX file, type in the preamble %in the preamble usepackage{graphicx} and in the body includegraphics{duck.jpg} And, here it is: shudh@JNEC LATEX@ JNEC 25 / 31
  • 26. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Tables Inserting images ..and numbering them A paper would require numbering the images. begin{figure} centering includegraphics{duck.jpg} caption{A picture of a duck used at muggle homes as a toy} end{figure} Figure 1: A picture of a duck used at muggle homes as a toy shudh@JNEC LATEX@ JNEC 26 / 31
  • 27. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Tables Inserting graphs in a LaTeX file A gnuplot and LATEX combo Start gnuplot, and write the following codes: set term tikz color solid size 4in,3in set output "sin.tex" set xr [-2*pi:2*pi] plot sin(x) with lines exit In your preamble, use the following usepackage{gnuplot-lua-tikz} and, in the body, wherever you wish to insert the figure, type input{sin} shudh@JNEC LATEX@ JNEC 27 / 31
  • 28. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Tables Inserting graphs in a LaTeX file A gnuplot and LATEX combo -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 -6 -4 -2 0 2 4 6 sin(x) shudh@JNEC LATEX@ JNEC 28 / 31
  • 29. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Tables Inserting tables Tables require the tabular environment. begin{tabular}{lccc} {} &Judge 1 &Judge 2 &Judge 3 hline Katrina &7 &9 &10 Karishma &9 &10 &7 Kareena &10 &7 &9 hline end{tabular} will give: Judge 1 Judge 2 Judge 3 Katrina 7 9 10 Karishma 9 10 7 Kareena 10 7 9 shudh@JNEC LATEX@ JNEC 29 / 31
  • 30. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Tables Inserting tables ... and numbering them begin{table} begin{tabular}{lccc} {} &Judge 1 &Judge 2 &Judge 3 hline Katrina &7 &9 &10 Karishma &9 &10 &7 Kareena &10 &7 &9 hline end{tabular} caption{Scores given by the judges for different participants in a beauty competition. end{table} Judge 1 Judge 2 Judge 3 Katrina 7 9 10 Karishma 9 10 7 Kareena 10 7 9 Table 1: Scores given by the judges for different participants in a beauty competition. Meanings: lccc: Left,centered,centered,centered hline: Horizontal line : Line break &: Tab character shudh@JNEC LATEX@ JNEC 30 / 31
  • 31. SU D D H ASH EEL.CO M Motivation Parts Math Graphics Tables In the upcoming sessions Typesetting advanced mathematics Typesetting aligned and multiline equations Typesetting Matrices Vector notations: Cross product, dot product, bold vectors shudh@JNEC LATEX@ JNEC 31 / 31