The Power of L A T EX: Typing Mathematics Easily Anders O. F . - - PowerPoint PPT Presentation

the power of l a t ex
SMART_READER_LITE
LIVE PREVIEW

The Power of L A T EX: Typing Mathematics Easily Anders O. F . - - PowerPoint PPT Presentation

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion The Power of L A T EX: Typing Mathematics Easily Anders O. F . Hendrickson Concordia College Moorhead, MN Math/CS


slide-1
SLIDE 1

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Power of L

AT

EX:

Typing Mathematics Easily

Anders O. F . Hendrickson

Concordia College Moorhead, MN

Math/CS Colloquium January 25, 2011

slide-2
SLIDE 2

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Outline

1

The Problem

2

The Solution: T EX

3

Pros and Cons

4

Writing as Programming

5

Peculiarities of T EX programming

6

Conclusion

slide-3
SLIDE 3

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Question

Question: You want to type some math for a printed paper or journal or book. How hard could that be?

slide-4
SLIDE 4

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Symbols

Question: How many symbols does it take to print a novel? Answer: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz .,:;?!’"$%&()*-/0123456789 About 78 or so.

slide-5
SLIDE 5

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Symbols

Question: How many symbols does it take to print a novel? Answer: ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz .,:;?!’"$%&()*-/0123456789 About 78 or so.

slide-6
SLIDE 6

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Symbols

Question: How many symbols does it take to print mathematics? Answer: All of the above, and

slide-7
SLIDE 7

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Symbols

Question: How many symbols does it take to print mathematics? Answer: All of the above, and

slide-8
SLIDE 8

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Symbols

Question: How many symbols does it take to print mathematics? Answer: All of the above, and αβγδεζηθικλµνoξπρστυϕχψω

slide-9
SLIDE 9

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Symbols

Question: How many symbols does it take to print mathematics? Answer: All of the above, and αβγδεζηθικλµνoξπρστυϕχψω Γ∆ΘΛΞΠΣΥΦΨΩ

slide-10
SLIDE 10

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Symbols

Question: How many symbols does it take to print mathematics? Answer: All of the above, and αβγδεζηθικλµνoξπρστυϕχψω Γ∆ΘΛΞΠΣΥΦΨΩ ∞∂ℵ∀∃∅

slide-11
SLIDE 11

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Symbols

Question: How many symbols does it take to print mathematics? Answer: All of the above, and αβγδεζηθικλµνoξπρστυϕχψω Γ∆ΘΛΞΠΣΥΦΨΩ ∞∂ℵ∀∃∅ NZQRCHOFK . . .

slide-12
SLIDE 12

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Symbols

Question: How many symbols does it take to print mathematics? Answer: All of the above, and αβγδεζηθικλµνoξπρστυϕχψω Γ∆ΘΛΞΠΣΥΦΨΩ ∞∂ℵ∀∃∅ NZQRCHOFK . . . <≤>≥⊂⊃⊆⊇∈=≡∼ ==≡∼ = ⊳ ⊳[]{}⌊⌋

slide-13
SLIDE 13

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Symbols

Question: How many symbols does it take to print mathematics? Answer: All of the above, and αβγδεζηθικλµνoξπρστυϕχψω Γ∆ΘΛΞΠΣΥΦΨΩ ∞∂ℵ∀∃∅ NZQRCHOFK . . . <≤>≥⊂⊃⊆⊇∈=≡∼ ==≡∼ = ⊳ ⊳[]{}⌊⌋ + − × ÷ ± ∓ ⊕ ⊖ ⊗ ⊙ ∧ ∨ ∩∪

slide-14
SLIDE 14

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Symbols

Question: How many symbols does it take to print mathematics? Answer: All of the above, and αβγδεζηθικλµνoξπρστυϕχψω Γ∆ΘΛΞΠΣΥΦΨΩ ∞∂ℵ∀∃∅ NZQRCHOFK . . . <≤>≥⊂⊃⊆⊇∈=≡∼ ==≡∼ = ⊳ ⊳[]{}⌊⌋ + − × ÷ ± ∓ ⊕ ⊖ ⊗ ⊙ ∧ ∨ ∩∪ →⇒⇔֒ →։

