79
L A T E X Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian Institute of Technology LAT E X Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 1

New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

LATEX Workshop

Bijulal D & Anu Thomas

Industrial Engineering and Operations Research

Indian Institute of Technology

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 1

Page 2: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Outline of the Workshop

Introduction to LATEX

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 2

Page 3: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Outline of the Workshop

Introduction to LATEX

Document structure

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 2

Page 4: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Outline of the Workshop

Introduction to LATEX

Document structure

Document classes and packages

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 2

Page 5: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Outline of the Workshop

Introduction to LATEX

Document structure

Document classes and packages

Environments

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 2

Page 6: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Outline of the Workshop

Introduction to LATEX

Document structure

Document classes and packages

Environments

Exercises

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 2

Page 7: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Introduction to L ATEX

LATEX is a text processing system.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 3

Page 8: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Introduction to L ATEX

LATEX is a text processing system.

Base engine is ‘TEX’ (Donald Knuth, 1978) developed for typesetting, to includeformulae.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 3

Page 9: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Introduction to L ATEX

LATEX is a text processing system.

Base engine is ‘TEX’ (Donald Knuth, 1978) developed for typesetting, to includeformulae.

LATEX focuses on document structure than details (Leslie Lamport 1985).

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 3

Page 10: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Introduction to L ATEX

LATEX is a text processing system.

Base engine is ‘TEX’ (Donald Knuth, 1978) developed for typesetting, to includeformulae.

LATEX focuses on document structure than details (Leslie Lamport 1985).

Has collection of defined commands to create names and numbers for title,section, etc.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 3

Page 11: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Introduction to L ATEX

LATEX is a text processing system.

Base engine is ‘TEX’ (Donald Knuth, 1978) developed for typesetting, to includeformulae.

LATEX focuses on document structure than details (Leslie Lamport 1985).

Has collection of defined commands to create names and numbers for title,section, etc.

AMS-TEX was a collection of extensions to TEX with more advanced mathematicaltypesetting features.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 3

Page 12: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Introduction to L ATEX

LATEX is a text processing system.

Base engine is ‘TEX’ (Donald Knuth, 1978) developed for typesetting, to includeformulae.

LATEX focuses on document structure than details (Leslie Lamport 1985).

Has collection of defined commands to create names and numbers for title,section, etc.

AMS-TEX was a collection of extensions to TEX with more advanced mathematicaltypesetting features.

LATEX 2ε is the latest version of LATEX in use.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 3

Page 13: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Document Structure

LATEX document is a plain text file with required commands and environments.

The extension of the file is .tex

All commands start with a ‘\’. Eg., \caption, \label, etc.

A LATEX document starts with a declaration of the document type by\documentclass{}

The matter to type set are typed between \begin{document} the content\end{document}

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 4

Page 14: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Document Structure (Cont..)

LATEX documents are classified into article, report, book, etc.

A typical document can be;

\documentclass{article}

\begin{document}

content...

\end{document}

Practice: Create a sample document

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 5

Page 15: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Document Compilation

We have: → file.tex

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 6

Page 16: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Document Compilation

We have: → file.tex

Do: → latex file.tex to get: → file.dvi

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 6

Page 17: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Document Compilation

We have: → file.tex

Do: → latex file.tex to get: → file.dvi

Extension dvi stands for device independent.A .dvi file can be viewed by yap, texworks, evince, xdvi, okular, etc.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 6

Page 18: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Document Compilation

We have: → file.tex

Do: → latex file.tex to get: → file.dvi

Extension dvi stands for device independent.A .dvi file can be viewed by yap, texworks, evince, xdvi, okular, etc.

To get .ps or .pdf files;Do: → dvips file.dvi to get; .ps file

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 6

Page 19: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Document Compilation

We have: → file.tex

Do: → latex file.tex to get: → file.dvi

Extension dvi stands for device independent.A .dvi file can be viewed by yap, texworks, evince, xdvi, okular, etc.

To get .ps or .pdf files;Do: → dvips file.dvi to get; .ps file

Do: → ps2pdf file.ps to get; .pdf file

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 6

Page 20: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Document Compilation

We have: → file.tex

Do: → latex file.tex to get: → file.dvi

Extension dvi stands for device independent.A .dvi file can be viewed by yap, texworks, evince, xdvi, okular, etc.

To get .ps or .pdf files;Do: → dvips file.dvi to get; .ps file

Do: → ps2pdf file.ps to get; .pdf file

Do: → dvipdf file.dvi to get; .pdf file

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 6

Page 21: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Document Compilation

We have: → file.tex

Do: → latex file.tex to get: → file.dvi

