latex tutorial

47
L A T E X Tutorial Jhoirene B Clemente Sanggumay Residence Hall University of the Philippines Diliman Nov 14, 2014

Upload: jhoirene-clemente

Post on 02-Jul-2015

177 views

Category:

Technology


2 download

DESCRIPTION

Document preparation using LaTeX.

TRANSCRIPT

Page 1: LaTex Tutorial

LATEXTutorialJhoirene B Clemente

Sanggumay Residence HallUniversity of the Philippines Diliman

Nov 14, 2014

Page 2: LaTex Tutorial

34

LATEXTutorial

JB Clemente

2 Introduction

Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

What is LATEX?

1. Latex is a document preparation system2. Pronunciation: “LAY-tek" or “LAH-tek" (definitely not

"“LAH-teks")3. Markup language for mathematical symbols and formulas

Page 3: LaTex Tutorial

34

LATEXTutorial

JB Clemente

3 Introduction

Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

WYSIWIYG Word Processors

What You See Is What You Get (WYSIWYG)

Microsoft Word and Libre Office Writer

Page 4: LaTex Tutorial

34

LATEXTutorial

JB Clemente

4 Introduction

Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

WYSIWYG Word Processors vs Markup

Page 5: LaTex Tutorial

34

LATEXTutorial

JB Clemente

4 Introduction

Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

WYSIWYG Word Processors vs Markup

Page 6: LaTex Tutorial

34

LATEXTutorial

JB Clemente

5 Introduction

Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Why LATEX?

I Mathematical typesettingI Superior typographic qualityI Output device independenceI PortabilityI Document longevityI Macros and other programmatic featuresI Formatting presets are automatic

Page 7: LaTex Tutorial

34

LATEXTutorial

JB Clemente

6 Introduction

Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

What is bad about LATEX?

I Difficulty knowing/remembering markup commandsI Previewing delayI Possibility of syntax errorsI Adding new fonts

Page 8: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

7 Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Getting Started: What you need to Install

You need the following1. LATEXDistribution: MacTeX, LaTeX, MikTeX2. TeX Editor: notepad, gedit, TeXmaker, etc.3. Document Previewer: Adobe Acrobat reader, Foxit, Preview

Page 9: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

8 Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

General Document Structure

\documentclass{article}.PREAMBLE.

\begin{document}.BODY.\end{document}

Definition (Preamble)Consists of the overall, document-wide LaTeX formattingcommands

Definition (Body)Contains the text of the document and text formatting commands

Page 10: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

8 Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

General Document Structure

\documentclass{article}.PREAMBLE.

\begin{document}.BODY.\end{document}

Definition (Preamble)Consists of the overall, document-wide LaTeX formattingcommands

Definition (Body)Contains the text of the document and text formatting commands

Page 11: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

8 Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

General Document Structure

\documentclass{article}.PREAMBLE.

\begin{document}.BODY.\end{document}

Definition (Preamble)Consists of the overall, document-wide LaTeX formattingcommands

Definition (Body)Contains the text of the document and text formatting commands

Page 12: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

9 Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

General Principles

1. Spaces and line breaks are not important. A blank line startsa new paragraph, however.

2. Commands all start with backslash:\documentclass

3. Braces are used for “arguments"\documentclass{article}

4. Brackets are used for“optional arguments":\documentclass[11pt]{article}

5. Commands are case sensitive.\documentclass not \DocumentClass

Page 13: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

9 Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

General Principles

1. Spaces and line breaks are not important. A blank line startsa new paragraph, however.

2. Commands all start with backslash:\documentclass

3. Braces are used for “arguments"\documentclass{article}

4. Brackets are used for“optional arguments":\documentclass[11pt]{article}

5. Commands are case sensitive.\documentclass not \DocumentClass

Page 14: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

9 Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

General Principles

1. Spaces and line breaks are not important. A blank line startsa new paragraph, however.

2. Commands all start with backslash:\documentclass

3. Braces are used for “arguments"\documentclass{article}

4. Brackets are used for“optional arguments":\documentclass[11pt]{article}

5. Commands are case sensitive.\documentclass not \DocumentClass

Page 15: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

9 Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

General Principles

1. Spaces and line breaks are not important. A blank line startsa new paragraph, however.

2. Commands all start with backslash:\documentclass

3. Braces are used for “arguments"\documentclass{article}

4. Brackets are used for“optional arguments":\documentclass[11pt]{article}

5. Commands are case sensitive.\documentclass not \DocumentClass

Page 16: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

9 Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

General Principles

1. Spaces and line breaks are not important. A blank line startsa new paragraph, however.

2. Commands all start with backslash:\documentclass

3. Braces are used for “arguments"\documentclass{article}

4. Brackets are used for“optional arguments":\documentclass[11pt]{article}