slide-15
SLIDE 15

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Symbols

Question: How many symbols does it take to print mathematics? Answer: All of the above, and αβγδεζηθικλµνoξπρστυϕχψω Γ∆ΘΛΞΠΣΥΦΨΩ ∞∂ℵ∀∃∅ NZQRCHOFK . . . <≤>≥⊂⊃⊆⊇∈=≡∼ ==≡∼ = ⊳ ⊳[]{}⌊⌋ + − × ÷ ± ∓ ⊕ ⊖ ⊗ ⊙ ∧ ∨ ∩∪ →⇒⇔֒ →։ . . .

slide-16
SLIDE 16

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Arrangement

When printing a novel, all the letters go one right after the

  • ther in nice even rows.

When printing mathematics, . . .

slide-17
SLIDE 17

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Arrangement

When printing a novel, all the letters go one right after the

  • ther in nice even rows.

When printing mathematics, . . .

slide-18
SLIDE 18

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Arrangement

When printing a novel, all the letters go one right after the

  • ther in nice even rows.

When printing mathematics, . . .

3

  • x2 + 7x − 5

log5 x +

  • i=1

aixi +  

51 times

  • y · y · y · y · · · y

  + 5 3

slide-19
SLIDE 19

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Symbols that stretch and shrink

We want √ b2 − 4ac, not √ b2 − 4ac And ( sin x cos x )2 looks funny too; we want sin x cos x 2 The fraction line in n(n − 1)(n − 2) · · · 3 · 2 · 1 k(k − 1) · · · 3 · 2 · 1 must stretch. We want x5, not x5, and

3

√ 17, not 3 √ 17. And what about xik vs. xik ?

slide-20
SLIDE 20

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Symbols that stretch and shrink

We want √ b2 − 4ac, not √ b2 − 4ac And ( sin x cos x )2 looks funny too; we want sin x cos x 2 The fraction line in n(n − 1)(n − 2) · · · 3 · 2 · 1 k(k − 1) · · · 3 · 2 · 1 must stretch. We want x5, not x5, and

3

√ 17, not 3 √ 17. And what about xik vs. xik ?

slide-21
SLIDE 21

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Symbols that stretch and shrink

We want √ b2 − 4ac, not √ b2 − 4ac And ( sin x cos x )2 looks funny too; we want sin x cos x 2 The fraction line in n(n − 1)(n − 2) · · · 3 · 2 · 1 k(k − 1) · · · 3 · 2 · 1 must stretch. We want x5, not x5, and

3

√ 17, not 3 √ 17. And what about xik vs. xik ?

slide-22
SLIDE 22

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Symbols that stretch and shrink

We want √ b2 − 4ac, not √ b2 − 4ac And ( sin x cos x )2 looks funny too; we want sin x cos x 2 The fraction line in n(n − 1)(n − 2) · · · 3 · 2 · 1 k(k − 1) · · · 3 · 2 · 1 must stretch. We want x5, not x5, and

3

√ 17, not 3 √ 17. And what about xik vs. xik ?

slide-23
SLIDE 23

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Symbols that stretch and shrink

We want √ b2 − 4ac, not √ b2 − 4ac And ( sin x cos x )2 looks funny too; we want sin x cos x 2 The fraction line in n(n − 1)(n − 2) · · · 3 · 2 · 1 k(k − 1) · · · 3 · 2 · 1 must stretch. We want x5, not x5, and

3

√ 17, not 3 √ 17. And what about xik vs. xik ?

slide-24
SLIDE 24

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Spacing

Contrast 3−5 with 3 − 5. But in a negation, −7 looks better than − 7. And compare

  • cos xdx
  • cos x dx
  • cos x dx
slide-25
SLIDE 25

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Spacing

Contrast 3−5 with 3 − 5. But in a negation, −7 looks better than − 7. And compare

  • cos xdx
  • cos x dx
  • cos x dx
slide-26
SLIDE 26

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Problem: Spacing

Contrast 3−5 with 3 − 5. But in a negation, −7 looks better than − 7. And compare

  • cos xdx
  • cos x dx
  • cos x dx
slide-27
SLIDE 27

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Some Solutions