Extension dvi stands for device independent.A .dvi file can be viewed by yap, texworks, evince, xdvi, okular, etc.

To get .ps or .pdf files;Do: → dvips file.dvi to get; .ps file

Do: → ps2pdf file.ps to get; .pdf file

Do: → dvipdf file.dvi to get; .pdf file

An easy way to produce .pdf files:Do: → pdflatex file.dvi and get; .pdf file

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 6

Page 22: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Document Compilation

We have: → file.tex

Do: → latex file.tex to get: → file.dvi

Extension dvi stands for device independent.A .dvi file can be viewed by yap, texworks, evince, xdvi, okular, etc.

To get .ps or .pdf files;Do: → dvips file.dvi to get; .ps file

Do: → ps2pdf file.ps to get; .pdf file

Do: → dvipdf file.dvi to get; .pdf file

An easy way to produce .pdf files:Do: → pdflatex file.dvi and get; .pdf file

Practice: Compile the sample document

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 6

Page 23: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Documentclass and Arguments

Different document classes are:

article: To typeset articles for journals, conferences, etc.

report: To typeset reports of any form

book: To typeset a book

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 7

Page 24: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Documentclass and Arguments

Different document classes are:

article: To typeset articles for journals, conferences, etc.

report: To typeset reports of any form

book: To typeset a book

Optional arguments are provided in square brackets before the class type

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 7

Page 25: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Documentclass and Arguments

Different document classes are:

article: To typeset articles for journals, conferences, etc.

report: To typeset reports of any form

book: To typeset a book

Optional arguments are provided in square brackets before the class type

Eg: \documentclass[]{article}

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 7

Page 26: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Documentclass and Arguments

Different document classes are:

article: To typeset articles for journals, conferences, etc.

report: To typeset reports of any form

book: To typeset a book

Optional arguments are provided in square brackets before the class type

Eg: \documentclass[]{article}

Arguments are font size, paper size, document mode, number of columns, etc.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 7

Page 27: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Documentclass and Arguments

Different document classes are:

article: To typeset articles for journals, conferences, etc.

report: To typeset reports of any form

book: To typeset a book

Optional arguments are provided in square brackets before the class type

Eg: \documentclass[]{article}

Arguments are font size, paper size, document mode, number of columns, etc.

\documentclass[12pt,a4paper,twocolumn]{article}

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 7

Page 28: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Documentclass and Arguments

Different document classes are:

article: To typeset articles for journals, conferences, etc.

report: To typeset reports of any form

book: To typeset a book

Optional arguments are provided in square brackets before the class type

Eg: \documentclass[]{article}

Arguments are font size, paper size, document mode, number of columns, etc.

\documentclass[12pt,a4paper,twocolumn]{article}

Practice: Use the arguments in your sample document and see the changes

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 7

Page 29: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Packages

Packages are included to support different functionalities:To get mathematical symbols, functions, etc., to include a figure in the document,to change a default font, and so on....

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 8

Page 30: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Packages

Packages are included to support different functionalities:To get mathematical symbols, functions, etc., to include a figure in the document,to change a default font, and so on....

Packages are included in the ‘preamble’ of the document, the area between the\documentclass and \begin{document}

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 8

Page 31: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Packages

Packages are included to support different functionalities:To get mathematical symbols, functions, etc., to include a figure in the document,to change a default font, and so on....

Packages are included in the ‘preamble’ of the document, the area between the\documentclass and \begin{document}

Eg:\documentclass[12pt,a4paper]{article}

\usepackage{amsmath,amssymb,amsfonts}

\usepackage{times,natbib,graphicx}

\begin{document}

matter\end{document}

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 8

Page 32: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Packages

Packages are included to support different functionalities:To get mathematical symbols, functions, etc., to include a figure in the document,to change a default font, and so on....

Packages are included in the ‘preamble’ of the document, the area between the\documentclass and \begin{document}

times change the font to Times Roman.natbib allows author year type of citations similar to ‘Disney et al. (2003)’, etc.,graphicx supports figure inclusion, and many more packages to explore....

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 8

Page 33: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Packages

Packages are included to support different functionalities:To get mathematical symbols, functions, etc., to include a figure in the document,to change a default font, and so on....

Packages are included in the ‘preamble’ of the document, the area between the\documentclass and \begin{document}

times change the font to Times Roman.natbib allows author year type of citations similar to ‘Disney et al. (2003)’, etc.,graphicx supports figure inclusion, and many more packages to explore....

Practice: Use the times package in your sample document and see the changes

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 8

Page 34: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Before the Body of Document

A document will have:

Title of the document,

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 9

Page 35: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Before the Body of Document

A document will have:

Title of the document,

Name(s) of the author(s), and

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 9

Page 36: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Before the Body of Document

A document will have:

Title of the document,

Name(s) of the author(s), and

Affiliation, date of creation etc., (optional)

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 9

Page 37: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Before the Body of Document

A document will have:

Title of the document,

Name(s) of the author(s), and

Affiliation, date of creation etc., (optional)

\title{Your Title} will assign a title for the document.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 9

Page 38: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Before the Body of Document

A document will have:

Title of the document,

Name(s) of the author(s), and

Affiliation, date of creation etc., (optional)

\author{Your Name(s)} will assign the name(s) of author(s) to the document.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 9

Page 39: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Before the Body of Document

A document will have:

Title of the document,

Name(s) of the author(s), and

Affiliation, date of creation etc., (optional)

\date{any date} will assign a date to the document. If kept blank, no date willbe assigned.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 9

Page 40: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Before the Body of Document

A document will have:

Title of the document,

Name(s) of the author(s), and

Affiliation, date of creation etc., (optional)

Use all of them before \begin{document} in your document

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 9

Page 41: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Before the Body of Document

A document will have:

Title of the document,

Name(s) of the author(s), and

Affiliation, date of creation etc., (optional)

Use all of them before \begin{document} in your document

Use \maketitle immediately after \begin{document}

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 9

Page 42: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Before the Body of Document

A document will have:

Title of the document,

Name(s) of the author(s), and

Affiliation, date of creation etc., (optional)

Use all of them before \begin{document} in your document

Use \maketitle immediately after \begin{document}

Practice: Compile document and check what happens.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 9

Page 43: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Table of contents and Abstract

Include an abstract immediately after \maketitle

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 10

Page 44: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Table of contents and Abstract

Include an abstract immediately after \maketitle

Write the abstract between \begin{abstract} and \end{abstract}

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 10

Page 45: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Table of contents and Abstract

Include an abstract immediately after \maketitle

Write the abstract between \begin{abstract} and \end{abstract}

Include a table of contents after abstract

Use: \tableofcontents

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 10

Page 46: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Table of contents and Abstract

Include an abstract immediately after \maketitle

Write the abstract between \begin{abstract} and \end{abstract}

Include a table of contents after abstract

Use: \tableofcontents

Practice: Prepare Table of contents in your document

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 10

Page 47: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Into the Body of Document

A document can have:

Sections, subsections, sub-subsections etc.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 11

Page 48: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Into the Body of Document

A document can have:

Sections, subsections, sub-subsections etc.

Use \section{section name}, \subsection{subsection name}, etc.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 11

Page 49: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Into the Body of Document

A document can have:

Sections, subsections, sub-subsections etc.

Mathematical symbols and formulae in line with the text. $ $ can provide in linemath environment

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 11

Page 50: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Into the Body of Document

A document can have:

Sections, subsections, sub-subsections etc.

Mathematical symbols and formulae in line with the text. $ $ can provide in linemath environment

Eg: A straight line equation is $ y=ax+b $. will produce;‘A straight line equation is y = ax + b.’ in the compiled document

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 11

Page 51: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Into the Body of Document

A document can have:

Sections, subsections, sub-subsections etc.

Mathematical symbols and formulae in line with the text. $ $ can provide in linemath environment

It may be required to refer a section or subsection in the body of the text. Use\section{section name}\label{section-label} to define a label to asection.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 11

Page 52: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Into the Body of Document

A document can have:

Sections, subsections, sub-subsections etc.

Mathematical symbols and formulae in line with the text. $ $ can provide in linemath environment

It may be required to refer a section or subsection in the body of the text. Use\section{section name}\label{section-label} to define a label to asection.

To cross refer a section or subsection having label ‘section-label’ Use\ref{section-label} at the appropriate place.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 11

Page 53: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Into the Body of Document

A document can have:

Sections, subsections, sub-subsections etc.

Mathematical symbols and formulae in line with the text. $ $ can provide in linemath environment

It may be required to refer a section or subsection in the body of the text. Use\section{section name}\label{section-label} to define a label to asection.

To cross refer a section or subsection having label ‘section-label’ Use\ref{section-label} at the appropriate place.

Eg: The detailed descriptions are provided in Section

\ref{section-label}.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 11

Page 54: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Into the Body of Document

A document can have:

Sections, subsections, sub-subsections etc.

Mathematical symbols and formulae in line with the text. $ $ can provide in linemath environment

It may be required to refer a section or subsection in the body of the text. Use\section{section name}\label{section-label} to define a label to asection.

To cross refer a section or subsection having label ‘section-label’ Use\ref{section-label} at the appropriate place.