5. Commands are case sensitive.\documentclass not \DocumentClass

Page 17: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

10 Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Document Types

1. article - for short documents for publication2. report - for longer technical documents; like articles, but has

chapters3. book - for large documents, such as books4. letter - for writing letters5. Beamer - for presentation slides

Page 18: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

11 Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Simple Article

\documentclass{article}

\begin{document}% Content

\end{document}

Page 19: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

12 Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Simple Article with Preamble

Commands for specifying1. Title2. Author3. Date

\title{LaTex Tutorial}\author{Jhoirene B Clemente}\date{Nov 20, 2014}

To include title, author, and date in the document.We will use the command

\maketitle

Page 20: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

12 Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Simple Article with Preamble

Commands for specifying1. Title2. Author3. Date

\title{LaTex Tutorial}\author{Jhoirene B Clemente}\date{Nov 20, 2014}

To include title, author, and date in the document.We will use the command

\maketitle

Page 21: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

13 Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Environments

Environment declaration

\begin{<environment>}....\end{<environment>}

Basic EnvironmentsI documentI enumerateI itemizeI figureI table

Page 22: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

13 Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Environments

Environment declaration

\begin{<environment>}....\end{<environment>}

Basic EnvironmentsI documentI enumerateI itemizeI figureI table

Page 23: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

14 Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Example Environment: list with bullets

Basic environments

\begin{itemize}

\item document\item itemize\item enumerate\item figure\item table

\end{itemize}

Page 24: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

15 Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Example Environment: enumerate

Basic environments

\begin{enumerate}

\item document\item itemize\item enumerate\item figure\item table

\end{enumerate}

Page 25: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

16 Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Example Environment: enumerate

Basic environments1. document2. itemize3. enumerate4. figure5. table

Page 26: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

17 Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Other useful environments

1. definition2. theorem3. proof4. lemma5. claim

Page 27: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

18 Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Basic Text Formatting

The quick brown fox jump over the lazy dog

The \textbf{quick} brown \textit{fox}jump over the \underline{lazy}\textbf{\textit{dog}}

Page 28: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

18 Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Basic Text Formatting

The quick brown fox jump over the lazy dog

The \textbf{quick} brown \textit{fox}jump over the \underline{lazy}\textbf{\textit{dog}}

Page 29: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

19 Typesetting

Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Other Text Formatting Commands

Page 30: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

Typesetting

20 Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Math mode \usepackage{amsmath}

Let f be the function defined by f (x) = 3x + 7, and leta be a positive real number.

Page 31: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

Typesetting

20 Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Math mode \usepackage{amsmath}

Let f be the function defined by f (x) = 3x + 7, and leta be a positive real number.

Page 32: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

Typesetting

20 Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Math mode \usepackage{amsmath}

Let f be the function defined by f (x) = 3x + 7, and leta be a positive real number.

Page 33: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

Typesetting

21 Math Mode

Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Math mode \usepackage{amsmath}

cos(2θ) = cos2 θ − sin2 θ

limx→∞ exp(−x) = 0

a mod b

kn+1 = n2 + k2n − kn−1

n!k!(n−k)! =

(nk)

x ≡ a (mod b)

Page 34: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

Typesetting

Math Mode

22 Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Citation and References

Page 35: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

Typesetting

Math Mode

22 Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Citation and References

Page 36: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

Typesetting

Math Mode

23 Citation and References

Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Bibfiles

Collection of bibliographic entries stored in “filename.bib"

Figure: Sample bibfile

Page 37: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

Typesetting

Math Mode

Citation and References

24 Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Using Style Files

Page 38: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

Typesetting

Math Mode

Citation and References

25 Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Using Style Files

Page 39: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

Typesetting

Math Mode

Citation and References

26 Using Style Files

Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

LATEXStyle File

You are recommended to use the Elsevier article class elsarticle.clshttp://www.ctan.org/tex-archive/macros/latex/contrib/elsarticle to prepare your manuscript and BibTeX(http://www.bibtex.org) to generate your bibliography. Fordetailed submission instructions, templates and other informationon LaTeX, see http://www.elsevier.com/latex.

Page 40: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

27 Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Easier Option: LYX

What You See Is What You Mean

Page 41: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

28 Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Easier Option: LYX

Page 42: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

29 Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Easier Option: LYX

Page 43: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

30 Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

TeX with Collaboration

Page 44: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

31 Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

TeX with Collaboration

Page 45: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

32 Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Must have Apps

Page 46: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

33 Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

Thank you for listening.

Page 47: LaTex Tutorial

34

LATEXTutorial

JB Clemente

Introduction

Getting Started

Document Types

Typesetting

Math Mode

Citation and References

Using Style Files

34 Other Tools

References

Sanggumay Residence HallUniversity of the Philippines

DilimanNov 13, 2014

References