slide-28
SLIDE 28

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Some Solutions

slide-29
SLIDE 29

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Some Solutions

slide-30
SLIDE 30

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Some Solutions

slide-31
SLIDE 31

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Some Solutions

slide-32
SLIDE 32

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Some Solutions

There’s always. . . Microsoft Word. . .

slide-33
SLIDE 33

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The Solution: T EX

In 1977, Donald Knuth of Stanford was publishing the 2nd edition of The Art of Computer Programming The publisher’s work disappointed him, so he vowed to write a better computer typesetting system. The result was T EX, written in 1978, improved in 1982, and finally frozen in 1989. In the early 1980’s, Leslie Lamport wrote L

A

T EX, a document preparation system based on T EX.

slide-34
SLIDE 34

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

How it works

source file (.tex) L

A

T EX viewable file (.dvi or .pdf)

slide-35
SLIDE 35

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

So let’s try it!

slide-36
SLIDE 36

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Pros and Cons of T EX

Disadvantages:

1

Learning curve steep, oddly shaped. . .

2

Two-step process, not “WYSIWYG”. . .

3

The further you get from simple typesetting, the harder it is to program. . .

slide-37
SLIDE 37

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Pros and Cons of T EX

Disadvantages:

1

Learning curve steep, oddly shaped. . . but there is help!

2

Two-step process, not “WYSIWYG”. . .

3

The further you get from simple typesetting, the harder it is to program. . .

slide-38
SLIDE 38

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Pros and Cons of T EX

Disadvantages:

1

Learning curve steep, oddly shaped. . . but there is help!

2

Two-step process, not “WYSIWYG”. . . but there are editors!

3

The further you get from simple typesetting, the harder it is to program. . .

slide-39
SLIDE 39

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Pros and Cons of T EX

Disadvantages:

1

Learning curve steep, oddly shaped. . . but there is help!

2

Two-step process, not “WYSIWYG”. . . but there are editors!

3

The further you get from simple typesetting, the harder it is to program. . . but there are packages!

slide-40
SLIDE 40

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Pros and Cons of T EX

Advantages:

1

Mathematics is easy to type!

2

Small file sizes—no hidden bloat.

3

Complete control over source code

4

Universality

5

In-text invisible comments

6

Whitespace allows visible document structure.

7

Completely programmable (more on this later)

8

Packages

9

And best of all. . . it’s free!

slide-41
SLIDE 41

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Pros and Cons of T EX

Advantages:

1

Mathematics is easy to type!

2

Small file sizes—no hidden bloat.

3

Complete control over source code

4

Universality

5

In-text invisible comments

6

Whitespace allows visible document structure.

7

Completely programmable (more on this later)

8

Packages

9

And best of all. . . it’s free!

slide-42
SLIDE 42

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Pros and Cons of T EX

Advantages:

1

Mathematics is easy to type!

2

Small file sizes—no hidden bloat.

3

Complete control over source code

4

Universality

5

In-text invisible comments

6

Whitespace allows visible document structure.

7

Completely programmable (more on this later)

8

Packages

9

And best of all. . . it’s free!

slide-43
SLIDE 43

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Pros and Cons of T EX

Advantages:

1

Mathematics is easy to type!

2

Small file sizes—no hidden bloat.

3

Complete control over source code

4

Universality

5

In-text invisible comments

6

Whitespace allows visible document structure.

7

Completely programmable (more on this later)

8

Packages

9

And best of all. . . it’s free!

slide-44
SLIDE 44

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Universality

L

A

T EX files are used by academics across the world. are easily exchanged because they’re small. compile exactly the same on all computer systems. can be archived indefinitely, because the language is “frozen.”

slide-45
SLIDE 45

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Pros and Cons of T EX

Advantages:

1

Mathematics is easy to type!

2

Small file sizes—no hidden bloat.

3

Complete control over source code

4

Universality

5

In-text invisible comments

6

Whitespace allows visible document structure.

7

Completely programmable (more on this later)

8

Packages

9

And best of all. . . it’s free!

slide-46
SLIDE 46

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Pros and Cons of T EX

Advantages:

1

Mathematics is easy to type!

2