Practice: Use label for a section in your sample document and cross refer to it in the body in some other

section.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 11

Page 55: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Environments:- Equations

The environments in a LATEX document are; equations, tables, arrays, lists, figures,

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 12

Page 56: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Environments:- Equations

The environments in a LATEX document are; equations, tables, arrays, lists, figures,

Equation

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 12

Page 57: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Environments:- Equations

The environments in a LATEX document are; equations, tables, arrays, lists, figures,

Equation

A single equation is typeset between \begin{equation} and \end{equation}.It will assign a number to the equation. Assign a ‘label’ to the equation and refer itanywhere.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 12

Page 58: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Environments:- Equations

The environments in a LATEX document are; equations, tables, arrays, lists, figures,

Equation

A single equation can also be typeset between $$ and $$ . No equation numberwill be created and no labelling possible.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 12

Page 59: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Environments:- Equations

The environments in a LATEX document are; equations, tables, arrays, lists, figures,

Equation

\begin{equation}

f=ma \label {eq1}

\end{equation}

Equation \ref{eq1} can be used to find out the force exerted

by a body of mass $ m $ moving with acceleration $ a $.

will produce:

f = ma. (1)

Equation 1 can be used to find out the force exerted by a body of mass m movingwith an acceleration a.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 12

Page 60: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Environments:- Equations

The environments in a LATEX document are; equations, tables, arrays, lists, figures,

Equation

\begin{eqnarray}

\varphi=\sqrt[10]{\frac{a}{b}} \label {eq1}\\

\lim {x \rightarrow 0} \frac{\sin x}{x} = 1 \label{eq3}

\end{eqnarray}

Will produce:

ϕ = 10

r

a

b(2)

limx→0

sin x

x= 1 (3)

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 12

Page 61: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Environments:- Arrays

Arrays are created using\begin{array}{justification}

and

\end{array}

{justification} possible for array elements are:

{l}:- for left aligned column{c}:- for centre aligned column{r}:- for right aligned column

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 13

Page 62: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Environments:- Arrays

$$

\left(

\begin{array}{ r c l}

\alpha i & \beta & \gamma\\

a&ab&abcd \\

1&123&3 \\

\end{array}

\right)

$$

Will Produce:

0

B

B

@

Γαi β γ

a ab abcd

1 123 3

1

C

C

A

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 13

Page 63: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Environments:- Tables

Tables are created using\begin{table}[position]

and

\caption{table caption }\label{table-label}

\end{table}

[position] possible for tables are:

[h]:- for position exactly at this place (here)[t]:- for top of the page in which the table comes[b]:- for bottom of the page in which the table comesUsually \tabular environment is used to define the column alignments

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 14

Page 64: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Environments:- Tables

\begin{table}

\begin{tabular}{|r|l|c|}

\hline Roll No. & Name & Grade \\

\hline 0123 & Radha & AA \\

\hline 0124 & Radhika & AB \\\hline

\end{tabular}

\caption{First Table}\label{first-table}

\end{table} Will Produce:

Roll No. Name Grade

0123 Radha AA

0124 Radhika AB

Table 1: First Table

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 14

Page 65: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Environments:- Tables

\begin{table} \centering

\begin{tabular}{|r|l|c|}

\hline Roll No. & Name & Grade \\

\hline 0125 & Anu & AB \\

\hline 0126 & Vinu & BB \\\hline

\end{tabular}

\caption{First Table}\label{first-table}

\end{table}

Will Produce:

Roll No. Name Grade

0125 Anu AB

0126 Vinu BB

Table 2: Second Table

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 14

Page 66: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Environments:- Lists

Lists are basically; Enumerated List, Bullet List, and DescriptionEnumerated Lists are created by\begin{enumerate}

\item First item in list\item Second item in list\end{enumerate}

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 15

Page 67: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Environments:- Lists

Lists are basically; Enumerated List, Bullet List, and Description

Enumerated List

\begin{enumerate}

\item First item in List

\item Second item in List

\end{enumerate}

Will Produce:

1. First item in List

2. Second item in List

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 15

Page 68: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Environments:- Lists

Lists are basically; Enumerated List, Bullet List, and Description

Bullet List

\begin{itemize}

\item First item in List

\item Second item in List

\end{itemize}

Will Produce:

First item in List

Second item in List

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 15

Page 69: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Environments:- Lists

Lists are basically; Enumerated List, Bullet List, and Description

Description List

\begin{description}

\item[IEOR] Industrial Engineering and Operations Research (IEOR)

at IIT Bombay.

\item[IDC] Industrial Design Centre (IDC) at the Indian Institute

