SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler offline
Document Preparation using LATEX 
Document Processor not a Word Processor 
A.B. Raju and Satish Annigeri 
B.V.B. College of Engineering & Technology 
Hubli 580 031 
20 Sep, 2014 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 1 / 23
LATEXversus MS Word 
Microsoft Word is good for 
short documents, such as cover 
pages, letters, or documents 
with about 100 pages. Basic 
features are easy to learn and 
GUI is useful for normal users. 
If you are writing a long 
document like a Technical 
paper, Project report, an article, 
or a review, you are better o 
with LATEX. Initial learning curve 
is steep, but persist with it and 
you will be rewarded. 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 2 / 23
Document Preparation 
Document Preparation is concerned with creating documents for print or 
electronic distribution. 
Typical document structure for long documents 
Front matter 
Main matter 
Back matter 
Mathematical equation typesetting 
Lists 
Tables 
Reference citation 
Cross referencing within the document 
LATEX lets the author take care of logical structure while it takes 
care of visual structure 
Word processors require the author to take care of both logical and 
visual structure 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 3 / 23
LATEX History 
Donald Knuth 
Professor Emeritus, Stanford 
University 
Author of the multi-volume The 
Art of Computer Programming 
Creator of TEX computer 
typesetting system and 
METAFONT font de
nition 
language 
TEX was developed in late 1970s 
by Donald Knuth Donald Knuth 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 4 / 23
LATEX History contd 
Leslie Lamport 
Initially developed the LATEX 
system as a document 
preparation system 
Developed when Leslie Lamport 
was working at SRI International 
Currently works at Microsoft 
Research 
LATEX was
rst released in the 
year 1985 
Current version is LATEX2 
Leslie Lamport 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 5 / 23
Installing LATEX 
Microsoft Windows 
MiKTeX is a popular LATEX distribution for Microsoft Windows 
Has a package manager to install additional packages or remove 
installed packages 
Has an update manager to update installed packages 
Can be downloaded from http://miktex.org 
GNU/Linux 
TeXLive is a LATEX distribution for GNU/Linux 
Installation and package management is done through the system 
package manager - one of apt-get, yum, zypper depending on your 
GNU/Linux distribution 
LATEX editors 
TeXstudio - Windows and GNU/Linux 
http://texstudio.sourceforge.net/ 
TeXMaker - Windows and GNU/Linux 
http://www.xm1math.net/texmaker/ 
TeXnicCenter - Windows http://www.texniccenter.org/ 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 6 / 23
LATEX Document Preparation Work
ow 
1 Write the LATEX source document in a text editor 
2 Compile the LATEX source document to your preferred output format 
3 View the document 
4 Repeat this loop to modify the document 
Popular output formats 
DVI { DVI viewer (xdvi on GNU/Linux, YAP in MiKTeX) 
PDF { Acrobat reader or other PDF viewers (xpdf or evince on 
GNU/Linux, Sumatra on Windows) 
Postscript (PS) { Ghostview viewer (Ghostscript) 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 7 / 23
Minimal LATEX document 
documentclass{article} 
begin{document} 
Hello, World 
end{document} 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 8 / 23
Structure of a Document 
A document can be structured into the following 
Part part Book 
Chapter chapter Book, Report 
Section section Book, Report, Article 
Sub Section section Book, Report, Article 
Sub Sub Section section Book, Report, Article 
Paragraph subsection Book, Report, Article 
Sub Paragraph subsubsection Book, Report, Article 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 9 / 23
Choosing the Right Document Class 
Book 
Title page on a separate page by itself 
Can contain parts, chapters, sections, subsections, subsubsections and 
paragraphs 
New chapters begin on a new page, on the right side by default 
Document is two sided by default, can be changed to one sided 
Can optionally have appendices. 
Report 
Title page on a separate page by itself 
Can contain chapters, sections, subsections, subsubsections, paragraphs 
New chapters begin on a new page 
Document is one sided by default. Two sided is optional 
Article 
No separate page for title page 
Can contain sections, subsections, subsubsections, paragraphs 
Document is one sided by default. Two sided is optional 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 10 / 23
Adding Sections 
documentclass{article} 
begin{document} 
section{Word} label{sec:word} 
I prefer using LaTeX{} to using Microsoft Word or 
other word processors. 
section{Latex}label{sec:tex} 
I love LaTeX. As I mentioned in Section~ref{sec:word}, 
I do not like word processors. 
end{document} 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 11 / 23
Some Tips for Beginners 
Words are separated by spaces. Number of spaces doesn't matter, 
one is as good as 100. 
Paragraphs are separated by empty lines. Number of empty lines 
doesn't matter, one is as good as 100. 
LATEX is a markup language. To make something to be printed in 
bold in the document, you mark it in the source with 
textbf{this will be in bold}. 
Following characters are reserved for use by LATEX { 
# $ %  ~ _ ^  { }. To print these characters in your document, 
you will have to escape tem. For example  to print . 
The characters that can appear in your text are: 
Alphabets: a-z, A-Z 
Digits: 0-9 
Punctuation: . : ; , ? ! ` ' ( ) [ ] - / * @ 
Mathematical symbols: + =   
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 12 / 23
Some More Tips 
A soft return is introduced with two backslashes:  
A non-breaking space is: ~ as in Chapter~1 
LATEX automatically hyphenates words where necessary 
Beginners must look out for some common errors: 
A misspelled command or environment name 
Improperly matching braces 
Trying to use one of the ten special characters # $ %  _ { } ~ ^ , 
as an ordinary printing symbol without escaping them 
Improperly matching formula delimiters { for example, ( without a 
matching ) 
The use in ordinary text of a command like ^ that can appear only in a 
mathematical formula 
A missing end command 
A missing command argument 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 13 / 23
All the Fuss about Spaces 
Space after a sentence is longer than a normal space. Can you see it 
just before this sentence begins? 
Sometimes the period does not represent end of a sentence, such as, 
Prof. Donald Knuth. The period after Prof. does not end a sentence. 
You can tell this to LATEX.  prints a normal space. Compare the 
following in the printed document: 
Prof. Donald Knuth { Prof. Donal Knuth 
Prof. Donald Knuth { Prof. Donald Knuth 
Non-breaking space is introduced with ~ 
Prof. Donald Knuth { Prof. Donal Knuth 
Prof. Donald Knuth { Prof. Donald Knuth 
Prof. Donald Knuth { Prof.~Donald Knuth 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 14 / 23
Equation Example 
documentclass{article} 
begin{document} 
begin{equation} label{eq:sum} 
s = sum_{i=1}^{n}x_{i} 
end{equation} 
end{document} 
Mathematical equations can be displayed in displaymath or 
equation environment, with or without numbers. 
Displaymath mode without numbering: [ x' + y^2 = z_i ] or 
use the begin{equation*} x' + y^2 = z_i end{equation*} 
environment 
Inline math mode: Mathematical expressions within running 
sentences: radius of a circle is $r^2 = x^2 + y^2$ or 
radius of a circle is ( r^2 = x^2 + y^2 ), which will 
print as: radius of a circle is r 2 = x2 + y2 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 15 / 23
documentclass{article} 
begin{document} 
begin{equation} label{eq:mean} 
bar{x} = frac{sum_{i=1}^{n}x_{i}} {n} 
end{equation} 
The equation for mean is given in Equation ref{eq:mean}. 
end{document} 
x = 
Pn 
i=1 xi 
n 
(1) 
The equation for mean is given in Equation 1. 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 16 / 23
Document Class Examples 
documentclass{book} 
documentclass{report} 
documentclass{article} 
documentclass[a4paper]{article} 
documentclass[a4paper,11pt,twocolumn]{report} 
documentclass[12pt,letterpaper,oneside]{book} 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 17 / 23
documentclass{report} 
title{Learn LaTeX} 
author{A.B. Raju} 
begin{document} 
maketitle 
tableofcontents 
end{document} 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 18 / 23
documentclass{report} 
title{Learn LaTeX} 
author{A.B. Raju} 
begin{document} 
maketitle 
tableofcontents 
include{chapter_1} 
include{chapter_2} 
include{chapter_3} 
end{document} 
In the above example, each chapter is typed in a separate
le, and 
included into the main document in the right sequence. 
Filenames usually have the .tex extension, but it is not included in 
the include{filename} command 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 19 / 23
Including Graphics 
Convert images into .jpg/.eps or .pdf format 
Include package graphicx 
Use the includegraphics{filename} command 
Filename is case sensitive on some GNU/Linux and Mac OS X 
To specify options, use the 
includegraphics[options]{filename} command 
Options may include [width=2.5cm], [height=5cm] etc 
LATEX understand several standard length units such as: 
in for inch, cm for centimeter, pt for point. 1 inch is 72 points 
A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 20 / 23

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

LaTex Tutorial
LaTex TutorialLaTex Tutorial
LaTex Tutorial
 
Introduction to LaTeX - Workshop Day 1
Introduction to LaTeX - Workshop Day 1Introduction to LaTeX - Workshop Day 1
Introduction to LaTeX - Workshop Day 1
 
Introduction to Latex
Introduction to LatexIntroduction to Latex
Introduction to Latex
 
Latex workshop: Essentials and Practices
Latex workshop: Essentials and PracticesLatex workshop: Essentials and Practices
Latex workshop: Essentials and Practices
 
Latex
LatexLatex
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)
 
Research 101 - Paper Writing with LaTeX
Research 101 - Paper Writing with LaTeXResearch 101 - Paper Writing with LaTeX
Research 101 - Paper Writing with LaTeX
 
Latex workshop
Latex workshopLatex workshop
Latex workshop
 
Latex Introduction for Beginners
Latex Introduction for BeginnersLatex Introduction for Beginners
Latex Introduction for Beginners
 
Basic Latex Typesetting - Session 1
Basic Latex Typesetting - Session 1Basic Latex Typesetting - Session 1
Basic Latex Typesetting - Session 1
 
documents writing with LATEX
documents writing with LATEXdocuments writing with LATEX
documents writing with LATEX
 
Editing documents with LaTeX
Editing documents with LaTeXEditing documents with LaTeX
Editing documents with LaTeX
 
LATEX and BEAMER for Beginners
LATEX and BEAMER for Beginners LATEX and BEAMER for Beginners
LATEX and BEAMER for Beginners
 
Academic writing in LaTeX
Academic writing in LaTeX Academic writing in LaTeX
Academic writing in LaTeX
 
Advanced latex
Advanced latexAdvanced latex
Advanced latex
 
Ms office ppt
Ms office pptMs office ppt
Ms office ppt
 
Latex for beginners
Latex for beginnersLatex for beginners
Latex for beginners
 
Introduction to microsoft access
Introduction to microsoft accessIntroduction to microsoft access
Introduction to microsoft access
 
MS Word for Beginners
MS Word for BeginnersMS Word for Beginners
MS Word for Beginners
 
Ms access
Ms accessMs access
Ms access
 

Semelhante a Introduction to LaTeX

latex-workshop Dr: Mohamed A. Alrshah
latex-workshop Dr: Mohamed A. Alrshahlatex-workshop Dr: Mohamed A. Alrshah
latex-workshop Dr: Mohamed A. AlrshahAbdulazim N.Elaati
 
MODULAR AND DIDACTIC COMPILER DESIGN WITH XML INTER-PHASES COMMUNICATION
MODULAR AND DIDACTIC COMPILER DESIGN WITH XML INTER-PHASES COMMUNICATIONMODULAR AND DIDACTIC COMPILER DESIGN WITH XML INTER-PHASES COMMUNICATION
MODULAR AND DIDACTIC COMPILER DESIGN WITH XML INTER-PHASES COMMUNICATIONijcseit
 
Write effectlively in late x
Write effectlively in late xWrite effectlively in late x
Write effectlively in late xC-CORE
 
Beautiful Bash: Let's make reading and writing bash scripts fun again!
Beautiful Bash: Let's make reading and writing bash scripts fun again!Beautiful Bash: Let's make reading and writing bash scripts fun again!
Beautiful Bash: Let's make reading and writing bash scripts fun again!Aaron Zauner
 
Language-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible researchLanguage-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible researchAndrew Lowe
 
Hello, I need help with the following assignmentThis assignment w.pdf
Hello, I need help with the following assignmentThis assignment w.pdfHello, I need help with the following assignmentThis assignment w.pdf
Hello, I need help with the following assignmentThis assignment w.pdfnamarta88
 
latex_intro.ppt
latex_intro.pptlatex_intro.ppt
latex_intro.pptTapasPal34
 
Introduction to Overleaf Workshop
Introduction to Overleaf WorkshopIntroduction to Overleaf Workshop
Introduction to Overleaf WorkshopOlga Scrivner
 

Semelhante a Introduction to LaTeX (20)

Learn Latex
Learn LatexLearn Latex
Learn Latex
 
LATEX.ppt
LATEX.pptLATEX.ppt
LATEX.ppt
 
LaTex workshop
LaTex workshopLaTex workshop
LaTex workshop
 
Latex Notes
Latex NotesLatex Notes
Latex Notes
 
latex-workshop Dr: Mohamed A. Alrshah
latex-workshop Dr: Mohamed A. Alrshahlatex-workshop Dr: Mohamed A. Alrshah
latex-workshop Dr: Mohamed A. Alrshah
 
MODULAR AND DIDACTIC COMPILER DESIGN WITH XML INTER-PHASES COMMUNICATION
MODULAR AND DIDACTIC COMPILER DESIGN WITH XML INTER-PHASES COMMUNICATIONMODULAR AND DIDACTIC COMPILER DESIGN WITH XML INTER-PHASES COMMUNICATION
MODULAR AND DIDACTIC COMPILER DESIGN WITH XML INTER-PHASES COMMUNICATION
 
Write effectlively in late x
Write effectlively in late xWrite effectlively in late x
Write effectlively in late x
 
Introduction to LaTeX
Introduction to LaTeXIntroduction to LaTeX
Introduction to LaTeX
 
Latex Tuitorial
Latex TuitorialLatex Tuitorial
Latex Tuitorial
 
Beautiful Bash: Let's make reading and writing bash scripts fun again!
Beautiful Bash: Let's make reading and writing bash scripts fun again!Beautiful Bash: Let's make reading and writing bash scripts fun again!
Beautiful Bash: Let's make reading and writing bash scripts fun again!
 
latex cource.pptx
latex cource.pptxlatex cource.pptx
latex cource.pptx
 
Chap15 scr
Chap15 scrChap15 scr
Chap15 scr
 
Documentation
DocumentationDocumentation
Documentation
 
Language-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible researchLanguage-agnostic data analysis workflows and reproducible research
Language-agnostic data analysis workflows and reproducible research
 
Hello, I need help with the following assignmentThis assignment w.pdf
Hello, I need help with the following assignmentThis assignment w.pdfHello, I need help with the following assignmentThis assignment w.pdf
Hello, I need help with the following assignmentThis assignment w.pdf
 
latex_intro.ppt
latex_intro.pptlatex_intro.ppt
latex_intro.ppt
 
latex_intro.ppt
latex_intro.pptlatex_intro.ppt
latex_intro.ppt
 
latex_intro.ppt
latex_intro.pptlatex_intro.ppt
latex_intro.ppt
 
latex_intro.ppt
latex_intro.pptlatex_intro.ppt
latex_intro.ppt
 
Introduction to Overleaf Workshop
Introduction to Overleaf WorkshopIntroduction to Overleaf Workshop
Introduction to Overleaf Workshop
 

Último

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 

Último (20)

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 

Introduction to LaTeX

  • 1. Document Preparation using LATEX Document Processor not a Word Processor A.B. Raju and Satish Annigeri B.V.B. College of Engineering & Technology Hubli 580 031 20 Sep, 2014 A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 1 / 23
  • 2. LATEXversus MS Word Microsoft Word is good for short documents, such as cover pages, letters, or documents with about 100 pages. Basic features are easy to learn and GUI is useful for normal users. If you are writing a long document like a Technical paper, Project report, an article, or a review, you are better o with LATEX. Initial learning curve is steep, but persist with it and you will be rewarded. A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 2 / 23
  • 3. Document Preparation Document Preparation is concerned with creating documents for print or electronic distribution. Typical document structure for long documents Front matter Main matter Back matter Mathematical equation typesetting Lists Tables Reference citation Cross referencing within the document LATEX lets the author take care of logical structure while it takes care of visual structure Word processors require the author to take care of both logical and visual structure A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 3 / 23
  • 4. LATEX History Donald Knuth Professor Emeritus, Stanford University Author of the multi-volume The Art of Computer Programming Creator of TEX computer typesetting system and METAFONT font de
  • 5. nition language TEX was developed in late 1970s by Donald Knuth Donald Knuth A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 4 / 23
  • 6. LATEX History contd Leslie Lamport Initially developed the LATEX system as a document preparation system Developed when Leslie Lamport was working at SRI International Currently works at Microsoft Research LATEX was
  • 7. rst released in the year 1985 Current version is LATEX2 Leslie Lamport A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 5 / 23
  • 8. Installing LATEX Microsoft Windows MiKTeX is a popular LATEX distribution for Microsoft Windows Has a package manager to install additional packages or remove installed packages Has an update manager to update installed packages Can be downloaded from http://miktex.org GNU/Linux TeXLive is a LATEX distribution for GNU/Linux Installation and package management is done through the system package manager - one of apt-get, yum, zypper depending on your GNU/Linux distribution LATEX editors TeXstudio - Windows and GNU/Linux http://texstudio.sourceforge.net/ TeXMaker - Windows and GNU/Linux http://www.xm1math.net/texmaker/ TeXnicCenter - Windows http://www.texniccenter.org/ A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 6 / 23
  • 9. LATEX Document Preparation Work ow 1 Write the LATEX source document in a text editor 2 Compile the LATEX source document to your preferred output format 3 View the document 4 Repeat this loop to modify the document Popular output formats DVI { DVI viewer (xdvi on GNU/Linux, YAP in MiKTeX) PDF { Acrobat reader or other PDF viewers (xpdf or evince on GNU/Linux, Sumatra on Windows) Postscript (PS) { Ghostview viewer (Ghostscript) A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 7 / 23
  • 10. Minimal LATEX document documentclass{article} begin{document} Hello, World end{document} A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 8 / 23
  • 11. Structure of a Document A document can be structured into the following Part part Book Chapter chapter Book, Report Section section Book, Report, Article Sub Section section Book, Report, Article Sub Sub Section section Book, Report, Article Paragraph subsection Book, Report, Article Sub Paragraph subsubsection Book, Report, Article A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 9 / 23
  • 12. Choosing the Right Document Class Book Title page on a separate page by itself Can contain parts, chapters, sections, subsections, subsubsections and paragraphs New chapters begin on a new page, on the right side by default Document is two sided by default, can be changed to one sided Can optionally have appendices. Report Title page on a separate page by itself Can contain chapters, sections, subsections, subsubsections, paragraphs New chapters begin on a new page Document is one sided by default. Two sided is optional Article No separate page for title page Can contain sections, subsections, subsubsections, paragraphs Document is one sided by default. Two sided is optional A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 10 / 23
  • 13. Adding Sections documentclass{article} begin{document} section{Word} label{sec:word} I prefer using LaTeX{} to using Microsoft Word or other word processors. section{Latex}label{sec:tex} I love LaTeX. As I mentioned in Section~ref{sec:word}, I do not like word processors. end{document} A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 11 / 23
  • 14. Some Tips for Beginners Words are separated by spaces. Number of spaces doesn't matter, one is as good as 100. Paragraphs are separated by empty lines. Number of empty lines doesn't matter, one is as good as 100. LATEX is a markup language. To make something to be printed in bold in the document, you mark it in the source with textbf{this will be in bold}. Following characters are reserved for use by LATEX { # $ % ~ _ ^ { }. To print these characters in your document, you will have to escape tem. For example to print . The characters that can appear in your text are: Alphabets: a-z, A-Z Digits: 0-9 Punctuation: . : ; , ? ! ` ' ( ) [ ] - / * @ Mathematical symbols: + = A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 12 / 23
  • 15. Some More Tips A soft return is introduced with two backslashes: A non-breaking space is: ~ as in Chapter~1 LATEX automatically hyphenates words where necessary Beginners must look out for some common errors: A misspelled command or environment name Improperly matching braces Trying to use one of the ten special characters # $ % _ { } ~ ^ , as an ordinary printing symbol without escaping them Improperly matching formula delimiters { for example, ( without a matching ) The use in ordinary text of a command like ^ that can appear only in a mathematical formula A missing end command A missing command argument A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 13 / 23
  • 16. All the Fuss about Spaces Space after a sentence is longer than a normal space. Can you see it just before this sentence begins? Sometimes the period does not represent end of a sentence, such as, Prof. Donald Knuth. The period after Prof. does not end a sentence. You can tell this to LATEX. prints a normal space. Compare the following in the printed document: Prof. Donald Knuth { Prof. Donal Knuth Prof. Donald Knuth { Prof. Donald Knuth Non-breaking space is introduced with ~ Prof. Donald Knuth { Prof. Donal Knuth Prof. Donald Knuth { Prof. Donald Knuth Prof. Donald Knuth { Prof.~Donald Knuth A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 14 / 23
  • 17. Equation Example documentclass{article} begin{document} begin{equation} label{eq:sum} s = sum_{i=1}^{n}x_{i} end{equation} end{document} Mathematical equations can be displayed in displaymath or equation environment, with or without numbers. Displaymath mode without numbering: [ x' + y^2 = z_i ] or use the begin{equation*} x' + y^2 = z_i end{equation*} environment Inline math mode: Mathematical expressions within running sentences: radius of a circle is $r^2 = x^2 + y^2$ or radius of a circle is ( r^2 = x^2 + y^2 ), which will print as: radius of a circle is r 2 = x2 + y2 A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 15 / 23
  • 18. documentclass{article} begin{document} begin{equation} label{eq:mean} bar{x} = frac{sum_{i=1}^{n}x_{i}} {n} end{equation} The equation for mean is given in Equation ref{eq:mean}. end{document} x = Pn i=1 xi n (1) The equation for mean is given in Equation 1. A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 16 / 23
  • 19. Document Class Examples documentclass{book} documentclass{report} documentclass{article} documentclass[a4paper]{article} documentclass[a4paper,11pt,twocolumn]{report} documentclass[12pt,letterpaper,oneside]{book} A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 17 / 23
  • 20. documentclass{report} title{Learn LaTeX} author{A.B. Raju} begin{document} maketitle tableofcontents end{document} A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 18 / 23
  • 21. documentclass{report} title{Learn LaTeX} author{A.B. Raju} begin{document} maketitle tableofcontents include{chapter_1} include{chapter_2} include{chapter_3} end{document} In the above example, each chapter is typed in a separate
  • 22. le, and included into the main document in the right sequence. Filenames usually have the .tex extension, but it is not included in the include{filename} command A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 19 / 23
  • 23. Including Graphics Convert images into .jpg/.eps or .pdf format Include package graphicx Use the includegraphics{filename} command Filename is case sensitive on some GNU/Linux and Mac OS X To specify options, use the includegraphics[options]{filename} command Options may include [width=2.5cm], [height=5cm] etc LATEX understand several standard length units such as: in for inch, cm for centimeter, pt for point. 1 inch is 72 points A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 20 / 23
  • 24. An example documentclass{article} usepackage{graphicx} begin{document} begin{figure} includegraphics{MyBat} caption{This is My Bat} label{fig:bat} end{figure} In Figure ref{fig:bat} end{document} A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 21 / 23
  • 25. TikZ Pictures begin{tikzpicture} draw[step=0.5,blue!20,very thin] (-1.5,-1.5) grid (1.5,1.5); draw[thick] (-1.5,0) -- (1.5,0); draw[thick] (0,-1.5) -- (0,1.5); draw[very thick] (-1,0) .. controls(-1,0.555) and (-0.555,1) .. (0,1) .. controls(0.555,1) and (1,0.555) .. (1,0); end{tikzpicture} A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 22 / 23
  • 26. Thank You A.B. Raju (BVBCET, Hubli) Document Preparation using LATEX 20 Sep, 2014 23 / 23