Small file sizes—no hidden bloat.

3

Complete control over source code

4

Universality

5

In-text invisible comments

6

Whitespace allows visible document structure.

7

Completely programmable (more on this later)

8

Packages

9

And best of all. . . it’s free!

slide-47
SLIDE 47

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Pros and Cons of T EX

Advantages:

1

Mathematics is easy to type!

2

Small file sizes—no hidden bloat.

3

Complete control over source code

4

Universality

5

In-text invisible comments

6

Whitespace allows visible document structure.

7

Completely programmable (more on this later)

8

Packages

9

And best of all. . . it’s free!

slide-48
SLIDE 48

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Pros and Cons of T EX

Advantages:

1

Mathematics is easy to type!

2

Small file sizes—no hidden bloat.

3

Complete control over source code

4

Universality

5

In-text invisible comments

6

Whitespace allows visible document structure.

7

Completely programmable (more on this later)

8

Packages

9

And best of all. . . it’s free!

slide-49
SLIDE 49

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Pros and Cons of T EX

Advantages:

1

Mathematics is easy to type!

2

Small file sizes—no hidden bloat.

3

Complete control over source code

4

Universality

5

In-text invisible comments

6

Whitespace allows visible document structure.

7

Completely programmable (more on this later)

8

Packages

9

And best of all. . . it’s free!

slide-50
SLIDE 50

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Packages

Developers have written packages and extensions for L

AT

EX

  • to. . .

provide multilingual support for languages from Arabic to Chinese automatically generate indices and bibliographies include every mathematical symbol you can imagine handle columns, tables, floating figures, etc. handle graphics and animation Make books, slideshows, newsletters Run database operations like mail merges much, much more.

slide-51
SLIDE 51

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Pros and Cons of T EX

Advantages:

1

Mathematics is easy to type!

2

Small file sizes—no hidden bloat.

3

Complete control over source code

4

Universality

5

In-text invisible comments

6

Whitespace allows visible document structure.

7

Completely programmable (more on this later)

8

Packages

9

And best of all. . . it’s free!

slide-52
SLIDE 52

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Pros and Cons of T EX

Advantages:

1

Mathematics is easy to type!

2

Small file sizes—no hidden bloat.

3

Complete control over source code

4

Universality

5

In-text invisible comments

6

Whitespace allows visible document structure.

7

Completely programmable (more on this later)

8

Packages

9

And best of all. . . it’s free!

slide-53
SLIDE 53

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Freedom!

Free speech vs. Free beer

slide-54
SLIDE 54

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Freedom!

Free speech vs. Free beer frei kostenlos

slide-55
SLIDE 55

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Freedom!

Free speech vs. Free beer frei kostenlos You can read the source, $0.00 improve it, and redistribute it.

slide-56
SLIDE 56

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Freedom!

Free speech vs. Free beer frei kostenlos You can read the source, $0.00 improve it, and redistribute it. T EX and L

AT

EX are both!

slide-57
SLIDE 57

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Writing as programming

T EX is a completely programmable language. The key concept: defining macros Examples: \today, \thm, \Z You can even redefine T EX’s original commands, such as \phi and \par You can choose commands that make sense to you!

slide-58
SLIDE 58

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Writing as programming

T EX is a completely programmable language. The key concept: defining macros Examples: \today, \thm, \Z You can even redefine T EX’s original commands, such as \phi and \par You can choose commands that make sense to you!

slide-59
SLIDE 59

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Writing as programming

T EX is a completely programmable language. The key concept: defining macros Examples: \today, \thm, \Z You can even redefine T EX’s original commands, such as \phi and \par You can choose commands that make sense to you!

slide-60
SLIDE 60

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Writing as programming

T EX is a completely programmable language. The key concept: defining macros Examples: \today, \thm, \Z You can even redefine T EX’s original commands, such as \phi and \par You can choose commands that make sense to you!

slide-61
SLIDE 61

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Writing as programming

T EX is a completely programmable language. The key concept: defining macros Examples: \today, \thm, \Z You can even redefine T EX’s original commands, such as \phi and \par You can choose commands that make sense to you!

slide-62
SLIDE 62

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Document structure: the idea of L