of Technology Bombay.

\end{description}

Will Produce:

IEOR Industrial Engineering and Operations Research (IEOR) at IIT Bombay.

IDC Industrial Design Centre (IDC) at the Indian Institute of Technology Bombay.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 15

Page 70: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Environments:- Figures

Figures can be inserted with the graphics package included in the preamble.Figures are included by\begin{figure}[position] \centering

\includegrapics[size]{figure file name}

\caption{figure caption}\label{figure-label}

\end{figure}

Eg.\begin{figure}[h]\centering

\includegraphics[width=3in]{fig1.eps}

\caption{First Figure}\label{first-figure}

\end{figure}

Will produce:

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 16

Page 71: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Environments:- Figures

Figure 1: First FigureLATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 16

Page 72: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Environments:- Tabbing

Tabbing sets Tab positions in a line and the following lines follow these tab positions.Tab separation is done by ‘\=’. These tab positions are used by ‘\>’

E.g.

\begin{tabbing}

Program\quad \= : \= \TeX\\ [5pt]

Author \> : \> Donald Knuth\\[5pt]

Manuals \> :\\

\end{tabbing}

Will produce:

Program : TEX

Author : Donald Knuth

Manuals :

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 17

Page 73: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Tabbing- (Contd..)

Another example

\begin{tabbing}

Book Title \hspace{2cm} \= Author \hspace{2cm} \= Year\\ [5pt]

Stochastic Process \> S. M. Ross \> 2007\\[5pt]

Linear Programming \> Robert J. Vanderbei \> 2008

\end{tabbing}

Will produce:

Book Title Author Year

Stochastic Process S. M. Ross 2007

Linear Programming Robert J. Vanderbei 2008

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 18

Page 74: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Linespacing in a file

Line spacing in a file can be globally be fixed to single space, one and half space, ordouble space, by declaring the base line stretch

‘\renewcommand{\baselinestretch}{1.5}’ used before ‘\begin{document}’ willchange the linespacing in the entire document to one half space.

A cleaner way is to use the package ‘setspace’

This will allow changing the line spacing from any point in the document onwards.Commands used are:‘\singlespace’ : for single space‘\onehalfspace’ : for one and half space space‘\doublespace’ : for double space

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 19

Page 75: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Citations in a document

Citations can be inserted either by using a bibliography file (‘.bib’) and using the labelsto cite or by using ‘\bibitem{citekey}...contents...’ and use the citekey withinthe same document.Better follow the ‘.bib’ file and a style to cite.

\small

@BOOK{Axsater,

title = {{Inventory} {Control}},

publisher = {Kluwer Academic Publishers},

year = {2000},

author = {Sven Axs\"{a}ter}

}

@Article{DMTCS,

author = {Csaba Schneider},

title = {Computing nilpotent quotients in finitely presented

{L}ie rings},

journal = {Discrete Mathematics and Theoretical Computer Science},

year = 1997,

volume = {1},

number = {1},

pages = {1-16},LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 20

Page 76: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Use Citations

Citations can be inserted in the appropriate space by using ‘\cite{key}’ or‘\cite{keylist}’ (for more citations)A .bib file will have entries like

Searching is a topic which is under active development: the

CTAN team hope to be able shortly to provide significant

new tools \cite{Axsater}

\bibliography{sample}

\bibliographystyle{plain}

can produce

References

Axsäter, S., 2000. Inventory Control. Kluwer Academic Publishers.

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 21

Page 77: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

To change name for References Section and Styles

The title for thr references section can be changed to any thing by using‘\renewcommand\refname{required name}’ after the beginning of the document.

To get Author(year) type citations, use the package natbib.

then use citations by \citet{key} or \citep{key}\citet will produce → Axsäter (2000)

\citep will produce → (Axsäter 2000)

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 22

Page 78: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

Beamer Presentations

\documentclass{beamer}

\usetheme{Singapore}

\title{Example Presentation Created with the Beamer Package}

\author{Bijulal D.}

\date{\today}

\begin{document}

\frame{\titlepage}

\section[Outline]{}

\frame{\tableofcontents}

\section{Introduction}

\subsection{Overview of the Beamer Class}

\frame{ \frametitle{Features of the Beamer Class}

\begin{itemize}

\item<1-> Normal LaTeX class.

\item<2-> Easy overlays.

\item<3-> No external programs needed.

\end{itemize} }

\end{document}

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 23

Page 79: New Bijulal D & Anu Thomas Industrial Engineering and Operations … · 2010. 7. 11. · LATEX Workshop Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian

To be continued...

LATEX Workshop, IEOR@IITB, March 18 & 23, 2010 – p. 24