AT

EX

T EX is about putting ink on the paper; L

AT

EX focuses on your document’s structure Example: section headings \noindent{\Large\bf The Next Section}\par You could encapsulate this in a \newsection command. Then, if you ever changed your mind and wanted it bigger, you could just change \Large to \LARGE in one place to affect all the sections. You separated the logical markup from the typographical markup. This logical markup is exactly what L

AT

EX does, and much more!

slide-63
SLIDE 63

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Document structure: the idea of L

AT

EX

T EX is about putting ink on the paper; L

AT

EX focuses on your document’s structure Example: section headings \noindent{\Large\bf The Next Section}\par You could encapsulate this in a \newsection command. Then, if you ever changed your mind and wanted it bigger, you could just change \Large to \LARGE in one place to affect all the sections. You separated the logical markup from the typographical markup. This logical markup is exactly what L

AT

EX does, and much more!

slide-64
SLIDE 64

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Document structure: the idea of L

AT

EX

T EX is about putting ink on the paper; L

AT

EX focuses on your document’s structure Example: section headings \noindent{\Large\bf The Next Section}\par You could encapsulate this in a \newsection command. Then, if you ever changed your mind and wanted it bigger, you could just change \Large to \LARGE in one place to affect all the sections. You separated the logical markup from the typographical markup. This logical markup is exactly what L

AT

EX does, and much more!

slide-65
SLIDE 65

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Document structure: the idea of L

AT

EX

T EX is about putting ink on the paper; L

AT

EX focuses on your document’s structure Example: section headings \noindent{\Large\bf The Next Section}\par You could encapsulate this in a \newsection command. Then, if you ever changed your mind and wanted it bigger, you could just change \Large to \LARGE in one place to affect all the sections. You separated the logical markup from the typographical markup. This logical markup is exactly what L

AT

EX does, and much more!

slide-66
SLIDE 66

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Document structure: the idea of L

AT

EX

T EX is about putting ink on the paper; L

AT

EX focuses on your document’s structure Example: section headings \noindent{\Large\bf The Next Section}\par You could encapsulate this in a \newsection command. Then, if you ever changed your mind and wanted it bigger, you could just change \Large to \LARGE in one place to affect all the sections. You separated the logical markup from the typographical markup. This logical markup is exactly what L

AT

EX does, and much more!

slide-67
SLIDE 67

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Document structure: the idea of L

AT

EX

T EX is about putting ink on the paper; L

AT

EX focuses on your document’s structure Example: section headings \noindent{\Large\bf The Next Section}\par You could encapsulate this in a \newsection command. Then, if you ever changed your mind and wanted it bigger, you could just change \Large to \LARGE in one place to affect all the sections. You separated the logical markup from the typographical markup. This logical markup is exactly what L

AT

EX does, and much more!

slide-68
SLIDE 68

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

More on L

A

T EX

L

A

T EX’s document structuring features include Automatic numbering of chapters, sections, theorems, lists, etc. Automatic cross-referencing BIBT EX: automatic bibliographies \makeindex: automatic indices

slide-69
SLIDE 69

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

The flexibility of structured documents

If we use logical markup in an article and submit it to a journal, the publisher can automatically adjust the article to the journal’s style \defnstyle vs. \emph \renewcommand{\labelenumi}{G\theenumi.} Practice exams with and without solutions

slide-70
SLIDE 70

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Macro expansion programming

The primary mechanism of T EX is macro expansion, but there’s a little more: \if. . . \else. . . \fi conditionals registers for saving integers, lengths, and boxes

slide-71
SLIDE 71

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Example: A Loop

Let’s say we want a loop to print 1 2 3 . Our syntax will be \loop \fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4 \repeat Here is how our \loop macro is defined: \def\loop#1\repeat{\def\body{#1}\iterate} \def\iterate{\body \let\next=\iterate \else \let\next=\relax \fi \next}

slide-72
SLIDE 72

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: T EX sees

\loop \fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4 \repeat

State of the Machine: \body is undefined \next is undefined \MyCount is 1

slide-73
SLIDE 73

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: T EX sees

\def\body{\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4} \iterate

State of the Machine: \body is undefined \next is undefined \MyCount is 1

slide-74
SLIDE 74

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: T EX sees

\iterate

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is undefined \MyCount is 1

slide-75
SLIDE 75

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: T EX sees

\body \let\next=\iterate \else \let\next=\relax \fi \next

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is undefined \MyCount is 1

slide-76
SLIDE 76

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: T EX sees

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4 \let\next=\iterate \else \let\next=\relax \fi \next

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is undefined \MyCount is 1

slide-77
SLIDE 77

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 T EX sees

\advance\MyCount by 1 \ifnum\MyCount<4 \let\next=\iterate \else \let\next=\relax \fi \next

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is undefined \MyCount is 1

slide-78
SLIDE 78

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 T EX sees

\ifnum\MyCount<4 \let\next=\iterate \else \let\next=\relax \fi \next

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is undefined \MyCount is 2

slide-79
SLIDE 79

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 T EX sees

\let\next=\iterate \next

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is undefined \MyCount is 2

slide-80
SLIDE 80

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 T EX sees

\next

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is

\iterate

\MyCount is 2

slide-81
SLIDE 81

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 T EX sees

\iterate

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is

\iterate

\MyCount is 2

slide-82
SLIDE 82

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 T EX sees

\body \let\next=\iterate \else \let\next=\relax \fi \next

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is

\iterate

\MyCount is 2

slide-83
SLIDE 83

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 T EX sees

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4 \let\next=\iterate \else \let\next=\relax \fi \next

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is

\iterate

\MyCount is 2

slide-84
SLIDE 84

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 2 T EX sees

\advance\MyCount by 1 \ifnum\MyCount<4 \let\next=\iterate \else \let\next=\relax \fi \next

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is

\iterate

\MyCount is 2

slide-85
SLIDE 85

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 2 T EX sees

\ifnum\MyCount<4 \let\next=\iterate \else \let\next=\relax \fi \next

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is

\iterate

\MyCount is 3

slide-86
SLIDE 86

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 2 T EX sees

\let\next=\iterate \next

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is

\iterate

\MyCount is 3

slide-87
SLIDE 87

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 2 T EX sees

\next

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is

\iterate

\MyCount is 3

slide-88
SLIDE 88

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 2 T EX sees

\iterate

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is

\iterate

\MyCount is 3

slide-89
SLIDE 89

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 2 T EX sees

\body \let\next=\iterate \else \let\next=\relax \fi \next

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is

\iterate

\MyCount is 3

slide-90
SLIDE 90

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 2 T EX sees

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4 \let\next=\iterate \else \let\next=\relax \fi \next

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is

\iterate

\MyCount is 3

slide-91
SLIDE 91

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 2 3 T EX sees

\advance\MyCount by 1 \ifnum\MyCount<4 \let\next=\iterate \else \let\next=\relax \fi \next

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is

\iterate

\MyCount is 3

slide-92
SLIDE 92

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 2 3 T EX sees

\ifnum\MyCount<4 \let\next=\iterate \else \let\next=\relax \fi \next

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is

\iterate

\MyCount is 4

slide-93
SLIDE 93

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 2 3 T EX sees

\let\next=\relax \next

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is

\iterate

\MyCount is 4

slide-94
SLIDE 94

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 2 3 T EX sees

\next

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is

\relax

\MyCount is 4

slide-95
SLIDE 95

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 2 3 T EX sees

\relax

State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is

\relax

\MyCount is 4

slide-96
SLIDE 96

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Our loop in action

Output: 1 2 3 T EX sees State of the Machine: \body is

\fbox{\the\MyCount} \advance\MyCount by 1 \ifnum\MyCount<4

\next is

\relax

\MyCount is 4

slide-97
SLIDE 97

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

Let’s close by looking at some examples.

slide-98
SLIDE 98

The Problem The Solution: T EX Pros and Cons Writing as Programming Peculiarities of T EX programming Conclusion

An Invitation

Our computer labs in Ivers have both L

A

T EX and the T EX editor WinEdt. If you want to put L

AT

EX on your own computer, I can point you to the right resources. If there’s interest, I’d love to hold a hands-on L

A

T EX starter class in the computer lab some night. Let me know!