You are on page 1of 145

A Simplied Introdu tion to LATEX

Harvey J. Greenberg
University of Colorado at Denver
Mathemati s Department
PO Box 173364
Denver, CO 80217-3364
hgreenbe arbon. udenver.edu
http://www. udenver.edu/

April 11, 2000 

hgreenbe/

i
Table of Contents

List of Figures

iii

List of Tables

vi

Prefa e

viii

A knowledgements

ix

Sour es of LATEX Software

ix

1 Overview

1

2 Text

2.1 Fonts and Paragraphs .
2.2 Lists . . . . . . . . . .
2.3 Making Tables . . . . .
2.4 Spe ial Chara ters . .
2.5 Tabbing . . . . . . . .
2.6 Line and Page Breaks .
2.7 Spa ing . . . . . . . .
Exer ises . . . . . . . . . . .

3 Bibliography with

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

BibTEX

3.1 Overview . . . . . . . . . .
3.2 The bib File . . . . . . . .
3.2.1 Main body . . . . .
3.2.2 Web itations . . .
3.2.3 Additional features
3.3 De laration and Citation .
Exer ises . . . . . . . . . . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

4 Counters, Labels, and Referen es
4.1 Basi Con epts . .
4.2 Intrinsi Counters .
4.3 Figures and Tables
4.4 Dening Your Own
Exer ises . . . . . . . . .

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

5

7
13
16
23
24
26
27
28

30
30
31
31
36
38
40
42

43
43
44
45
47
49

ii

5 Math Mode

5.1 Mathemati al Symbols . . . . . . . . . .
5.2 Fra tions and Variable Size Fun tionality
5.3 Arrays and Equations . . . . . . . . . . .
5.4 Spe ial Fun tions and Alphabets . . . .
5.5 Derivatives and Integrals . . . . . . . . .
5.6 Theorems and Denitions . . . . . . . .
5.7 Renements . . . . . . . . . . . . . . . .
5.8 Grammar . . . . . . . . . . . . . . . . .
Exer ises . . . . . . . . . . . . . . . . . . . . .

6 Graphi s

6.1 Pi ture Environment
6.2 PSTri ks . . . . . . .
6.3 Importing pi tures .
Exer ises . . . . . . . . . .

7 Making Spe ial Parts

7.1 Cover Page . . . .
7.2 Abstra t . . . . . .
7.3 Other Front Matter
7.4 Ba k Matter . . . .
Exer ises . . . . . . . . .

8.1
8.2
8.3
8.4
8.5

Your
Your
Your
Your
Your

Own
Own
Own
Own
Own

.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

Abbreviations and Commands
Names, Titles and Numbers .
Environments . . . . . . . . .
Margins and Spa ing . . . . .
Bibliography . . . . . . . . .

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

.
.
.
.
.

8 Taking Control

.
.
.
.
.

.
.
.
.

.
.
.
.
.
.
.
.
.

50
50
53
57
65
67
69
71
75
76

80

80
88
99
102

105
105
107
108
110
110

111
111
113
114
115
119

Closing Remarks

120

Appendix

121

Referen es

128

Index

131

. . . . . . . . . . . . . . . . . . . . Obtaining Bra kets in a Des ription List Environment . . . . . Multi olumn Sour e (Result in Figure 27) . . . . . . . . . . . . . . . . . . . . . . . . . . Skipping Line Spa es Sour e (Result in Figure 13) . . . . Alternative enumerate Symbols Sour e (Result in Figure 37) . . . . . . . . . . . . . . . . . . . . Nested Tables Result (Sour e in Figure 22) . . . . . . . Itemize List Environment Result (Sour e in Figure 15) . . A  Table with Horizontal and Verti al Lines . . . . . . . . . . . . Your First LATEX Sour e File . . An Introdu tory Do ument Sour e (Result in Figure 5) . . . . . . . . . . . . . . . . \parbox Sour e (Result in Figure 25) . . . . . . . . Tabbing Sour e (Result in Figure 30) . . . . . . . Skipping Line Spa es Result (Sour e in Figure 12) . . Positioning Paragraphs Result (Sour e in Figure 6) . . . . . . . . . . . Enumerate List Environment Sour e (Result in Figure 18) . . . . . Itemize List Environment Sour e (Result in Figure 16) . Enumerate List Environment Result (Sour e in Figure 17) . . A  Table .iii List of Figures 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 The Stru ture of a LATEX Do ument. . . . Framed Figure with Caption at Bottom . . . Positioning Paragraphs Sour e (Result in Figure 7) . . . . 2 3 2 3 1 2 4 6 6 7 8 9 9 10 10 12 12 14 15 15 16 16 17 17 17 18 19 21 21 22 22 23 26 26 31 42 46 46 47 48 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Tabbing Result (Sour e in Figure 29) . Centering Sour e (Result in Figure 9) . Des ription List Environment . . . . Framed Figure with Caption at Top . . . . . . . Adding bibtex to the Command Sequen e . . \parbox Result (Sour e in Figure 24) . . A Do ument to Print the Bibliographi Database . . . . . . . . . . . . . . . . . . . . . . . . Centering Result (Sour e in Figure 8) . . . . . . . . . . . . . . . . . Some Font Sizes Result (Sour e in Figure 10) . . . . . . . . . . . . . . . . . . . . . . Multi olumn Result (Sour e in Figure 26) . . . . Framed Figure 34 Sour e . . An Introdu tory Do ument Result (Sour e in Figure 4) . . A Table with Partially Spanning Horizontal and Verti al Lines Nested Tables Sour e (Result in Figure 23) . . . . . . . . . . . Some Font Sizes Sour e (Result in Figure 11) . . . . . . . Command Sequen e from Sour e to Posts ript . . . . . . . . . . . . . . . .

. . . Line Parameters . . . . . . . . . .iv 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 Alternative enumerate Symbols Result (Sour e in Figure 36) Variable Sizes Sour e (Result in Figure 39) . . . . . . . Variety of Obje ts in Pi ture Environment . . . . . . . . . gather* Environment Result (Sour e in Figure 55) . . \displaystyle Result (Sour e in Figure 40) . Sequen e of PSTri ks Commands to Draw Histogram . . . . . . . . . . eqnarray Environment Result (Sour e in Figure 43) . . Footnotes in the Cover Page Sour e (Result in Figure 75) . . . . . . . . . . Matrix Equation Sour e (Result in Figure 46) . . . . Applying \in ludegraphi s to Import an eps File . Sour e for Figure 61 . . Commutative Diagram Sour e (Result in Figure 58) . . . \raggedright in parbox Result (Sour e in Figure 53) . . . . Nested Arrays Result (Sour e in Figure 47) . \displaystyle Sour e (Result in Figure 41) . . . . . . . Graph Sour e (Result in Figure 66) . . . . . . . . . . . . . . . . . . . . . . . . . . Commutative Diagram Result (Sour e in Figure 57) . . . . . . . . . . . . . Sour e Code for Drawing Histogram of Test S ores . . Horizontal Bra es Result (Sour e in Figure 49) . . . . . . . . Title Page Sour e (Result in Figure 72) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . \flushleft in parbox Result (Sour e in Figure 51) . . . . . . . . Examples to Compare Text and Display Modes . . . . . . . . . . . . . . . . . . . . . . . Verti al Diagram Sour e (Result in Figure 60) . . . . . . . . . . . . Horizontal Bra es Sour e (Result in Figure 50) . . . . . . . Graph Result (Sour e in Figure 65) . . . . . . . \flushleft in parbox Sour e (Result in Figure 52) . . . . . . . . . . . . . . . . . . . . . . . eqnarray Environment Sour e (Result in Figure 44) . . . . . . . . Matrix Equation Result (Sour e in Figure 45) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Nested Arrays Sour e (Result in Figure 48) . . . PSTri ks Sour e for Conne ting Nodes . . . . . . . . . . . . . . . . . . \raggedright in parbox Sour e (Result in Figure 54) . . . . . . . . . . . . 49 53 54 55 55 55 59 59 60 60 61 61 62 63 64 64 65 65 72 72 74 75 81 82 82 83 85 93 93 93 95 98 100 100 105 105 106 107 . Variable Sizes Result (Sour e in Figure 38) . . Title Page Result (Sour e in Figure 71) . . . . . . . . . . Spe ifying Dimensions in \in ludegraphi s . . . . . gather* Environment Sour e (Result in Figure 56) . . . . . . . . . . . . . Verti al Diagram Result (Sour e in Figure 59) . . . . . Adding Addresses to Authors .

. . . . . . . Making an Abstra t Result (Sour e in Figure 76) . . . . 107 108 108 109 111 117 117 118 121 . . Array with Fixed Width Column Sour e (Result in Figure 81) Array with Fixed Width Column Result (Sour e in Figure 80) Do ument Margins . Making an Abstra t Sour e (Result in Figure 77) . . . . . . . . .v 75 76 77 78 79 80 81 82 83 Footnotes in the Cover Page Result (Sour e in Figure 74) . . . . . . . Adding makeindex to the Command Sequen e . . . . . . . . . . . . . . . . . . . . Most of the Preamble for this Do ument . . . . . . . . . Some Front Matter Spe i ations for This Do ument . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Commands to Control Do ument Style . . . . . . . . . . . . . . .vi List of Tables 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 Intrinsi Font Styles . . . . . . Some Symbols in Logi . . . . . . . . . . . . Commands/Environments for Text Font Appearan e . . Transpose of a Ve tor . . . . Order Relations . . . . . . . . . . . . . . . . . . . . Parameters for \psaxes . Boxes in PSTri ks . . . The Tabbing Environment . . . . . . . . Commands for Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Notation Using mathbb Fonts from amssymb Pa kage . . . . . . . . . . . . . . . . . . Some Common Mathemati al Fun tions . . . . . . . . . . Margin Parameters . . . . . . . . . . . . . . . Examples of Mathemati al Fun tions . Default Settings for enumerate Counters . . . . . . . . . . . . . . . . . . . . . . . . . . Some A ents for Letters . Numerals to Print Counters . . . . . . . . . . . . . . . . A ents in Math Mode . . . . . . . . . . . . . . . . . . . . . . Conversions of Common Units of Measurement . . . . . . . . . . Commands/Environments for Controlling Text Position Text A ents and Spe ial Symbols . . . . . . . . . . . . . . . . . . . . . Writing Spe ial Chara ters . . . . . . . . . . . . . . . Commands/Environments to Organize Do ument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Referen e Tables . . . . . . . . . . . . . . . . . . . . Some Mathemati al Operations . . 8 24 25 25 25 45 47 49 51 51 52 54 56 57 60 66 66 67 90 91 97 113 116 116 122 122 123 123 123 123 124 124 124 124 125 125 . . . . . . . . . Spa ing Commands in Math Mode . . . . . . . . . . . Set Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Variable Size Mathemati al Operation Symbols . . . . . . . . . . . . . . Some Basi Drawing Commands in PSTri ks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The nmathfont Commands . . . . . Spa ing Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure and Table Lo ation Options . . . . Commands to Control Fonts in Math Mode . . . . . . . . . . The \kill Tabbing Command . . . Greek and Spe ial Letters . . . Intrinsi Name Parameters . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . 125 126 126 126 126 127 127 128 128 128 . . . . . . . . . . . . . . . . . . . . . Relation Symbols . . . . Binary Operations . . . . . . . . . . . . . . . . . . . . . Dots. . . . . . . . . . . . . . . . . . . . Commands and Parameters in Pi ture Environment . . . . . . . . . . .vii 37 38 39 40 41 42 43 44 45 46 Frequently Used Mathemati al Symbols . . Cir les. . . . . . Arrows . . Variable Size Symbols . . . . . . . . . . Operators and Quantiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Spe ial Fun tions . . . . . . . . . . . . . . . . . . . . . Triangles and Lines . . . Spe ial Symbols in Both Text and Math Modes .

using LATEX 2" to produ e high quality results. LATEX (pronoun ed Lah-tek or Lay-tek) is a olle tion of ma ros built on top of TEX that represents a balan e between fun tionality and ease of use [9. and he permanently hanged the way mathemati al do uments are prepared. the ner points require more study. Carlisle. Then. whi h should be just a few lasses. it will take longer. Chris Rowley. This is a typesetting program. For one who is well a quainted with omputers. A omprehensive overage of LATEX and the many enhan ements to it is given by the The LATEX Companion [5℄. designed by Leslie Lamport [9℄. Braams. thesis. You enter some editor that saves plain text les. In any ase. Exer ises are provided for guided instru tion. but he published arti les along the way. this book is designed to be a su in t introdu tion. and one ould do all of the exer ises. not a word pro essor. and Rainer S höpf [2℄.  Harvey J.viii Prefa e The majority of this book is about using LATEX 2" [2. Originally believing that he ould write a program in less than a year that ould typeset do uments. Frank Mittelba h. For one who is just learning how to use a omputer. p. Happy TEXing. espe ially getting used to fun tioning at the ommand line. omitting many of the things LATEX 2" an do. xiii℄. based on TEX. Greenberg . parti ularly unix. LATEX 2" is the urrent version. the basi s that are overed should take less than 10 hours. David P. originated by Donald E. you type text freely until you need something spe ial. It was 10 years later that he published his seminal book [8℄. like Z ai +" p lim "!0+ ai 1 + (x (") )2 dx : It was the desire to have high quality. low ost publi ations in mathemati s and related dis iplines that aused Knuth (pronoun ed Kah-nooth) to invent TEX (pronoun ed Tek) in the late 1970's. My goal is to oer enough of an introdu tion that someone not a quainted with LATEX (or with TEX) an write a term paper. he a tually ended up dening an entire bran h of resear h in omputer s ien e. developed by a team of volunteers: Johannes L. Knuth [8℄. or arti le. Alan Jerey. 10℄. su h as itali font or a omplex mathemati al expression. By ontrast. a des endant of LATEX.

http://www. Anton S hwaighofer. notably William Briggs. Germany (in German). I espe ially thank Kasper B. These all des ribe how to sear h and browse the FTP sites for software and do uments. Holder.tex.uk/ in Cambridge. USA.de/ in Mainz. AT X Software Sour es of L E The basi LATEX software system is available free of harge for unix systems. at three host sites (and many mirrors): 1. I also re eived useful omments from people who read an earlier draft that I made available on the web. The best sour e of these.text. is at the Comprehensive TeX Ar hive Network (CTAN) [4℄. who were very generous with taking time to answer so many questions on a regular basis. UK. Dan Lue king. Axel Rei hert. Herman Bruynin kx.org/ in Boston.tex newsgroup. Mårten Svantesson. Thomas Ruedas. Andrea Dean. David Carlisle. Robin Fairbairns. . http:// tan. who taught me LATEX in the rst pla e.tug. and Matt Swift. but not least. 2.a . Bernd S handl. Graversen whose in-depth review has made this version mu h better than my original. MA. David Haller. and MiKTeX [13℄ is available free of harge for DOS systems. http://www. and additional pa kages that extend the LATEX apabilities (to whi h I refer in this book). and 3. I thank Allen G. Jonathan Fine. Sebastian Rahtz. One student.ix A knowledgements The author thanks the many ontributors in the omp. provided feedba k that led to several points of lari ation. parti ularly Donald Arseneau. Timothy Murphy. Last.dante. Denis Girou.

% This is myfile. alled the LATEX sour e. on entrating on getting started with using LATEX as qui kly as possible. Among these are professional so ieties. whi h you an obtain free of harge.tex. whi h I shall des ribe in greater detail throughout this book.. notably the Ameri an Mathemati al So iety (amsmath style) and the So iety for Industrial and Applied Mathemati s (siam style). ) Body This is the do ument environment. some of the options. there are many options.. depending upon the style. Then. at the ommand line. Anything following % is ignored (used for omments). so for example I refer to myfile. Are you ready to write your rst LATEX do ument? Copy the sour e le shown in Figure 2 and name it myfile. To keep things simple. Later.tex % notes to yourself an go here \do ument lass[options℄{style} 9 = .tex.tex as a plain text sour e le that you reate. enter: latex myfile . The fo us throughout this book is on the arti le style.  optional spe i ations \end{do ument} Preamble (blank lines do not matter)  e. Figure 1: The Stru ture of a LATEX Do ument. Most publishers have their own style. report. and slides. de laring use of pa kages \begin{do ument} . like margin settings and other preamble spe i ations are overed. book. Further. In the preamble. All that follows is ignored ( ould be used for omments). . whi h is plain text. Figure 1 shows the stru ture of this le. its sux is . letter.g.1 1 Overview You will reate a le. I shall be using defaults for almost everything. as well as more advan ed topi s for ustomizing your do ument. the intrinsi do ument styles are: arti le.

. but they were not fatal errors. Underfull \hbox . This is alled debugging your sour e. whi h you enter by running Start !Programs !MS-DOS Prompt. One of three things will have o urred: Case 1. You got no messages. That way you will know that what you did in the last few minutes ontains the error. Underfull \vbox . so you are advised to ompile often... whi h the latex program ( alled a  ompiler) names myfile. su h as missing a bra e ( hara ters { and }. You got a fatal error message. Sometimes the error message tells you what went wrong. Case 2. Many times the message is not very informative. Among the non-fatal messages you will generally see are warnings like: Overfull \hbox . The only one you need to be on erned with now is the dvi le. You got messages. \end{do ument} Figure 2: Your First LATEX Sour e File This is alled ompiling your sour e..1 OVERVIEW 2 (In an MS Windows system.. You must nd and orre t it.dvi.. Something went wrong and you need to ask for help. the ommand line is the DOS ommand line.. Overfull \vbox . Case 3. or some ommand was not re ognized due to being misspelled.. whi h reates several output les. Do not worry about these.) \do ument lass{arti le} \begin{do ument} Hello world.. whi h you will ome to know and love).

In unix do this by entering: p -p myfile. you need to learn how to reate. xdvi. rather than just print. your installation might already have le output as the default.. To view or print a posts ript le under DOS. where the destination is either a: or some ba kup le name.) Next you want to view the result. The same onversion program an be run under DOS (and omes with MiKTeX).tex destination. nothing more need be said. in luding the unix ommand.ps for a variety of reasons. in luding posting it on the web. (If you are familiar with DOS. This is done with the program. If you are in a unix environment. dvips. -2 : : : ). or to a dierent name.g. the rst thing to do is by opying your sour e le to another subdire tory. if not. At the DOS ommand line you enter: YAP myfile You will see various options for viewing and printing. in whi h ase the -o is not needed. At the ommand line enter: dvips myfile -o (The -o tells the system you want the output to go to a le. a free software system by Christian S henk.ps. the viewer that omes with MiKTeX [13℄. .) If you are using DOS.) Change -1 to another qualier ea h time (e.tex myfile-1. edit and save plain text les. Under unix.3 save a ba kup If all went well.ps. so you rst need to onvert the dvi le to posts ript. If you are running under DOS. lpr myfile. You an print it in any number of ways.) This will result in the reation of the posts ript le myfile. xdvi does not have a print option. in whi h ase you must ask someone for help. you an view the result with the dvi viewer. and you might want to obtain myfile. (There is more to do if you are working remotely. so you have a olle tion of ba kups. use opy myfile. is alled YAP. At the ommand line enter: xdvi myfile and it will ome on your s reen.tex (The -p is to keep the date and time of the sour e le.

whi h is a printer measure equal to the width of M in the urrent font).e. other units used in many parts of L TEX are in (in hes). . and em (like the letter m. when saving the le. Summarizing. enter latex myfile. Under unix or DOS use indxdvips to onvert the dvi le to a posts ript (ps) le.tex at the DOS ommand line and see how the le appears. press Enter at the end of a line instead of letting the word pro essor do it for you).1 OVERVIEW 4 you an run a program alled ghostview.tex ompile with latex view/print myfile. you begin by entering a plain text editor.ps Figure 3: Command Sequen e from Sour e to Posts ript Now hange your do ument to spe ify a font size of 12pt (default is 10pt) by hanging your rst line to the following: \do ument lass[12pt℄{arti le} The pt (abbreviation for point) is one of the units of measurement. enter your dvi viewer. You will need to nd out more about viewing and printing posts ript les that suit your parti ular needs. enter EDIT myfile. and if all is well.do as its sux).. In MS Word. Exe ute these ommands for the sour e le shown in Figure 2. m ( entimeters). whi h an be printed. and never use tabs. If you want to he k that the le is really plain text. and you must ontinue to spe ify the sux as .dvi onvert with dvips print/post myfile.Wordpad or MS Word. vi or vim.tex (otherwise. In unix this ould be pi o. On e you have your sour e ready to ompile. These steps are given in Figure 3. however. You should even put in hard return hara ters (i. Congratulations! reate/edit myfile. ema s. The result should be one line of output: Hello World. about 1 A 72 in. you must take absolutely no advantage of its formatting. In DOS you an use EDIT at the ommand line. If you use a word pro essor. it will use . be sure to spe ify plain text. or you an use Notepad.

) The orientation here is by fun tion. like notation. 2 Text We begin by illustrating the most ommon text formatting. (The power of LATEX will be evident when we get to mathemati al expressions. .) First. Note the automati numbering. I also annot elaborate just yet on using pa kages. will demonstrate the superior quality of the LATEX results. and how extra spa es and blank lines have no ee t. beginning with how to write text. (One of the strengths of LATEX is the ommunity of people who provide pa kages for everyone to use at no ost. Figure 4 is the sour e that produ es the result in Figure 5. ex ept to say that they are used to fulll some fun tion. showing how se tions and subse tions are dened. but even some text. It tells you how to dene your own ommands and how to separate them into an input le that simplies hanging things. onsider how to make se tions and subse tions in arti le style. mu h like you would want in a word pro essor.5 This book is designed for qui k entry into using LATEX. espe ially tables. but do not be relu tant to read the last hapter. and I shall introdu e spe i pa kages throughout this book. indi ated in Figure 1.

\begin{do ument} % Begin do ument "environment". and I an put in lots of blanks with no ee t. Skipping four lines is the same as skipping one line  it starts a new paragraph. 1. % Blank lines mean nothing here. \se tion{This is a Se tion} \subse tion{This is a subse tion} This is the body of the subse tion. lots Skipping four lines is the same as skipping one line --.2 TEXT 6 \do ument lass[12pt℄{arti le} % We have defined the do ument to be an arti le using 12 point font. in the preamble. and I an put in of blanks with no effe t. I an move to a new line anytime. \subse tion{Here is another subse tion} \se tion{Here is another se tion} \end{do ument} Figure 4: An Introdu tory Do ument Sour e (Result in Figure 5) 1 1.2 2 Here is another subse tion Here is another se tion Figure 5: An Introdu tory Do ument Result (Sour e in Figure 4) .it starts a new paragraph. I an move to a new line anytime.1 This is a Se tion This is a subse tion This is the body of the subse tion.

\end{ enter} \begin{flushleft} Now we are out of the entering environment. usually free of harge. produ es: This paragraph is not indented. ush left. You will have o asion to use all four paragraph positions.1 Fonts and Paragraphs 7 2. \end{flushright} I am ba k to normal justifi ation. Figure 6: Positioning Paragraphs Sour e (Result in Figure 7) Instead of the enter environment. you an use the \ enterline ommand. \end{environment } \begin{ enter} The text is entered be ause I have entered the enter environment. The added spa e you see between the above paragraphs is due to entering those environments.. Here is an example: \noindent This paragraph is not indented. . Note that these are environments. The general form of an environment uses the following syntax: \begin{environment } . a on ept you need to understand about LATEX. and have begun the flushleft environment. ush right.1 Fonts and Paragraphs Figure 6 shows the sour e to produ e dierent paragraph positions: entered. Table 1 lists the fonts that are intrinsi in a basi latex installation. You an also suppress indentation of the rst line of a paragraph with the \noindent ommand. Text remains entered as long as we remain in this environment.2. \end{flushleft} \begin{flushright} This is another paragraph. you will have parti ular use for the itali font.) In te hni al writing. and justied (the default). shown in Figures 8 and 9. (More fonts are available in pa kages. they dier in that the environment skips a line before and after the paragraph. as it is used when introdu ing . but in the flushright environment.

small aps. and have begun the ushleft environment. This is another paragraph. This is \textit{itali }. typewriter. You will have o asion to use all four paragraph positions. The added spa e you see between the above paragraphs is due to entering those environments. What you write This is \textbf{boldfa e}. slanted. but in the ushright environment. itali . whi h produ es the ellipsis. . roman. sans serif. Now we are out of the entering environment. This is \textrm{roman}. This is \texttt{typewriter}. A \textit{group} is defined on a set of elements \dots )A group is dened on a set of elements : : : (The )symbol an be read as produ es.2 TEXT 8 The text is entered be ause I have entered the enter environment. Text remains entered as long as we remain in this environment.) Note the use of the \dots ommand. Figure 7: Positioning Paragraphs Result (Sour e in Figure 6) a new term. This is \textsf{sans serif}. This is \textsl{slanted}. I am ba k to normal justi ation. ) ) ) ) ) ) ) How This This This This This This This Table 1: Intrinsi Font Styles it is is is is is is is appears boldfa e. For example. This is \texts {small aps}.

where font is one of {bf. This line is entered. These size variations an be ombined with font styles. it. In parti ular. This ontinues after entering.1 Fonts and Paragraphs 9 This pre edes enter environment. Figure 9: Centering Result (Sour e in Figure 8) Some ombinations of font styles an be produ ed. Figure 8: Centering Sour e (Result in Figure 9) This pre edes enter environment. sl. This ontinues after entering. su h as using {\Large\textbf{heading}} for some heading. s .} This ontinues after entering. This pre edes enterline. This pre edes enterline. The argument of \textbf is \textit{bolditali }. For example. rm. tt}. Not all ombinations are in the basi LATEX 2" installation. sf. \begin{ enter} This line is entered. \end{ enter} This ontinues after entering. as seen in Table 1. The general form is ntextfont {text }.2. \textbf{\textit{bolditali }} ) bolditali . Font size an also be varied at will. . you must put \usepa kage[T1℄{fonten } in your preamble to obtain: \textbf{\texts {bold small aps}} ) bold small aps. This line is entered. Figures 10 and 11 give the sour e and result for ommon variations. Noti e how the paragraph spa ing hanges to a ommodate the variation in font size. \ enterline{This line is entered.

p. (More on framing in Ÿ6. You an make it really {\tiny tiny}. We an also frame text just by writing \frame{text }. For example. notably by Dedekind uts. tiny Figure 11: Some Font Sizes Result (Sour e in Figure 10) The use of bra es to en lose a font size spe i ation is like an environment. We an give frame some room around the edges by using \fbox instead. but learning it must wait until we enter math mode. was motivated by the need to x al ulus. or a sequen e of one line quotes.) It is straightforward to underline text  just write \underline{text }. You an make it really . The quote environment is intended for short quotes. generally one short paragraph (as above).\end{large} produ es the same result as {\large This is large. The environment syntax is useful when you want to keep the size for a large blo k of text.2 TEXT 10 You an make the text {\large large} or {\Large larger} or even {\LARGE larger still}. Now onsider ways to indent a blo k of text. You might want to make something {\small small} or {\footnotesize smaller} or even {\s riptsize smaller still}.) To overline is as straightforward. separated by blank . Here is an example using the quote environment. (There is no intrinsi environment for font styles. You an also make it {\huge huge}. huge You an also make it . You might want to make something small or smaller or even smaller still. whi h was generated by putting \begin{quote} before the text and \end{quote} after it: The onstru tion of the real number system. \begin{large} This is large. Optionally. whi h ran into trouble due to insu ient rigor in dealing with limits. 81. and the bra es format is useful for short phrases.}. we an expli itly use the environment syntax: \begin{size } : : : \end{size }. Figure 10: Some Font Sizes Sour e (Result in Figure 11) You an make the text large or larger or even larger still.

the longer the dash. ex ept the rst line of ea h new paragraph is indented.. Sometimes it is important to make a ompletely `unbiased' de ision. Knuth The quotes are by two pioneers of algorithms. to reate this more stylisti quotation pun tuation. The more minus signs you use.1 Fonts and Paragraphs 11 lines. The indentation is the same as the quote. su h as page numbers. this ability is o asionally useful in omputer algorithms. this an be overridden by the \noindent ommand. I used `` ''. . not " ".) Here is an example that was reated by putting \begin{quotation} before the text and \end{quotation} after it. to make the line ush right. It is also rumored that some ollege professors prepare their grades on su h a basis. The dash that appears before ea h name is reated by three minus signs. and three are for pun tuation  i. by skipping a line and entering \hfill (whi h means horizontal ll). There is extra spa e between the two quotations.  Alan M. Here are some other things to noti e about this example:    There are left and right quotation marks. Turing and Donald E. The quotation environment is used for long quotations. use --pre eding i. having more than one paragraph (separated by blank lines). Computers do not dream. Their names appear on the right.  Donald E. any more than they play. Alan M. (Just as in the regular text. ---. after their quote. Turing There are reports that many exe utives make their de isions by ipping a oin or by throwing darts. for example in situations where a xed de ision made ea h time would ause the algorithm to run more slowly. The onvention is that one dash is for hyphenation.2. but we know what they indi ate: a great deal of information pro essing goes on far beneath the surfa e of man's purposive behavior.e. We are far from ertain what dreams are good for. Knuth.e. This was done with the \bigskip ommand. et . in ways and for reasons that are only very indire tly ree ted in his overt a tivity. two are for ranges.

The spa e you see is the big skip. And what is worse. Figure 13: Skipping Line Spa es Result (Sour e in Figure 12) The verse environment indents oppositely: lines after the rst. Later. \bigskip The spa e you see is a big skip. The spa e you now see is a small skip.2 TEXT 12 Figures 12 and 13 illustrate three levels of skipping: small. medium and big. The spa e you now see is a medium skip. The following was generated by putting \begin{verse} before the text and \end{verse} after it: Negle t of mathemati s works injury to all knowledge. This is just an ordinary line spa e. \medskip The spa e you now see is a medium skip. Figure 12: Skipping Line Spa es Sour e (Result in Figure 13) This is a rst line. sin e he who is ignorant of it annot know the other s ien es or the things of this world.  Roger Ba on . This is a first line. we shall look at a way to have a mu h ner range of verti al spa ing. \smallskip The spa e you now see is a small skip. This is just an ordinary line spa e. men who are thus ignorant are unable to per eive their own ignoran e and so do not seek a remedy.

2 Lists There are three intrinsi list environments. and list items are enough to prepare a basi do ument without mathemati s or tables (like a resume). (Designed for poetry. This has progressed a great deal in the past few years thanks to many people who have provided pa kages free of harge. Mathemati s. here is the use of a des ription list environment to itemize steps involved in learning LATEX. Bibliography. Other. Basi Do ument Preparation.. by en losing Ba on's verse with \textit{ : : : }. in parti ular with BibTE X. report or arti le. this form of indentation makes it lear. This is a power of LATEX and one reason why it has be ome standard in writing mathemati al papers. I will show you how to do virtually any mathemati al expression in line with the text. distinguished by what appears at the beginning of ea h item: number. and if a stanza runs long. again from the \hfill ommand. Making Tables..2 Lists 13 The itali s were spe ied in the usual way. vary fonts. or your des ription (perhaps nothing).2. and its versatility puts it far ahead of word pro essors. Knowing how to reate a bibliography. or in math display mode. } \hfill --. rather than a new line. Graphi s. Knowing how to setup the latex sour e le. There are a great many things to learn beyond the simple introdu tion when using LATEX to prepare a thesis. but this time it is on the last line of the verse. make paragraphs.) Ba on's name appears ush right. bullet. This is a hieved simply by not skipping a line after the verse: \begin{verse} \textit{Negle t of mathemati s .Roger Ba on \end{verse} 2. ea h line is a stanza in the verse. To illustrate. LATEX provides a means to make tables with the tabular environment. whose sour e is indi ated by Figure 14. .

and one might want a pun tuation mark.℄ This is the power of \LaTeX~ and one .} \end{des ription} produ es the following result: This is how one item in a des ription list environment looks with no optional text at the beginning. Unlike the verse environment.. and the lines extend all the way to the right margin... whi h requires no spa e. following \LaTeX. .℄ This has progressed a great deal in the ..℄ There are a great many things to learn . like a omma. even with a spa e after \LaTeX in the sour e.. For example..) The text within the square bra kets is an option. the result would be L TEXprovides.℄ Knowing how to setup .℄ Knowing how to reate a bibliography .. With no option. whi h prints bullets.. If present. \item [Bibliography.. as in this example. \item [Making Tables. \item [Other. You see the nesting of two itemize lists. the rst line goes almost to the left margin. and the use of ~ ( alled tilde) to enter a spa e. it is printed in boldfa e. (The reason is that a spa e is needed anyway after \LaTeX (or any keyword) in order to distinguish it ompletely. \end{des ription} Figure 14: Des ription List Environment Two new things appear in the example: the use of \LaTeX to produ e LATEX. \begin{des ription} \item \textsf{This is how one item in a des ription list environment looks with no optional text at the beginning. Next. the des ription list is one way to have text indented the opposite of a normal paragraph: the rst line is at the left and subsequent lines are indented. Figures 15 and 16 illustrate the itemize list environment.. Note the indentation of ea h item and the spa ing between items. \item [Mathemati s. \item [Graphi s. but any type of list an be nested within any other type.2 TEXT 14 \begin{des ription} \item [Basi Do ument Preparation.. Without the A tilde..℄ \LaTeX~ provides a means .

\begin{itemize} \item A se ond (nested) itemized list hanges the bullet and indents another level. With nested enumeration. .2.  A se ond (nested) itemized list hanges the bullet and indents another level. the numbering hanges at ea h level. \end{itemize} \end{itemize} Figure 15: Itemize List Environment Sour e (Result in Figure 16)   This is item 1 and our task has just begun. where the default numbering is with Arabi numerals. I des ribe the enumerate list environment. Blank lines before an item have no ee t. Figures 17 and 18 illustrate with three levels of nesting. This is item 2 and we shall limit to just this few. Blank lines before an item have no effe t. A blank line within an item does reate a new paragraph. Figure 16: Itemize List Environment Result (Sour e in Figure 15) Finally. A blank line within an item does reate a new paragraph. \item This is item 2 and we shall limit to just this few. using the indentation of the itemize environment. using the indentation of the itemize environment.2 Lists 15 \begin{itemize} \item This is item 1 and our task has just begun.

\begin{enumerate} \item Ba k to item 1. ea h row ends with two ba kslashes. abbreviated by just one hara ter: . and it's time to number anew. \begin{enumerate} \item One again! \item Two (b) or knot 2b? \end{enumerate} \end{enumerate} \end{enumerate} Figure 17: Enumerate List Environment Sour e (Result in Figure 18) 1. \item This is item 2. \\. but we are not yet done. (a) Ba k to item 1. and we are having fun. This is item 2. Ea h olumn spe i ation an be left. 2. Two (b) or knot 2b? Figure 18: Enumerate List Environment Result (Sour e in Figure 17) 2. One again! ii.3 Making Tables A table is made with the tabular environment. and we are having fun.. i. \item Two is new. This is item 1.2 TEXT 16 \begin{enumerate} \item This is item 1. whi h has the following syntax: \begin{tabular}{ olumn spe s } options rst row spe \\ . last row spe [\\ options ℄ \end{tabular} As indi ated. but we are not yet done. . (b) Two is new. and it's time to number anew. enter or right.

The way to vary verti al line drawing is with the olumn spe i ations: put | only where you want a verti al line.3 Making Tables 17 l. In the body of the table. How it appears left enter 1 2 What you write \begin{tabular}{l r} left & enter & right \\ 1 & 2 & 3 \end{tabular} right 3 Figure 19: A 2  3 Table We an draw a horizontal line before any new row by spe ifying \hline.2. To draw a line after the last row. Figure 19 shows an example of a 2  3 table.12 -130 210 220. How it appears What you write -110 -120. How it appears Name Test 1 Bob 67 Sue 72 What you write Test 2 72 67 \begin{tabular}{l| |} Name & Test 1 & Test 2 \\ \ line{1-1} Bob & 67 & 72 \\ Sue & 72 & 67 \\ \ line{2-3} \end{tabular} Figure 21: A Table with Partially Spanning Horizontal and Verti al Lines . 230 Figure 20: A \begin{tabular}{|l| |r|} \hline -110 & 120 & -130 \\ \hline 210 & -220 & 230 \\ \hline \end{tabular} 2  3 Table with Horizontal and Verti al Lines We ould draw lines that span some rows and/or olumns. Figure 20 illustrates a ombined use of these options. enter \\ \hline (the \\ is simply part of the syntax and does not add an extra row to the table). respe tively. This is illustrated in Figure 21. ea h olumn is separated by &. or r. The olumn spe i ations an have | on either side to indi ate a verti al line. The way to vary horizontal line drawing is by using \ line{rst ol -last ol } instead of \hline.

3 in hes is spe ied. In this example . Here are some things to note:   The entire table uses sans serif font style. \textsf{ \begin{tabular}{lp{. and upper ase is in small aps.3in}l} \\ \underline{Table 1} && Table 2 \\ \ line{3-3} \\ \begin{tabular}{|l |} \hline Obje t & Symbols used \\ \hline variable & lower ase \textrm{Roman} \\ parameter & \textit{Greek} \\ onstant & \texts {upper ase} \textrm{Roman} \\ \end{tabular} && % Begin Table 2 \begin{tabular}{|r |} \hline * & 1 & 2 \\ \ line{2-2} & 3 & 4 \\ \ line{1-1}\ line{3-3} \end{tabular} \end{tabular} } % end sf Figure 22: Nested Tables Sour e (Result in Figure 23) . Note that this ounts as a olumn. spe ied by \texts {upper ase}. headed by Table 2. so you see && to separate the two tables. where any unit of measure an be used as the length of the spa ing. Greek is in itali . whi h is olumn 1 of the main table. Figures 22 and 23 illustrate this.2 TEXT 18 We an have tables nested within tables. spe ied by \textrm{Roman}. while showing more variation with lines and using various fonts. whereas \ line{3-3} is used to underline all of olumn 3 of the main table. This is done by spe ifying \textsf{ before entering the tabular environment (and losing with } just after it). fonts are varied: Roman is in the Roman font. Within the tables. spe ied by \textit{Greek}.  A new olumn spe i ation is introdu ed: p{length }. ea h being a olumn of the main table.  The \underline ommand is used to underline Table 1.

one an assign a xed width to a olumn by spe ifying p{length }. . \\ \hline \end{tabular} The result will be to run o the edge of the paper: This amount of text is too long to t on one line of the page. for example.2. One solution is to insert new rows and break up the text manually: \begin{tabular}{|l|l|} \hline This amount of text is too long to fit on one & This is olumn 2. & This is olumn 2. we write the following: \begin{tabular}{|l|l|} \hline This amount of text is too long to fit on one line of the page. \\ line of the page. Instead. Suppose.3 Making Tables 19 Table 1 Obje t variable parameter onstant Table 2 Symbols used lower ase Roman Greek upper ase Roman * 1 2 3 4 Figure 23: Nested Tables Result (Sour e in Figure 22) There are times when we want to put a good bit of text into some olumns of a table. For example. & \\ \hline \end{tabular} ) This amount of text is too long to t on one This is olumn 2. line of the page. This is olumn 2.

They dier only in the pla ement of the paragraph box. . Figures 24 and 25 illustrate this.2 TEXT 20 \begin{tabular}{|p{2in}|l|} \hline This amount of text is too long to fit on one line of the page. the spa ing an be ome unsightly due to being justied. long to t on one line of the page. Another is solution is to use the \parbox ommand (short for paragraph box).} & This is olumn 2. the latter being at the top to align it with olumn 2 in the manner shown.} & This is olumn 2. \\ \hline \end{tabular} ) This amount of text is too This is olumn 2. This has the form \parbox[option ℄{width }{text }. \\ \hline \end{tabular} ) This amount of text is too long to t on one line of the This is olumn 2. page. This is over ome with the ushleft environment. & This is olumn 2. long to t on one line of the page. where the option is the pla ement: t = top and b = bottom (default is enter). \\ \hline \end{tabular} ) This amount of text is too This is olumn 2. Here are two examples: \begin{tabular}{|l|l|} \hline \parbox{2in}{This amount of text is too long to fit on one line of the page. When making a olumn or parbox small. \begin{tabular}{|l|l|} \hline \parbox[t℄{2in}{This amount of text is too long to fit on one line of the page. and note that it ontains other ommands that an be in any paragraph.

}}\medskip This is not the same as \medskip\fbox{\ enterline{How sweet it is. . whi h I have put in sans serif font. The se ond argument is any valid olumn spe i ation.}} \end{flushleft} } & \parbox[t℄{1in}{\begin{flushleft}\textsf{This is olumn 2. The rst argument is the number of olumns to span (starting where \multi olumn is spe ied).3 Making Tables 21 \begin{ enter} \begin{tabular}{ll} \parbox[t℄{3in}{\begin{flushleft} This is olumn 1. |. on either .3\linewidth}. How sweet it is. whi h I have put in sans serif font. and I might want to display something: How sweet it is. If we want some heading to span several olumns. with. \multi olumn{number }{ ol spe }{entry }. This is not the same as This is olumn 2.. an be determined by some length parameter.. For example. see exer ise 9 at the end of this hapter and onsider \parbox{. r. or without.2. su h as l.} \end{flushleft} } \end{tabular} \end{ enter} Figure 24: \parbox Sour e (Result in Figure 25) This is olumn 1. a verti al line spe i ation. Figure 25: \parbox Result (Sour e in Figure 24) Any measurement. and I might want to display something: \medskip\ enterline{\fbox{How sweet it is. rather than a xed onstant. this is done by the ommand. This must be in the range 1 to however many olumns remain from the urrent position. su h as the width of a paragraph box.

(You obtain the pa kage from CTAN [4℄. . \begin{ enter} \begin{tabular}{l| | } & \multi olumn{2}{| |}{Test number} \\ \multi olumn{1}{ |}{Student} & 1 & 2 & Average \\ \hline Bill & 67 & 72 & 70.5 Figure 27: Multi olumn Result (Sour e in Figure 26) Tables that are too long to t on one page ould be broken manually. but the longtable pa kage enables automati page breaks by the LATEX ompiler. the verti al line at the end is missing be ause was spe ied instead of |. spe ify the longtable environment. The line in the sour e begins with & to skip olumn 1. The rst is used to enter `Test number' over olumns 2 and 3. Suppose. The se ond use simply enters the `Student' header. for example. Figures 26 and 27 illustrate these uses of \multi olumn.5 \\ Charleetah & 72 & 67 & 70.5 70. The last use of \multi olumn enters `Taken in lass' over olumns 2 and 3. whi h has most of the same options. Unlike the rst use. spe ify \usepa kage{longtable}. entered with verti al lines before and after. Then. we want the olumns to be left justied. Finally. but we want the headers to be entered.5 \\ \hline & \multi olumn{2}{ }{Taken in lass} \\ \ line{2-3} \end{tabular} \end{ enter} Figure 26: Multi olumn Sour e (Result in Figure 27) Test number Student 1 2 Bill 67 72 Charleetah 72 67 Taken in lass Average 70. then the \multi olumn spe ies 2 olumns. the third argument is the text. instead of the tabular environment.) In the preamble.2 TEXT 22 side. The \multi olumn ommand an also serve to override some olumn spe i ation.

[ ℄. For example. it appears with whatever font is a tive. like \textba kslash. whi h is printed in typewriter font style. is needed.) When using a keyword to spe ify a spe ial hara ter.4 Spe ial Chara ters We have already seen that some hara ters are spe ial. The verbatim environment uses the usual syntax: . \end{des ription} Figure 28: Obtaining Bra kets in a Des ription List Environment Another way to print the unprintable is with the verbatim environment or the \verb ommand. written as \{ \} to obtain { }.4 Spe ial Chara ters 23 2. illustrated in Figure 28. Other times a keyword. like \%. \verb does not use bra es to delimit its argument. In parti ular. in that they delimit something. and % ends a line. (Another is in the tabular environment (page 16). are dierent be ause they an be entered dire tly. It uses any other hara ter to delimit a string. The Appendix ontains omplete tables of these (in luding those I do not over in the hapters). like {\large : : : }. \begin{des ription} \item {[This is not option℄} for item. ex ept when they are used to delimit an option in the syntax. The bra kets. \begin{des ription} \item [This is option℄ for item. we an write \verb{}%$#\ to generate the string {}%$#\ (delimited by ). Of parti ular importan e are the bra es. How do we print su h hara ters? One way is with the symbol. whi h an ontain any hara ter ex ept itself. Table 2 illustrates this with ommonly used spe ial hara ters.2. \end{des ription} [This is not option℄ for item.) How it appears What you write This is option for item. One example is the des ription list environment. \ delimits every LATEX ommand. enabling omments. Unlike all other ommands. (Re all that the bra es by themselves reate a lo al environment. itself. in whi h ase they an be obtained by en losing them in bra es. but I omitted a dis ussion of position options that are spe ied by bra kets.

these are not su ient.. and \> to move to a tab setting. \\ ends ea h row.2 TEXT 24 Other fonts Chara ter (Roman) How you write it itali {} \{ \} {} %$#&_ \ ^ ~ r %$#&_ \ \textba kslash \textas ii ir um ^ \textas iitilde ~ \% \$ \# \& \_ \textregistered r {[ ℄} [℄ [℄ large {} %$#&_ \ ^ ~ r [℄ Table 2: Writing Spe ial Chara ters \begin{verbatim} .. \end{verbatim} This is how the sour e ode was reated for the gures.5 Tabbing The tabbing environment provides an alternative to the tabular environment by letting you set your own olumn tabs. write Poin ar\'{e} to have Poin aré and G\"{o}del to have Gödel. For example. 22). In some ases. but unlike the tabular . Table 3 shows some ommon examples. 2. An a ent ould be applied to any letter. whi h are shown in Appendix Table 29  e. Table 4 shows a simple ase with two basi tabbing ommands. \= to dene a tab setting. In addition. ?`)¾ and \aa)å. For that purpose there are some pa kages (available free of harge). Chapter 9℄).g.  language  for example. Another lass of spe ial hara ters are letters with a ents. parti ularly if the entire do ument is to be in a non-English language. . even if it does not relate to some  d. a omplete table is in the Appendix. \"{b}\~{ }\^{d} ) b LATEX has a basi library of a ents and spe ial hara ters for writing in languages other than English. su h as Babel [1℄ (also see [5. like Figure 26 (p.

making `4-6-8' extend past the tab.2. the rst senten e ontinues normally. but the tab is set by the shorter string `1-3'. then spe ies \kill instead of \\ to suppress (or kill) the printing of the line. What you see What you write 1-3 sting like a bee 4-6-8don't be late \begin{tabbing} 1-3 \= sting like a bee \\ 4-6-8 \> don't be late \\ \end{tabbing} 1-3 sting like a bee 4-6-8 don't be late \begin{tabbing} 4-6-8 \= don't be late \kill 1-3 \> sting like a bee \\ 4-6-8 \> don't be late \\ \end{tabbing} Table 5: The \kill Tabbing Command . In the rst tabbing. The se ond tabbing puts the longer eld rst. What you see Begin: set tab 1 skip to 1 What you write : : : set tab 2 then to 2 skip to 2 \begin{tabbing} Begin: \=set tab 1\dots \=set tab 2\\ \>skip to 1 \>then to 2\\ \> \>skip to 2 \end{tabbing} Table 4: The Tabbing Environment Sometimes we do not want to have the longest portion of text rst. the lines are in the order we want. without extra spa es. yet it is needed to dene the tab.5 Tabbing 25 What you write \"{a} \`{e} \'{i} \~{o} \^{u} ) ) ) ) ) What you see ä è í õ û Table 3: Some A ents for Letters environment. Table 5 illustrates how this is solved with the \kill ommand. so that the position of the tab is not equivalent to that of a table's olumn. in order to set the tab orre tly.

like the following: \textsf{This example is \linebreak extreme.} )Here is the extreme example. even if it means extending into the right margin. \begin{tabbing} \= \hspa e*{. then it uses the name of the last eld to set what follows.5in} \= \hspa e*{2in} \= Last field: \= \kill \> Field 1 (following tab 1) \\ \> \> Field 2 on new line \> Last field \\ \> \> \> Last field on new line \end{tabbing} Figure 29: Tabbing Sour e (Result in Figure 30) Field 1 (following tab 1) Field 2 on new line Last eld Last eld on new line Figure 30: Tabbing Result (Sour e in Figure 29) 2. preventing a line break. 10'.} )This example extreme. To prevent a line . is The \newline ommand for es a new line without justifying it. \textsf{Here is the extreme \newline example. It rst uses the \hspa e* ommand for horizontal spa ing. this ould result in an undesirable appearan e. it is better style to keep ertain `words' together. When text is justied (the default). su h as `gure 1' or `p.2 TEXT 26 Figures 29 and 30 illustrate the tabbing environment with xed eld widths.6 Line and Page Breaks You an ause a new line by entering \linebreak. Also. The \nolinebreak ommand works analogously.

7 Spa ing 27 break where you want a blank. The \hspa e ommand has no ee t at a line boundary. . These have one argument: the amount of spa e to be inserted. . . . but the \verb|\hspa e*| \hspa e*{1in} inserts the spa e no matter what. . . . . . \hspa e would not insert the 1 in h. For example. . For example. . . Two variations of \hfill are: \dotfill . I insert . \vspa e* and \vfill. . The \newpage ommand follows the analogy with \newline in for ing a page break pre isely at the point it is spe ied. The height of one line of normal text is in the keyword \baselineskip .~10. {\samepage line 1 \nopagebreak } line 2 2. . . . . .3in} here. . . . . .3 in here. . The most versatile method to insert horizontal spa es is with \hspa e and \hspa e*. There are two ommands to for e a page break: \pagebreak and \newpage. . . . . . the previous senten e is written as: The \verb|\hspa e| ommand has no effe t at a line boundary. . Here is an example that keeps line 1 on the same page as line 2. That is why you see the 1 in h spa e at the beginning of the se ond line.7 Spa ing We have already seen the use of ~ to insert one spa e and \hfill to put the remaining text ush right. . . . .2. use the spa e hara ter ~. We would thus write figure~1 or p. . . The \samepage ommand prevents a page break within its s ope. . . . . verti al spa ing is ontrolled by \vspa e. ) I insert . but \hspa e* does. . . . . . . rather than ompleting the line as \pagebreak does. . The \nopagebreak ommand disallows a page break immediately following the next blank line.3~in \hspa e{. . . . . . . . . . . \hrulefill Analogously. but the \hspa e* inserts the spa e no matter what. . . . .

The title appears rst in very large letters. (b) Ea h font style in Table 1 is used for one omplete word. In parti ular. Be sure your name is on ea h. (d) There is added spa e between paragraphs. ( ) Both paragraphs are indented. Write a paragraph in arti le [and letter℄ style with the following properties: (a) Ea h font style in Table 1 is used as one letter in a word that has more than one letter. 1. The verti al spa e is not added if this goes to the top of a new page. This gives you three ommands: \singlespa ing \onehalfspa ing \doublespa ing Right after you spe ify one of these. The easiest way to ontrol line spa ing throughout your do ument is to spe ify usepa kage{setspa e} in your preamble. Exer ises. if you want to make your own title page. you use \vspa e*{2in} to put a 2 in h margin at the top (\vspa e would not insert the spa e). Write a paragraph in arti le style and make a over page with the following properties (like the over page of this do ument):   All lines are entered. Submit a printed opy of both the LATEX sour e (tex le) and the asso iated posts ript result (ps le). that is what \vspa e* does. 2. (b) No paragraph is indented. at the very beginning of your do ument. Write two paragraphs in arti le [and letter℄ style with ea h of the following properties: (a) Default indentation on both paragraphs. ( ) Ea h font style in Table 1 is used for two onse utive omplete words. 3. .2 TEXT 28 so vspa e{\baselineskip} skips one line at the next new line. that spa ing will ommen e.

Produ e the following table: Colors Primary Se ondary Red Green Blue Orange Yellow Purple 6. Produ e the following table. and it is pre eded by extra spa e. 4. with extra spa e pre eding it. 5. Birth Death Mathemati ian Gabrielle Emilie Le Tonnelier de Breteuil Marquise du Châtelet 1706 1749 Benjamin Banneker 1731 1806 Sophie Germain 1776 1831 Julius König 1849 1913 Rózsa Péter 1905 1977 7. with extra spa e pre eding it. Your web address appears fourth. Player A 1 2 4 5 3 6 Payos ($) Player B 1 3 5 2 4 6 . Your e-mail address appears third.7 Spa ing      29 Your name appears se ond in letters that are not as large as the title. Produ e the following table (in luding the a ents and alignments). Give an enumeration of at least three things you like about mathemati s. Date appears last.2. but larger than normal size. Give the same list without numbers. Course number and title appears next.

It reads a plain text le. from whi h a se ond latex ompilation auses the bibliography to be reated. The exe ution looks like this (same under unix and DOS): E E . 10. Create a 3- olumn text su h that ea h olumn is a paragraph of arbitrary length using about 13 of the page width ea h. alled a bib le (plus one of the les reated by the latex ompiler. So here we are. 12.3 BIBLIOGRAPHY WITH 30 BIBTEX 8. whi h ould extend beyond one do ument. That is be ause I require students to produ e an annotated bibliography early in the semester. BibT X [11℄ was developed by Oren Ptashnik and is available free of harge. and I want them to use BibT X. The bibtex program that you apply to your sour e reates another le (whi h you need not examine). about whi h you need not be on erned). The bib le ontains the bibliographi database. instead of with Ÿ7. BibTEX 3.4. Use the tabbing environment to produ e what you see on page 33. How an you have an entire table whose olumns are of xed width? 9.1 Overview It might seem strange to have this se tion so early. Use the tabbing environment to produ e the following: apples integral derivative grapefruit sum dieren e variables onstants 11. Produ e the following: rate of mass net rate of mass a umulation entering the = in the ompartment by ompartment onve tion 3 Bibliography with net rate of + mass entering by diusion.

3.2 The bib File

31

latex myfile
bibtex myfile
latex myfile
You might have to ompile with latex more times, until you do not have
any unresolved bibliography itations. On e this is su essful, you do not
have to bibtex myfile again until you hange your bib le or add a itation.
This added loop is illustrated in Figure 31.

reate/edit

myfile.tex

ompile
with
latex

view/print

myfile.dvi

onvert
with
dvips

print/post

myfile.ps

bibtex
Figure 31: Adding bibtex to the Command Sequen e

3.2 The bib File
3.2.1

Main body

For purpose of this introdu tion, suppose your bibliography is in a le alled
mybiblio.bib, but that name is arbitrary as long as it ends with .bib. We
begin with the most important part of your bib le, whi h are the entries
you want to in lude in its database. Ea h entry has the following form: 

type {label , 
eld = "value ",
..
.

}

For example, Knuth's book [8℄ would be entered as follows:

3 BIBLIOGRAPHY WITH

32

BIBTEX 

arti le{tex,
author = "Donald E. Knuth",
title
= "The {\TeX} Book",
publisher = "Addison-Wesley Publishing Company",
address = "Reading, MA",
year
= "1989",
edition = "15th",
}
Most authors develop a style to labelling bibliographi entries. The use
of one keyword is somewhat simplisti and ould ause problems with a
great number of entries be ause the labels must be unique. We annot, for
example, have two entries with tex as their label. Here are two styles I have
seen, whi h you might onsider:
Form

author .year
author :rst_keyword_in_title

Example
knuth.89
knuth:tex

With two authors, you an put both of their names; with more than 2,
you an add et al. (Linguisti ally, the use of the Latin et al. in formal writing
follows this rule.) In the rst form, if there are two publi ations by the same
authors in the same year, some people add a, b, : : : after the year (no blank).
In the se ond form, if there are two publi ations by the same authors in the
same year, some people add another keyword. You must dis over what style
works best for you.
Before listing ea h style (arti le is one style) and the elds they an or
must have (author is one eld), here are a few things to note.  

The label is arbitrary, but do not use any LATEX spe ial hara ters or
blanks. In the example, the label is spe ied as tex and it must be
followed by a omma. Also, labels are ase-sensitive, so tex is not the
same as TeX.
Ea h bib entry must have a unique label, so it an be ited without
ambiguity in the sour e le.

3.2 The bib File  

33

The order of the elds is arbitrary, and elds are separated by ommas
(hen e the omma after the terminal quote). The last eld does not
require a omma at the end, but it will not hurt anything, and it gives 
exibility if you want to add a eld or hange the order.
Fields do not have to be on separate lines, but it is more readable that
way. 

The eld value an be anything re ognized by LATEX, even mathemati al symbols in math mode. 

There is a nal } to lose the entry  type {

: : : }.

Remember to put ea h author's name as rst last or last, rst. If you put
Knuth Donald, the ompiler will think the rst name is Knuth and the last
name is Donald.
Here is a list of standard entry types with their required elds. What are 
optional elds in BibT X are not ne essarily optional as far as having a
omplete bibliography itation. For example, the volume and page numbers
of an arti le are ne essary to in lude even though they are optional to satisfy BibT X syntax. (What is ne essary depends upon the standard one
applies, but most journals require the volume of the journal and the page
numbers for the ited arti le.) Fields that are neither required nor optional
are ignored, even if they are valid elds in other types of entries.

E

E

arti le refers to an arti le from a journal or magazine.
Required elds: author, title, journal, year.
Optional elds: volume, number, pages, month.
book refers to a book with an expli it publisher.
Required elds: author or editor, title, publisher, year.
Optional elds: volume or number, series, address, edition, month.
booklet refers to a bound, printed do ument, but without an expli it
publisher.
Required elds: author or key, title.
Optional elds: author, howpublished, address, month, year.
inbook is a part of a book, su h as a hapter or just some range of pages.
Required elds: author or editor, title, hapter and/or pages,
publisher, year.
Optional elds: volume or number, series, type, address, edition,

title. volume or number. note. To have a omment that is not printed. in olle tion is a part of a book having its own title. but not formally published. mastersthesis is a Master's thesis. year. publisher. address. howpublished. booktitle. Required elds: author or key (see note below). institution. organization. Required elds: author. Required elds: author or key (see note below). organization. Required elds: author.34 3 BIBLIOGRAPHY WITH BIBTEX month. title. title. year. Optional elds: author. pro eedings Required elds: title. volume or number. title. In addition to the optional elds listed. edition. the note eld is always an option. even as a te hni al report. address. Optional elds: type. address. year. s hool. s hool. Required elds: author. phdthesis is a PhD thesis. title. pages. year. month. Required elds: author. Optional elds: month. (Some note of explanation is required. Optional elds: editor. unpublished is a do ument with an author and title. Optional elds: type. manual is some te hni al do umentation. series. inpro eedings is an arti le in a onferen e pro eedings. month. address. Optional elds: editor. publisher. title. number. year. Required elds: author. year. te hreport is a report published by some institution. year. organization. pages. enter an . year. month. title. hapter series. Optional elds: editor. month. publisher. month. Optional elds: type. series. type. month. month. year. address. address. volume or number.) Required elds: author. mis is when nothing else ts. address. Optional elds: author. month. edition. This lets you enter a note that will appear at the end of the itation. booktitle. whi h vary by the type of entry. title.

For example. LaTeX2e. For example. This applies to a ents too.". Possibly there will be some standard xup. Otherwise. onsider the following entry for LATEX 2" [10℄. or simply G{\"o}del. but this will not work in BibT X. the bibtex program might try to pro ess it itself and produ e an unintended result. whi h has no person as an author. institution = "Comprehensive {\TeX} Ar hive". but it is best if you provide the missing eld value. we separate them with and (no ommas)..3. If a required eld is missing when you ompile. [5℄ in this do ument has the following BibT X entry: E Book{ ompanion. In ordinary LATEX. you must provide a key for sorting. title = "{\LaTeXe} for authors". The key will not be printed.ps} (see~\ ite{CTAN} for repla ing CTAN)}". we write G{\"{o}}del.2 The bib File 35 unre ognized eld. (this is ignored with no error message given). year = "1994". MA". manual{usrguide. } When there are multiple authors. address = "{CTAN\url{/ma ros/latex/do /usrguide. title = "The {\LaTeX} Companion". If a do ument has no author. used to order this entry relative to author names. The bibliography will be sorted with the key. address = "Reading. we write G\"{o}del to produ e Gödel. year = "1995--99". su h as omment = ". Instead.. you will get an error message. type = "World Wide Web site". publisher = "Addison-Wesley Publishing Company". E . key = "LaTeX2e". author = "Mi hel Goosens and Frank Mittelba h and Alexander Samarin". } The use of the bra es in {\LaTeX} is to tell the bibtex program to take everything inside just as it is written (for the latex program to pro ess).

publisher = "World Wide Web". the omma would signal the bibtex program that `Jr. su h as writing {F}ourier analysis to for e the apital F. The use of the bra es in the name is to be sure that the author appears as intended: William Strunk. use that style but in lude the url as a note or in the address eld. but here is one way. Jr. } The referen e \ ite{StrunkWhite} presumes there is the entry for the original publi ation. Jr. so we an swit h styles and use the same sour e (tex and bib les). For one thing. ex ept the rst letter of the rst word). the World Wide Web did not exist. the url ould ontain spe ial hara ters. Otherwise. Some authors.edu/a is/bartleby/strunk/". address = "url ".3 BIBLIOGRAPHY WITH 36 BIBTEX The use of bra es to for e a parti ular result is ne essary in other instan es. title = "Elements of Style". author = "William Strunk{. That defeats one of the primary advantages of using LATEX and BibT X in the rst pla e: we want to let the style les determine the nal form. in .}". E 3. however. you will run into some di ulty with writing urls. If it is a book. and it would appear as `Jr. Now it is a major sour e of information. Here is an example: book{Strunk. Eventually. William Strunk'. use this feature inappropriately by putting bra es around everything. If the do ument is a te hni al report.2. address = "http://www.' is the rst name of the author.2 Web itations When BibT X was developed. year = "1999". There is no universally a epted standard for how to referen e web do uments. use the book type and spe ify: E publisher = "World Wide Web". note = "This is the web version of the lassi book by Strunk and White~\ ite{StrunkWhite}". the bibtex program will produ e `fourier analysis' (the plain style produ es arti le titles in lower ase. without the bra es. otherwise. olumbia.

howpublished = "World Wide Web. However.html}". } We have seen several pa kages so far. and you shall learn more about pa kages in Ÿ6. Carlisle and Alan Jeffrey and Frank Mittelba h and Chris Rowley and Rainer S h{\" o}pf". this book spe ies the sans serif font: \usepa kage{url} \renew ommand\url{\begingroup\urlstyle{sf}\Url} There are o asions when we want to referen e an entire web site. not the tilde. and writing it will produ e a spa e.3. followed by the url. \url{http://www. put the following de laration into your preamble: \usepa kage{url}.latex-proje t/org/latex3. To have the \url ommand a tive in your do ument. One example is the LATEX 2" referen e [2℄. Braams and David P. given by: mis {latex2e. The \url spe i ation is not a tually an intrinsi ommand in LATEX. like ~. year = "1994". . Also. An unsightly line with spa es ould also appear after the url. if needed. Its main use is to determine where the url an be broken in order to put it on two lines. ~ is in many urls. a url ould be ome very long. but you an hange this to another font with the spe i ation: \renew ommand\url{\begingroup\urlstyle{font }\Url} For example. Another feature of the url pa kage is that \url prints spe ial hara ters.2 The bib File 37 parti ular. and with latex having no pla e to break. olumbia. about whi h I shall say more when I des ribe ways to ustomize your do ument in Ÿ8. title = "{\LaTeXe} and the {LaTeX}3 Proje t". The default font it uses is tt. where I des ribe enhan ements for having graphi s in LATEX. These di ulties are over ome by spe ifying: address = "\url{http://www.edu/a is/bartleby/strunk/}". you will see a line with lots of spa es (for justi ation). it is dened in a pa kage. author = "Johannes L. this is the rst use of \renew ommand.

suppose we write string( mom = "My Mother" ) string( dad = "My Father" ) author = mom. we an dene strings with the entry: string{name = "string "} Then. other times Kluwer A ademi Publishers. the three eld values are equivalent to: author = "My Mother". We an on atenate strings and/or literals with #. we merely hange the one string value and re ompile. we an refer to the string anywhere in the value of a eld by ex luding the quotes. suppose we dene: string{kluwer = "Kluwer A ademi Publishers"} Then. For example. editor = "My Father". use the spa e hara ter.3 BIBLIOGRAPHY WITH 38 BIBTEX 3.2. as a literal: . title = "My MotherMy Father". To help be onsistent and to save some work in the long run when we write many dierent do uments and produ e more bib les. we an enter: publisher = kluwer. in luding abbreviations and names of publishers. editor = dad. Note the absen e of a spa e between the string values in the title. title = mom # dad. Besides onsisten y. and still other times Kluwer Pub. To ensure a spa e. ~.) For example. Then.3 Additional features One element of good style is to be onsistent in your terms. One sometimes sees Kluwer. to produ e the publisher value = Kluwer A ademi Publishers. when we wrote literals. (That is why we needed the quotes before. an advantage is that if some name hanges.

} If these were the only referen es. editor = "J. title = "Re ent Advan es in {F}ourier Analysis and its Appli ations: Pro eedings of the {NATO} {A}dvan ed {S}tudy {I}nstitute". title = "Results on the Absolutely Convergent Series of Fun tions and of Distributions". publisher = kluwer. Byrnes and Jennifer L. Artémiadis. Another useful feature of BibT X is the rossref eld for ross referen ing. editors. author = "N. pages 311316. In Byrnes and Byrnes [2℄. For example.2 The bib File title 39 = mom # "~" # dad. suppose we have the following entry (kluwer is a string. the other values are literals): E Pro eedings{Byrnes:FAA-89. Art{\'e}miadis". BibTE X also re ognizes a preamble in our bib les to enable us to dene some LATEX ommands. } Then. title = mom # " My Father". year = 1990. [2℄ J. Results on the absolutely onvergent series of fun tions and of distributions.S. Byrnes and Jennifer L. the result would appear as follows: [1℄ N. Byrnes". The same title as the above is obtained by any of the following: title = "My Mother " # dad. pages = "311--316". The general form is . Byrnes. Kluwer A ademi Press.K.K. 1990. we an have the following entry: InPro eedings{Artemiadis:FAA-89-311.3. Re ent Advan es in Fourier Analysis and its Appli ations: Pro eedings of the NATO Advan ed Study Institute.S. rossref = "Byrnes:FAA-89".

Here is how this an be used. Here is a list of the most basi ones (in luded in every installation): . 3. does not a tually print the letters.bib. Command \noopsort ignores the argument that it re eives. it is used to dene a ommand. whi h are the same. whi h omes with every installation of latex. thus putting volume 1 rst. For now. To for e the rst volume to sort before the se ond. Here is an example [11℄ that is useful for guiding the sorting of referen es in a spe ial ir umstan e: Preamble{ "\new ommand{\noopsort}[1℄{}" } The \new ommand is something I shall des ribe more fully in Ÿ8. The se ond ommand denes the format style of the bibliography to be plain. There are other bibliography format styles. but a se ond edition of volume 1 is printed in 1973. The bib entries would have the years in the opposite order than we want be ause sorting is rst by the authors. originally published 1971.3 De laration and Citation At the end of your sour e le (where you want the bibliography to appear). we fool the bibtex program with the following spe i ations: Volume 1 year = "{\noopsort{a}}1973".3 BIBLIOGRAPHY WITH 40 BIBTEX Preamble{ string } where string is any on atenation of literals and strings. Suppose there is a 2-volume work by the same authors. \noopsort. then by year. before \end{do ument}. Volume 2 year = "{\noopsort{b}}1971". mybiblio. in luding some provided by publishers. so just the years appear. requiring one argument. This fools the bibtex program into thinking the years are a1973 and b1971. produ ing nothing (indi ated by {}). put the following ommands (in either order): \bibliography{mybiblio} \bibliographystyle{plain} The rst de lares the bibliography to be in the bib le. The denition of \noopsort. however.

You an put more than one itation. There are times when we want to be sure a parti ular bib entry appears. among other things (to give a more ompa t bibliography). su h as: \bibliography{mybiblio. If we want only some parti ular list of entries to appear. we spe ify \no ite{*}. and they are labeled with numbers. You an insert some further itation information as an optional input argument to the \ ite ommand.latex} produ es [8.) The rule is that only those bib entries that are ited appear in the nal do ument. where label is what we put in our bib le entry. \ ite{tex. This is done with the \no ite ommand.3 De laration and Citation 41 plain is the most ommon be ause it formats entries a ording to a epted standards. 46 in the itation. the entries must be identi al. Figure 32 shows a omplete sour e le for having all entries in mybiblio.bib appear. we use \no ite with their labels. For example. . For example. To ite parti ular referen es. otherwise. The reason is that we an maintain one large bib le and write many do uments that use it. delimited by [ ℄. unsrt diers from plain by sorting entries by the order in whi h they are ited.3. 9℄ for this do ument. In parti ular. For example. Repeated entry telling us whi h label is repeated. [8℄ is produ ed by spe ifying \ ite{tex}. rather than numbers. separated by ommas. If we have the same label in both bib les. (In the option. the LATEX ommand is \ ite{label [. and that is the entire do ument! We an spe ify more than one bib le. abbrv diers from plain by abbreviating names of journals. we will get a fatal error message. rather than by the author names. p. Entries are sorted by the alphabeti al order of author names. breaking ties with the year of publi ation. 46℄ in this do ument. alpha diers from plain by iting by labels. the ~ is used to ensure that there is a spa e but no line break when giving the page number as p. su h as \no ite{tex} to be sure Knuth's TEX book appears. but know that many other styles have been written and are available free of harge. but we do not want to ite it in the text. We shall use only the plain style here. \ ite[p. even if it is not ited expli itly. If we have the same entry with dierent labels. if we want to have every entry in our bib le appear.~46℄{latex} produ es [9.another} The bibtex program will sear h them sequentially for any itation. : : : ℄}. they will appear twi e if both labels are used (or if we used \no ite{*}).

M. one for ea h of the following types: (a) An arti le in a journal. . Volume II of Ri h [2℄.M. How to Square a Cir le.3 BIBLIOGRAPHY WITH 42 BIBTEX \do ument lass[12pt℄{arti le} \begin{do ument} \no ite{*} \bibliographystyle{plain} \bibliography{mybiblio} \end{do ument} Figure 32: A Do ument to Print the Bibliographi Database Exer ises. 2. Ri h. [1℄ I. at least one entry must have more than two authors. the BibTE X data (bib le). 1990. [3℄ I. [2℄ I. one for ea h of the following types: (a) A te hni al report on the web. Impossible Dreams. Tu. (d) A te hni al report. and V. Further. Produ e a do ument that lists your entire database. 4. editor. Produ e a do ument with one paragraph that ites three bibliographi items. Submit a printed opy of the LATEX sour e (tex le).F. volume I. U. ( ) An entire web site. (b) A book on the web. whi h onsists of at least one entry for ea h of six dierent do ument types. editor. hapter 1. and the asso iated posts ript result (ps le). (b) An entire book with at least three authors. Ma Ta o. 1990. Produ e a do ument that has only a bibliography omposed of the following three entries (in the order shown). Smart. Money.R. Ma Ta o. 1. Ri h. se ond edition. Be sure your name is on ea h. ( ) A hapter in a book. Impossible Dreams. Produ e a do ument with one paragraph that ites three bibliographi items.M. volume II. 3. 1999.

. where label is unique in the do ument. This is a seminal book that arti ulates the problem-solving  i. This is a good book. Prin eton University Press. Prin eton. students. In the next se tion I des ribe intrinsi ounters and illustrate how to label and referen e them. Van Nostrand.e. and Referen es 4. \thepage produ es the page number. [2℄ G. There are times when you just want to produ e the ounter value. and equations. without a label. Polya. pla ed where the ounter's value is set. su h as : : : 4 Counters. gures.1 Basi Con epts A ounter is a numeri al value that refers to something that is being numbered. spe ify \value{ ounter }. Naive Set Theory. For example. 1945. whi h I assign to my Ph. For example. . Then. This is done by \the ounter. ex ept do not use LATEX spe ial hara ters or blanks. and there are modern des endants. The next 100 reveal la k of understanding the rst 100. The hoi e of label is arbitrary.43 5. Produ e an annotated bibliography of the following form (note the indentations on left and right margins): [1℄ P. Labels.R. se tions. whi h have intrinsi ounters asso iated with them. I shall introdu e the gure and table environments.D. theorem-proving  pro ess. 1960. How To Solve It. if you want to use the ounter's numeri al value as an argument in a ommand. NJ. On the other hand. Prin eton. in this book I dened: \se tion{Bibliography with \Bibtex} \label{se :Bibliography} Now I an refer to Ÿ3 by \S\ref{se :Bibliography}. just as the labels in the bib le entries. The LATEX syntax for labeling a ounter is \label{label }. NJ. su h as pages. A label is the identi ation of a parti ular value. There are many editions. and a referen e is a itation to a label. The rst 100 pages seem simple. The LATEX syntax for referen ing a label is \ref{label }. Halmos.

Some people use this same form but with dierent prexes.2 ) Ÿ3. Similarly. For equations. see the showkeys pa kage at CTAN [4℄. Counters that depend upon the style. In my hoi e of label. To illustrate how I an referen e other parts of this do ument. LABELS. 36 ) p. I an refer to these as follows: \S\ref{subse :bibfile} \S\ref{subsubse :web ite} ) Ÿ3. like a hapter in a book. you are reading subse tion 4. whi h I was able to print by writing \thepage. gives the page number where its label is dened. whi h is an element of good style. su h as subsubse :web ite. 31 For any ounter. This helps me to distinguish labels for dierent things. the following labels were dened (when the subse tion and subsubse tion were rst written): \subse tion{The bib File} \label{subse :bibfile} \subsubse tion{Web itations} \label{subsubse :web ite} Then.~\pageref{subse :bibfile} ) p.44 4 COUNTERS. su h as ss for subse tion and e for equation. so in this senten e I wrote its number by \ref{eqn:hessian} (with parenthesis added) and its page number by \pageref{eqn:hessian}.2 Intrinsi Counters Anything to whi h LATEX assigns a number has a ounter asso iated with it. In the exer ise to list what you like about mathemati s. an be labelled and referen ed in the same manner. AND REFERENCES 4. \pageref{ ounter }. whose numbers I ould write by \thesubse tion\ and \these tion. (If you have a lot of labels and need to keep tra k of them by printing ea h label and itation in your drafts. just as \ref{ ounter } gives its value. You are looking at page 44. respe tively. I use the prex eqn. I entered the label \label{exer:likeaboutmath} (page 29).2 I an also refer to their page numbers: p. (Re all from p. and I used the prex subse here. That is a matter of style.2 of se tion 4. I used the stru ture prex :name. The hoi e of label.~\pageref{subsubse :web ite} p.) . 26 that ~ is used to have a spa e without a linebreak. You an hoose any labeling onvention that is meaningful to you. whi h I an now referen e as exer ise #4 by writing \#\ref{exer:likeaboutmath}. is any string you want to use that does not ontain embedded blanks or spe ial hara ters used by LATEX. Here I illustrate some of those that are in all do ument styles. page 68. was labelled \label{eqn:hessian}.) Equation (6).2.

4. Lo ate at the bottom of the page (or the next page. [\ aption{ aption [\label{label }℄}℄ \end{figure} whi h have the same \begin{table}[options ℄ [\ aption{ aption [\label{label }℄}℄ . syntax: \begin{figure}[options ℄ [\ aption{ aption [\label{label }℄}℄ . Option h t b p Meaning Lo ate here (where the environment is de lared). The four hoi es are shown in Table 6. if present. If there is not enough room. In this do ument most tables and gures are spe ied with [ht℄.3 Figures and Tables In this se tion I des ribe gure and table environments. It is also advisable to spe ify \usepa kage{float} in the preamble. even though you will get no error message. We might spe ify [ht℄ and nd the oat in an unexpe ted pla e. One ause ould be an a umulation of oats that should be leared at some point before ontinuing. it is to be lo ated at the top of the following page. Lo ate on a separate page. Lo ate at the top of the next page. whi h is why you sometimes see pages with some blank spa e . the pla e where it is spe ied in the sour e. The environment options dene where the oat is to be lo ated. .) Be ause gures and tables are not split. an go at the top or bottom. This option is used in many pla es in this book. This does the same as \newpage. For that reason they are alled oating obje ts. This is done with the \ learpage ommand. as given in [9℄. [\ aption{ aption [\label{label }℄}℄ \end{table} The aption. whi h insists that the oat be pla ed here (note the apital H and no other option spe ied). alled a oat page.. it will not be understood. (If you put it outside the aption. whi h has no text.3 Figures and Tables 45 4. whi h means they are to be pla ed here. Table 6: Figure and Table Lo ation Options The pla ement of a oat is sometimes a sour e of frustration. perhaps on a page by itself. where you put it is where it will appear. . if this page does not have enough room). only gures and tables. ex ept that it also prints all remaining oating obje ts. their exa t lo ation depends upon how mu h room there is. One of the enhan ements is the pla ement option: [H℄. The label to referen e a gure or table is put inside the aption. if possible.. or oats.

4 COUNTERS. neither of these onditions is ne essary for their LATEX environments. Table number : aption That's it. (This is alled a lo al setting. using the \fbox ommand. LABELS. Also note how the aption is put at the top (see exer ise 3). The latter makes tables. . The gures and tables in this do ument appear as the form: Figure number : aption vs. upon leaving the gure environment. and we generally use the table environment to present information in tabular form. I did this to avoid onfusion by having some oat appear pages after it is ited and dis ussed. \begin{figure}[ht℄ \begin{ enter} \setlength{\fboxrule}{3pt} % make border lines thi k \setlength{\fboxsep}{. followed by a gure or table. we generally use the gure environment to present what we usually think of as gures. the frame in Figure 35 has thin lines and no extra padding around the border. However. AND REFERENCES 46 in the lower portion. but the table environment does not have to ontain a table. } \end{ enter} \ aption{Framed Figure with Caption at Bottom \label{fig:fboxbottom}} \end{figure} Figure 33: Framed Figure 34 Sour e This is a framed gure.2in} % in rease distan e to border \fbox{ This is a framed figure. it diers from a gure only in its name. and they have separate ounters. Figures 33 and 34 illustrate how to frame a gure with a thi k border. Figure 34: Framed Figure with Caption at Bottom The parameter settings have returned to their default values. For example. notably pi tures. As a matter of style.) Thus. Floats an be framed. The table environment is not to be onfused with the tabular environment.

1.4. iv.4 Dening Your Own In the preamble you an dene your own ounter with the \new ounter ommand: \new ounter{name }[within ℄ where name is the (unique) name of the ounter ( annot be the same as one of the intrinsi ounter names). This an also be used to transfer the value of one ounter to another. For example. d.2. . III. the values of my ounter will be of the form s. 3. What you see a. II. Further. : : : when printed within se tion s. This will ause the value of my ounter to be reset to 0 when entering a new se tion. : : : A. we an spe ify \step ounter{my ounter}. The ounter values are printed in Arabi numerals. You an also dene the ounter to be within another ounter. The initial value of the ounter is 0. \new ounter{my ounter}[se tion℄ denes my ounter to be within the se tion ounter. ii. 2. but you an spe ify the type of numeral. D. For example. For example. \new ounter{my ounter} denes a ounter whose name is my ounter. 2. C. \set ounter{my ounter}{5} sets the value of my ounter to 5. : : : 1. : : : i. \set ounter{my ounter}{\value{page}} . Counter values an be set to some absolute value with the \set ounter ommand. : : : I. B. 4. s. shown in Table 7. : : : within se tion 1. For example.4 Dening Your Own 47 Figure 35: Framed Figure with Caption at Top This is framed with default parameter values. they will be 1. instead of the printed values being 1. If we just want to in rement the ounter by 1. : : : . b. : : : What you write \alph{my ounter} \Alph{my ounter} \arabi {my ounter} \roman{my ounter} \Roman{my ounter} Table 7: Numerals to Print Counters Counter values an be in remented with the \addto ounter ommand. \addto ounter{my ounter}{1} adds 1 to the value of my ounter. iii. 1. For example. more generally. IV.2.1. 4.

This is done with the \refstep ounter ommand.} (the appearan e parameter is \labelenumii). \renew ommand{\theenumi}{\Roman{enumi}} \renew ommand{\theenumii}{\Alph{enumii}} % hanges numeral type \renew ommand{\labelenumii}{\theenumii. For example. we an use \ref{mylabel} and \pageref{mylabel} wherever we like. The default numeral type is arabi . \set ounter{my ounter}{0} \renew ommand{\themy ounter}{\roman{my ounter}} \step ounter{my ounter} (\themy ounter). \step ounter{my ounter} (\themy ounter).} % hanges appearan e \begin{enumerate} \item Introdu tion \item Terms and Con epts \begin{enumerate} \item Groups and fields \item Pi ni s and froli \end{enumerate} \end{enumerate} Figure 36: Alternative enumerate Symbols Sour e (Result in Figure 37) The se ond level. where the types of numerals for the four levels are: arabi . we want to be able to label it for future referen e. For example. onsider the enumerate list environment. ::: This an be used for intrinsi ounters too. \dots ) (i). but you an hange the appearan e to be any of those listed in Table 7 by applying the \renew ommand to \the ounter. When using a ounter for some non-intrinsi sequen e. whi h also in rements its value. LABELS. write \refstep ounter{my ounter} \label{mylabel} Then. whose ounter is enumii. alph. su h as illustrated in Figures 36 and 37. We an hange these to be any type we want. had its label hanged to what is spe ied in the sour e: \renew ommand{\labelenumii}{\theenumii. roman and Alph. (ii). These hanges remain in ee t ( alled a . For example.4 COUNTERS. page). AND REFERENCES 48 sets the value of my ounter to the urrent page number (value of the intrinsi ounter. to in rement my ounter by 1 and establish a label to its value at the pla e this is done.

Exer ises.4 Dening Your Own 49 I. Write a do ument with at least two pages and two se tions. Put an enumerated list of items near the beginning of your do ument. Introdu tion II. Submit a printed opy of the LATEX sour e (tex le) and printed opy of the asso iated posts ript result (ps le). ( ) Referen e item #2 of your enumerated list. and use the \ref or \pageref ommand to referen e ea h of the following. 1. Groups and elds B. (b) Somewhere near the end of your do ument referen e the page number of the rst se tion.4. so we must hange them ba k if we want to restore the defaults. shown in Table 8. (a) Referen e Ÿ2 by a label that you assign to se tion 2 (make whatever label name you like). Pi ni s and froli Figure 37: Alternative enumerate Symbols Result (Sour e in Figure 36) What hanges numeral label numeral label numeral label numeral label Counter enumi enumii enumiii enumiv Command \renew ommand{\theenumi}{\arabi {enumi}} \renew ommand{\labelenumi}{(\theenumi)} \renew ommand{\theenumii}{\alph{enumii}} \renew ommand{\labelenumii}{(\theenumii)} \renew ommand{\theenumiii}{\roman{enumiii}} \renew ommand{\labelenumiii}{(\theenumiii)} \renew ommand{\theenumiv}{\Alph{enumiv}} \renew ommand{\labelenumiv}{(\theenumiv)} Table 8: Default Settings for enumerate Counters global setting ). Be sure your name is on ea h. . Terms and Con epts A.

^. Table 9 shows other ommon operations in math mode. The other form is ) math display mode. and referen e them by label. 2. signied by delimiters $ : : : $ or \[ : : : \℄. For example. (Ea h of the tables in this se tion applies only to math mode. like this: ) A onsequen e of Einstein's postulates is that $E = m ^2$. Produ e Figure 35.5 MATH MODE 50 2.1 2.2 ::: ::: 2.) The bra es en lose an expression that an be used to dene a more om2 plex operand. Also referen e the page that they appear.2 ::: ::: ::: Math Mode One an write mathemati al expressions by entering math mode.\℄ A onsequen e of Einstein's postulates is that E = m 2 : 5. The $ delimiter keeps the mathemati al expression in the text. The order of subs ripts and supers ripts does not matter: d x_{a+b}^{ +d} ) x a+ +b x^{ +d}_{a+b} ) x a++db . 4. like this: A onsequen e of Einstein's postulates is that \[E = m ^2.1 1. A onsequen e of Einstein's postulates is that E = m 2 . xa+b is written as $x_{a+b}$ and xa is written as $x^{a^2}$.1 Mathemati al Symbols The example also illustrates the use of the supers ript operator. In lude two tables and gures in your do ument. 3. 5 ::: 1. Produ e lists using the enumerate environment with the following appearan e: 1.

math fonts xy = z + . however. You an make math fonts boldfa e by spe ifying \boldmath before entering math mode. For example. Font style. does not apply to math mode be ause math mode has its own.5. {\boldmath $x^n+y^n=z^n$} ) xn yn z n . Pre eding any symbol by \not puts the line through the symbol. as in the following examples: A\not\subseteq B x\not\in A\ up B A\setminus B\not\supset B What it is empty set interse tion union set minus element in subset (proper) subset or equal superset (proper) superset or equal ) A 6 B ) x 26 A [ B ) A n B 6 B How it appears . respe tively.1 Mathemati al Symbols Operation Symbol subs ript _ supers ript ^ multiply \times divide \div 51 Example How it appears What you write x3 x_3 3 x x^3 ab a\times b ab a\div b Table 9: Some Mathemati al Operations Table 10 shows some set notation. The omplement of A often appears as  A. produ ed by $\overline{A}$. {\Large $(x\div y) + z$} ) ( )+ . some authors use A or A0 . but this is not universal notation. Note that \boldmath is surrounded by the bra es. \ [ n 2     What you write \emptyset \ ap \ up \setminus \in \subset \subseteq \supset \supseteq Table 10: Set Notation You an ontrol the size of the font by using the usual spe i ation before entering math mode. otherwise. produ ed by $A^ $ and $A^\prime$. For example. produ ed by $\sim A$. and some use A. separate from text mode.

even when leaving and re-entering. al. ausing unintended results when applied to other symbols. 9). Unlike \boldmath. normal. and returns to normal style in the se ond ase. without the bra es. but not to spe ial mathemati al symbols. \mathfont {expression }. For example. \boldmath$A\supset B$ text $B\ up C$ {\boldmath$A\supset B$} text $B\ up C$ ) A  B text B [ C ) A  B text B [ C Within math mode. as shown in Table 11. we an ontrol the font style of letters with the ommand. rm. The alligraphi alphabet looks like this (and it is available only in math mode): ABCDEFGHIJ KLMNOPQRST UVWXYZ : Write ${\ al P} = A + B$ to produ e P = A + B . p. For example. {\boldmath$\tilde A\times\ve {1}\otimes\overline{2}$} $\mathbf{\tilde A\times\ve {1}\otimes\overline{2} }$ ) A~  ~1 2 ) A~  ~1 2 Table 11 illustrates the out ome of ea h font for this expression: \mathfont {\tilde A\times\ve {1}\otimes\overline{2}} Font Style boldfa e alligraphi itali normal roman sans serif typewriter Command \mathbf \math al \mathit \mathnormal \mathrm \mathsf \mathtt Example Result ~  ~1 2 A A~  1 ~ 2 ~ ~ A1 2 A~  ~1 2 A~  ~1 2 ~  ~1 2 A ~ A  ~1 2 Table 11: The nmathfont Commands The alligraphi style applies only to apital letters. digits and a ents. The following illustrates this. tt} (analogous to the ntextfont ommand.5 MATH MODE 52 would remain bold. this applies only to letters. it. where font is one of: {bf. sf. Greek letters are dened only in math mode. the alligraphi fonts remain in ee t: $\ al P = A + B$ ) P = A + B . and they are spe ied by spelling them as keywords. to produ e . where B [ C is boldfa e in the rst ase.

= Æ .

5.2 Fra tions and Variable Size Fun tionality 53 write \[ \alpha . As Lamport [9. (Not every Greek letter is in luded  see Appendix Table 35. In the preamble spe ify \usepa kage{bm}.) The \mathbf does not make Greek letters boldfa e. 43℄ says. but there is a pa kage that not only provides the boldfa e font.\delta \℄. p. but also produ es proper spa ing. We ould use \boldmath to a hieve this. then \bm{\beta} ).\beta = \Delta . Making Greek letters is as easy as  (or ) (written $\pi$ or $\Pi$).

symbols whose size you would want to adapt to expressions are generally designed to do so. and I present more examples below. between the integrand and dx. whi h uses the \sqrt and \prod fun tions: \[ \sqrt{\fra {\prod_{n=1}^N \left( \sum_{i\in I_n} x_i^n\right)} {\sqrt[3℄{\sum_{i\in I_\infty} x_i}} } \℄ Figure 38: Variable Sizes Sour e (Result in Figure 39) . Table 12 shows some of the most ommon of these. 5. we use the \fra ommand: $\fra {x+y}{4}$. where the numerator and denominator an be any expression. The general form is \fra {numerator }{denominator }. we ould write $(x+y)/4$ to make (x + y )=4. \℄.). In LATEX. We an make this appear 4 x+y larger.2 Fra tions and Variable Size Fun tionality To make fra tions. This inserts a thin spa e ( ompare the results by writing the expression with and without the \. note the use of \. but if we want x+y . Here is a more omplex equation in math display mode: A= x2 + y . Some mathemati al symbols adjust their size to t the expression. as 4 . Figures 38 and 39 illustrate this with another example. 1 + x2+1 written as \[ A = \fra {x^2+y_\alpha}{1+\fra {\eta}{x^2+1}}. by pre eding the math mode with \large. Note how the sizes of the fra tions adjust automati ally. In the ase of the integrals. .

Figures 40 and 41 illustrate this. the indi es on the sums and produ t appear as they would in line.dx \left( \right) \left(\fra {x}{1+y} \right) \left\{ \right\} \left\{\sum_i x_i \right\} [℄  f (x) dx \left[ \right℄ \left[\int_0^\infty f(x)\.5 MATH MODE 54 Operation How it appears P sum n X i=1 R integral Z b a parentheses \sum xi \sum_{i=1}^n x_i \int f (x) dx  ()  x 1+y fg ) ( bra es X i bra kets Z 1 0 What you write xi \int_a^b f(x)\.dx\right℄ Table 12: Variable Size Mathemati al Operation Symbols v u QN  P n u =1 i2In xi u nq t 3 P i2I1 xi Figure 39: Variable Sizes Result (Sour e in Figure 38) Noti e that even though it is written in math display mode. . but you an for e either of the two styles with the \displaystyle and \textstyle ommands. LATEX ompilers make judgments about the layout.

For example. to have (x 2 A ) x 2 B ) . using \textstyle and \displaystyle to override the default form for the mode.5. as well as sizing the expression. as though it were in display mode. (A  B ): . in parti ular. The default is not always predi table. Figure 42 gives more examples to ompare in line text and display mode. math display mode does not always use displaystyle. Appearan e What to write in text mode What to write in display mode 2 \fra {x}{2} \textstyle\fra {x}{2} \displaystyle\fra {x}{2} \fra {x}{2} \max_{x\in X} \textstyle\max_{x\in X} \displaystyle\max_{x\in X} \max_{x\in X} x x 2 maxx2X max x2X Figure 42: Examples to Compare Text and Display Modes Table 13 shows symbols used in logi al expressions.2 Fra tions and Variable Size Fun tionality 55 \[ \sqrt{\fra {\displaystyle \prod_{n=1}^N \left( \sum_{i\in I_n} x_i^n\right)} {\sqrt[3℄{\displaystyle\sum_{i\in I_\infty} x_i}} } \℄ Figure 40: \displaystyle Sour e (Result in Figure 41) v ! u N uY X u xni u u n=1 i2I u s n u X u xi t 3 i2I1 Figure 41: \displaystyle Result (Sour e in Figure 40) In text mode you an for e the display style of pla ing these subs ripts and supers ripts on fun tions.

\{x: x\not\pre y\} \not\subset {\ al A} ) ( 1. \℄ To have 8x9y 3 [P (x) ^ Q(y)℄: write \[ \forall x\exists y\ni [P(x)\wedge Q(y)℄. \Leftrightarrow  \equiv 3 \ni Table 13: Some Symbols in Logi The quantiers in this last example seem a bit rowded. 0℄ = fx 3 x  0g ) a j  bi  bi  a j ) 8y fx : x 6 yg 6 A . Here are some examples: (-\infty. \exists y ) 8x9y ) 8x 9y ) 8x 9y (There are other spa ing ommands. in luding negative spa ing. In math mode a full spa e is obtained by spe ifying \. \℄ Logi al Term existential quantier universal quantier negation disjun tion onjun tion impli ation equivalen e su h that How it appears What you write 9 \exists 8 \forall : \neg _ \vee ^ \wedge ! \rightarrow ) \Rightarrow .5 MATH MODE 56 write \[ (x\in A\Rightarrow x\in B) \Leftrightarrow (A\subseteq B). Here is how ea h looks: \forall x \exists y \forall x\. so we might want to add some spa ing between terms. \exists y \forall x\.. and a half spa e by \. shown in Appendix Table 36.) Table 14 shows some relations for ordered sets (besides those on the keyboard: < = >).0℄ = \{x\ni x \le 0\} a_j\pre b_i \equiv b_i \su a_j \forall y\.

: : : written as $x_i < 0 for all i=1. It has the form: \begin{array}{ olumn spe s }options rst row spe \\ .3 Arrays and Equations The array environment is to math mode what tabular environment is to text mode. and all letters are in the math form of itali (not quite the same as the itali in text mode).\dots$ written as $x_i < 0 \mbox{ for all } i=1.\dots$ The rst line points out that blanks mean nothing in math mode. . last row spe [\\ options ℄ \end{array} The olumn spe i ations and options are the same as in the tabular environment. or with the array environment.\dots$ written as $x_i < 0$ for all $i=1. using \mbox for ea h header entry. The use of \mbox is parti ularly onvenient in math display mode. using the math mode designation for ea h body entry: $ : : : $. whi h I shall illustrate in the next se tion. The following table has text headers and math body. and more. : : : xi < 0 for all i = 1. : : : xi < 0 for all i = 1. so it an be generated in either of two ways: with the tabular environment. Variable Current Value x y 1:234567 9:87 Limit 1 12:2 . 5.5.. Compare ea h of the following: xi < 0foralli = 1. but we an also do the reverse with the \mbox ommand. but the body is in math mode.3 Arrays and Equations Relation less than or equal greater than or equal not equal pre edes pre edes or equals su eeds su eeds or equals 57 How it appears   6=     What you write \le \ge \ne \pre \pre eq \su \su eq Table 14: Order Relations We have seen how to embed math mode into text.

2 \\ \hline \end{array} \℄ or \begin{ enter} \begin{tabular}{ } Variable & Current Value & Limit \\ \hline $x$ & $ 1. (= x+y) \end{array} \℄ The \.234567$ & $ 1 $ \\ $y$ & $-9.87 $ & $-12.87 & -12.5 MATH MODE 58 This an be generated by either of the following two ways: \[\begin{array}{ } \mbox{Variable} & \mbox{Current Value} & \mbox{Limit} \\ \hline x & 1.2 $ \\ \hline \end{tabular} \end{ enter} You an align a series of equations to appear this way: x = 5:2 y = 2:5 z = 7:7 (= x + y) The above was produ ed by the following use of math display mode (whi h is always entered): \[ \begin{array}{l l} x &=& 5. spe ies a spa e. This is like a 3- olumn array with spe i ations {l l}.234567 & 1 \\ y & -9. so the above is produ ed by the following: .7 \. but ea h row is numbered: x = y y = z (1) (2) (Another dieren e is that the eqnarray environment uses displaystyle.2 \\ y &=& 2. 7. otherwise. as above.) We use the eqnarray environment dire tly (without entering math display mode).7 (= x+y) ) 7:7(= x + y ).5 \\ z &=& 7. Another environment is eqnarray.

Further. (Note that \ref gives just the number. however. This poses no parti ular advantage over spe ifying eqnarray and merely entering one row . For a single.) The relation need not literally be an equation. whi h is the same as eqnarray.3 Arrays and Equations 59 \begin{eqnarray} x &=& y \label{eqn:xy} \\ y &=& z \label{eqn:yz} \end{eqnarray} The \label statements are to illustrate that we an referen e these by writing (\ref{eqn:xy}) to produ e (1) and (\ref{eqn:yz}) to produ e (2).5. anything ould be used for the middle olumn.' in whi h ase we need to suppress the numbering of all but one of the rows. but without the equation numbers. parentheses are added. there is the equation environment. The \nonumber ommand auses no number to be assigned to the rst part of the se ond equation. Figures 43 and 44 give an example. there are times when we need to use more than one line for an `equation. It does. spe ialized to this olumn spe i ation. let us hange our mind easily as to whether or not to in lude equation numbers by simply adding or removing the * from the environment spe i ation. There is no apparent advantage to this sin e the same result an be produ ed by the ordinary array environment. \begin{eqnarray} x &\mbox{is equal to}& y \\ y & \pre eq & \fra {a+b+ +d}{\Psi} + \fra {e+f+g+h}{\Phi} + \nonumber \\ & & I+K+J+L \end{eqnarray} Figure 43: eqnarray Environment Sour e (Result in Figure 44) x is equal to y a+b+ +d e+f +g+h y  + +  I +K +J +L (3) (4) Figure 44: eqnarray Environment Result (Sour e in Figure 43) There is also an eqnarray* environment. numbered equation.

Also.2 & 1. To illustrate. What you write x' x^t x^T x^{\mathsf{T}} x^{\mbox{\tiny $T$}} ) ) ) ) ) How it appears x0 xt xT xT xT Table 15: Transpose of a Ve tor \begin{equation*} Ax^\prime = \left[ \begin{array}{rrr} 1. Noti e how the verti al line was drawn by the olumn spe i ation. and the horizontal line separating the blo ks is obtained by spe ifying \hline before the se ond row of the outer array. Table 15 shows other ways to denote the transpose of a ve tor.0 & -2.1 & 1. Analogous to eqnarray*. whi h suppresses the equation numbering. there is the equation* environment.3 \\ 21. Figures 45 and 46 show how to present a matrix equation.0 & 22.5 MATH MODE 60 (ex ept that olumn separators (&) are not used in the equation environment). { | }. . \end{equation*} Figure 45: Matrix Equation Sour e (Result in Figure 46) Ax0 =  1:1 1:2 1:3 21:0 22:0 2:1  0  x1 x2 x3 1 A: Figure 46: Matrix Equation Result (Sour e in Figure 45) Array environments an be nested.1 \\ \end{array} \right℄ \left( \begin{array}{ } x_1 \\ x_2 \\ x_3 \end{array} \right). note how x0 is spe ied. as illustrated in Figures 47 and 48.

\fbox{$ \begin{array}{l l} \displaystyle\int_0^\infty xe^{-\tau x}\. su h as writing $x = \fbox{y} + z$ to produ e x = y + z .dx &=& \displaystyle\fra {1}{\tau} \\ \\ &=& \displaystyle\oint_a^{b+ } \Psi(x)\.dx \end{array} $} Z ) 0 1 xe x dx = = 1  I a b+ (x) dx We an use \fbox within math mode. For example. Note how the line height does not adjust to the frame.3 Arrays and Equations 61 \[ \left[ \begin{array}{ | } \begin{array}{ } A_{11} & A_{12} & A_{13} \\ A_{21} & A_{22} & A_{23} \end{array} & 0 \\ \hline 0 & \begin{array}{ } B_{11} & B_{12} \\ B_{21} & B_{22} \end{array} \end{array} \right℄ \℄ Figure 47: Nested Arrays Sour e (Result in Figure 48) 2 A11 A12 A13 A21 A22 A23 6 6 4 0 0 B11 B12 B21 B22 3 7 7 5 Figure 48: Nested Arrays Result (Sour e in Figure 47) We an en lose mathemati al expressions in a box.5. sometimes used for emphasis. ausing .

rather than absolute measurements for spa ing. any right symbol will do. x = 0.. This is be ause \left and \right must balan e  i.2\baselineskip} after x = y + z auses extra verti al spa e equal to 20% of the value of \baselineskip. used spe i ally for this purpose of balan e. after the array.) Now onsider the following onditional assignment: f (x) = 8 < : 1 0 1 if if if x < 0. whi h you might hange. The period is not printed in this ase. (In the longrun. In parti ular. there must be an equal number of ea h. x > 0: produ ed by the following LATEX ode: \[ f(x) = \left\{ \begin{array}{rll} -1 & \mbox{if} & x < 0. \end{array}\right. along with \overline. Figures 49 and 50 illustrate these. it is better to use parameters. \℄ Note the use of \right. This ould be over ome by putting a verti al spa e ommand just after the expression. \widehat and \widetilde. be ause the former takes into a ount the font size.e. \[ \begin{array}{ } \mbox{This sum has} \\ \mbox{an overbra e} \\ \overbra e{\overline{i\dots j} + \underline{k\ dots l}} & \underbra e{\widehat{xy} . whi h is the height of one line of normal text. \\ 1 & \mbox{if} & x > 0. Now the use of the \left LATEX ommand for onditional assignment raises related uses of the underbra e and overbra e. \\ 0 & \mbox{if} & x = 0.e. It is not ne essary that the left symbol be related to the right one  i. \underline.. like \baselineskip. \left\{ does not require \right\} to balan e. We have seen the use of \left and \right for bra kets around a matrix.\widetilde{ab}} \\ & \mbox{This differen e} \\ & \mbox{has an underbra e} \end{array} \℄ Figure 49: Horizontal Bra es Sour e (Result in Figure 50) . putting \vspa e{.5 MATH MODE 62 an undesirable lash.

the \raisbox ommand is used to lower the small matrix. or we ould use the array environment and use either the \mbox or \parbox (see p. 20) to enter the text. as shown in gures 53 and 54. The solution is to use the \raggedright ommand. In addition.3 Arrays and Equations 63 This sum has an overbra e z }| { i:::j + k l e x y ab | {z } This dieren e has an underbra e Figure 50: Horizontal Bra es Result (Sour e in Figure 49) We often need to mix mathemati al notation and text. however.) The problem is that \flushleft skips a line. some nuan es to understand. giving it some spa e below the horizontal line. (Try it with the default justify and you will see that the spa ing gives a poor appearan e. whi h ruins the alignment (even though [t℄ is spe ied). Figures 51 and 52 show the problem with using \flushleft to make the text within the parbox ush left. We ould use the tabular environment and spe ify in-line math mode where needed (with $).5. . There are.

} & \parbox[t℄{1.05in}\\ \fourth &\mbox{for}& x=~~1.05in} \\ \half &\mbox{for}& x=~~0~ \vspa e{.2} \begin{ enter} \begin{small} \begin{tabular}{lll} Matrix & Definition & Example \\ \hline \parbox[t℄{. where $\{X_i\}$ are random variables. and E [℄ is the expe ted value operator with i = E (Xi ).9in}{Covarian e} & \parbox[t℄{2in}{\flushleft $A_{ij} = E[(X_i-\mu_i)(X_j-\mu_j)℄$.$ } \vspa e{.5 MATH MODE 64 \renew ommand{\arraystret h}{1. and $E[\ dot℄$ is the expe ted value operator with $\mu_i=E(X_i)$.1in} \\ \hline \end{tabular} \end{small} \end{flushleft} \renew ommand{\arraystret h}{1} Figure 51: \flushleft in parbox Sour e (Result in Figure 52) Matrix Denition Example 1 0  2 Covarian e Aij = E [(Xi i )(Xj j )℄.4in}{\s riptsize $\left[\begin{array}{rrrrr} \fra {1}{2}&0 \\ 0&\fra {1}{2} \end{array}\right℄$ \flushleft for $X_2=X_1^2$ and $Pr[X_1=x℄$ \\ $= \left\{ \begin{array}{lll} \fourth &\mbox{for}& x=-1~ \vspa e{. \end{array}\right. where fXi g are random variables. 0 1 2 X2 = X12 P r8 [X1 = x℄ for > > < = > > : 1 4 1 2 1 4 and for x= 1 for x= 0 for x= 1: Figure 52: \flushleft in parbox Result (Sour e in Figure 51) .

4 Spe ial Fun tions and Alphabets 65 \begin{ enter} \begin{small} \begin{tabular}{lll} Matrix & Definition & Example \\ \hline \parbox[t℄{. Among the spe ial fun tions are the omplete set of trigonometri fun tions. } & \parbox[t℄{1. we write $\tan\theta = \fra {\sin\theta}{\ os\theta}$ to pro- . Example  1 0  2 1 0 2 for X2 = X12 P r8 [X1 = x℄ > > < = > > : 1 4 1 2 1 4 and for x= 1 for x= 0 for x= 1: Figure 54: \raggedright in parbox Result (Sour e in Figure 53) 5. \end{array}\right.05in} \\ \half &\mbox{for}& x=~~0~ \vspa e{.4in}{\s riptsize\raisebox{-. and E [℄ is the expe ted value operator with i = E (Xi ).1in}{ $\left[\begin{array}{rrrrr} \fra {1}{2}&0 \\ 0&\fra {1}{2} \end{array}\right℄$} \flushleft for $X_2=X_1^2$ and $Pr[X_1=x℄$ \\ $= \left\{ \begin{array}{lll} \fourth &\mbox{for}& x=-1~ \vspa e{.05in}\\ \fourth &\mbox{for}& x=~~1.4 Spe ial Fun tions and Alphabets Math mode re ognizes a olle tion of spe ial fun tions. and $E[\ dot℄$ is the expe ted value operator with $\mu_i=E(X_i)$. These spe ial fun tions are used to make the sour e learer. For example. where fXi g are random variables. rather than using \mbox to a hieve the same result.9in}{Covarian e} & \parbox[t℄{2in}{\raggedright $A_{ij} = E[(X_i-\mu_i)(X_j-\mu_j)℄$. Table 16 shows some ommon ones.5. where $\{X_i\}$ are random variables.$ } \vspa e{.1in} \\ \hline \end{tabular} \end{small} \end{ enter} Figure 53: \raggedright in parbox Sour e (Result in Figure 54) Matrix Covarian e Denition Aij = E [(Xi i )(Xj j )℄.

x_n \max_{x\in X}f(x) \fra {\tan(\theta + \pi)}{\ln\. $\Re$. . rather than <. the real line is sometimes denoted by R . Table 18 shows how \mathbb an be used for spe ifying other numeri al spa es.x} Table 17: Examples of Mathemati al Fun tions There is also a pa kage of AMS symbols. Appendix Table 40 (p. This gives the following alphabet with the mathbb font: $\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$ ) A B C D E F G H IJK L M N O PQ R STUVW XYZ For example. whi h you de lare in your preamble with \usepa kage{amssymb}. whi h is the LATEX spe ial symbol. How it appears textstyle displaystyle limn!1 xn lim x n!1 n lim infn#0 log xn limn#inf log xn 0 maxx2X f (x) max f (x) x2X tan( + ) tan(+) ln x ln x What you write \lim_{n\rightarrow\infty}x_n \liminf_{n\downarrow 0}\log\. 126) has a mu h longer list of spe ial fun tions.5 MATH MODE 66 Fun tion How it appears limit lim inf log maximum tangent lim lim inf log max tan What you write \lim \liminf \log \max \tan Table 16: Some Common Mathemati al Fun tions sin  du e: tan  = os  . as well as the arrows used in some of the examples shown in Table 17.

: : : . and H is sometimes used to denote the Hamiltonian. df (x)=dx. The partial derivative symbol. In LATEX it is produ ed by \nabla. L is often used to denote the Lapla e transform or the Lagrangian. and f (x) {\large$\fra {\partial f(x)}{\partial x}$} to produ e x . f (x)=xn ): I leave it as an exer ise to show the LATEX ode that produ ed equation (5). This gives the following alphabet: $\maths r{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$ )A BCDE FG H I J K L M N OPQRS T U V W X Y Z In parti ular. for whi h you spe ify \usepa kage{mathrsfs} in the preamble. so you an write \partial f(x)/\partial x to produ e f (x)=x. (also alled del). and its mathemati al denition is the ve tor of rst partial derivatives: rf (x) = (f (x)=x1 . whi h is also used by some authors.) 5. whi h is an upside down delta (introdu ed by Hamilton in 1853). The usual notation for the gradient of a fun tion is the nabla.  . H. The Hessian is the matrix of se ond partial derivatives: r f (x) = 2 This was produ ed by the following ode:    2 f (x) : xi xj (5) . (Compare with \math al.5 Derivatives and Integrals We an express a total derivative.5 Derivatives and Integrals What you writey \mathbb{R} \mathbb{C} \mathbb{Z} \mathbb{Q} yIn math mode. we an use (x) . or. by writing $df(x)/dx$.5. is written the \fra ommand to produ e dfdx \partial. ) ) ) ) 67 How it appears R C Z Q What it means Real values Complex values Integer values Rational values Table 18: Notation Using mathbb Fonts from amssymb Pa kage Another alphabet is \maths r. denoted by the symbol r.

Compare with the following and see if you an produ e it: r   2  2 f (x) : f (x) = xi xj (6) There are two integral signs: \int) and \oint) . note how the outer integral is large in the following expression: R Z b lim a !1 . \end{array} \℄ There seems to be some rowding in this dire t spe i ation. whi h are both variable size symbols. For example.5 MATH MODE 68 \[ \begin{array}{lll} \nabla^2f(x) &=& \left[ \displaystyle\fra {\partial^2f(x)} {\partial x_i \partial x_j} \right℄.

H .

.

X (v ) .

H .

H .

xef (x) dx .

.

f (x) dx .

.

\dots.) Denite multiple integrals are no problem.dx_1\ dots dx_n \℄ . xn ) dx1    dxn write \[ \int_0^\infty \int_0^{x_n} \int_0^{x_{n-1}} \ dots \int_0^{x_2} H(x_1. : : : .\Phi(v)\.dx}\right| \.x_n)\.dx} {\oint_{X(v)} e^{\lambda f(x)}\.. \. \℄ (Note the use of the thin spa e. To have Z 0 1 Z xn Z xn 1 0 0  Z 0 x2 H (x1 .dv . (v ) dv: X (v) e This was obtained by the following ode: \[ \int_a^b \lim_{\lambda\rightarrow\infty} \left| \fra {\oint_{X(v)} xe^{\lambda f(x)}\.

like theorem. also used as a ounter. p. 223℄): ZZ S (urv vru)  dS = ZZZ  (ur  rv vr  ru) d: Note how the domains are entered on the multiple integrals and the spa ing of the integral signs.6 Theorems and Denitions The foundations of mathemati s are axioms and rules of inferen e. whi h is not produ ed by standard LATEX 2" . Consider the following example: Theorem 5.y. Here is the syntax: . all text is in itali . like Theorem. \end{theorem} Other theorem-like environments an be dened to have the same properties. This is so fundamental that LATEX has the fa ility to dene a spe ial environment that in ludes a keyword. This requires both a keyword. and a unique name for the environment.1 For n > 2.z\in \LZ_{++}$. but is also the name of the asso iated ounter. and we have the ounter value: \thetheorem=5. Noti e how  Theorem 5.1 appears. there is no solution to $x^n + y^n = z^n$ for \newline $x. whi h is not only the name of the environment. whi h are statements whose truths are established relative to the underlying logi . This was dened in the preamble by: \newtheorem{theorem}{Theorem}[se tion℄ Then. there is no solution to xn + yn = z n for x. y.1. onsider the following: Z Z S (urv vru)  dS = Z Z Z  (ur  rv vr  ru) d: The domains of integration. but by spe ifying \usepa kage{amsmath} in the preamble (see The LATEX Companion [5. and a name. and the spa ing of the integral signs. are better with the following. like Theorem.5. The rules reate theorems. z 2 Z++. 5.6 Theorems and Denitions 69 However. the theorem was produ ed by the following LATEX ode: \begin{theorem} For $n > 2$.

rather than Theorem 1.1. here is a orollary environment: Corollary 5. \end{ orollary} The following reates an axiom environment that is not within any other ounter. the above orollary was written as: \begin{ orollary} The sum of ubes annot be a ube.5 MATH MODE 70 \newtheorem{name }{keyword }[within ℄ The name denes the environment name. 47) or by some other \newtheorem. In this do ument. This was reated by the following ode: \begin{axiom} \label{axm: hoi e} From any (infinite) family of sets a new set an be reated that ontains exa tly one element from ea h set in the family.1. I dened the theorem environment to be numbered within the se tion. \end{axiom} The label allows us to refer to the Axiom of Choi e as `Axiom 1 on page 70' by writing Axiom~\ref{axm: hoi e} on page~\pageref{axm: hoi e}. but this is generally not desirable for a denition. Consider the following example: . whi h an be intrinsi or some other ounter dened by the \new ounter ommand (p. so it must be dierent from all other environment and ounter names. whi h is valid by having been dened by its own \newtheorem. and it denes a ounter. To further illustrate. \newtheorem{axiom}{Axiom} The Axiom of Choi e an then be stated thusly: Axiom 1 From any (innite) family of sets a new set an be reated that ontains exa tly one element from ea h set in the family. The environment reated by \newtheorem puts the text in itali s. so you see Theorem 5. The within option denes the ounter to be within some other. It was dened in the preamble as follows: \newtheorem{ orollary}{Corollary}[theorem℄ Note that this is within the theorem ounter. Then.1 The sum of ubes annot be a ube.

must be varied to en lose some expressions. One way is to pre ede math mode with a size ommand  for example. Whereas \left and \right ommands adjust the size of a mathemati al delimiter to t the en losed expression. \end{defn} Compare this with the following: Denition 5.5. For example. like parentheses and bra es.7 Renements 71 Denition 5. \end{mydefn} For more ustomization. 5. and \Bigg. however. There are.1 The ir umferen e of a sphere is the ir umferen e of any great ir le on the sphere. delimiter size ontrol ommands. in the text: \begin{defn} The ir umferen e of a sphere is the ir umferen e of any great ir le on the sphere. we an also enlarge these delimiters ourselves. {\large(}$E=m ^2${\large)} ) (E = m 2 ). This was reated by rst entering (in the preamble): \newtheorem{defn}{definition}[se tion℄ Then. the theorem pa kage enables a wide range of variations over the font style (among other things). .1 The ir le on the sphere. whi h apply to a single hara ter: \big. ir umferen e of a sphere is the ir umferen e of any great This was reated by rst entering (in the preamble): {\theorembodyfont{\rmfamily} \newtheorem{mydefn}{Definition}[se tion℄} Then.7 Renements Mathemati al delimeters. \bigg. in the text: \begin{mydefn} The \textit{ ir umferen e of a sphere} is the ir umferen e of any great ir le on the sphere. \Big.

but they are dierent. The same result with equation numbers is obtained by the gather environment. espe ially the thi knesses.V = H_0 \\ A(x) = \{y: \phi(y) = \ up_{a\in \ al A} \Psi(x)\} \end{gather*} Figure 55: gather* Environment Sour e (Result in Figure 56) (a + b)2 = a2 + 2ab + b2 L  M " V = H0 A(x) = fy : (y ) = [a2A (x)g Figure 56: gather* Environment Result (Sour e in Figure 55) . : : : . )hE = m 2 i. They behave like the eqnarray and eqnarray* environments. Huge$Bigg). This is more evident with the square and angular bra kets: $\Big[E=m ^2\Big℄$ {\Large[}$E=m ^2${\Large℄} h ) E = m 2 i . 69 for obtaining better multiple integrals).5 MATH MODE 72 $\big(E=m ^2\big)$ ) E = m 2  . \begin{gather*} (a+b)^2 = a^2 + 2ab + b^2 \\ {\ al L} \oplus M^\varepsilon . Figures 55 and 56 illustrate this. The gather and gather* environments allow the new line spe i ation. The use of text font environments omes lose to the orresponding math size. The remaining renements use the amsmath pa kage (introdu ed on p. respe tively. (large$big. \\. ex ept the equations are not aligned. $\bigg\langleE=m ^2\bigg\rangle$ {\LARGE$\langle$}$E=m ^2${\LARGE$\rangle$}  ) E = m  2 . in math mode. )[E = m 2 ℄.

5℄{5} \\ \end{array}\right| .7 Renements 73  When writing a matrix within text. The amsmath pa kage has a ommand to put dots a ross any number of olumns in an array. While the letters inside the matrix are approximately the smallmatrix size. (Note that there are no olumn spe i ations. the spa ing and parentheses are not the same.5. where spa ing determines the spa ing between the dots. in parti ular. Its syntax is \hdotsfor[spa ing ℄{n}. ( ) \left|\begin{array}{ } 1 & 2 & 3 & 4 & 5 \\ \hdotsfor{3} \\ & \hdotsfor{3} \\ \hdotsfor[2℄{5} \\ \hdotsfor[. For example.) This is not equivalent to pre eding the array spe i ation   with a text size environment. and n is the number of olumns it spans. we ould produ e a b d  by spe - ifying $\left(\begin{array}{ } a&b \\ &d \end{array}\right)$. An alternative is with the amsmath smallmatrix environment: a db is obtained by $\left(\begin{smallmatrix} a&b \\ &d \end{smallmatrix}\right)$. a b \s riptsize produ es d .

.

.

.

.

.

.

.

.

.

1 2 3 4 5 ::::::: ::::::: :::::::::: ::::::::::::::::: .

.

.

.

.

.

.

The \sta krel ommand lets us put hara ters over a relation: For def example. With more generality. = +1 $\overset{a}{X}$ $\underset{b}{Y}$ $\overset{a}{\underset{b}{Z}}$ This an be used to sta k subs ripts: a ) X ) Yb a ) Zb . the \overset and \underset amsmath ommands enable us to put any hara ters over or under any hara ter. n^+\sta krel{\mathrm{def}{=}n+1 )n+ n . For example.

and more pa kages to make things ni er. Figures 57 and 58 illustrate this. (Spe ify \usepa kage{ams d} in the preamble. The verti al arrows are spe ied by VVV (down) or AAA (up).) The horizontal arrows are spe ied by >>> (left to right) with any expression pla ed above or below. . Chapter 8℄. All possible horizontal and verti al pla ements are illustrated. an alternative is the \substa k ommand: $\displaystyle\sum_{\substa k{i\in I\\j\in J\\k\in K}} A_{ij}$ X Aij i2I j 2J k2K ) Another pa kage in the ams family is ams d. whi h makes it easy to draw ommutative diagrams. and you an see an online atalog of pa kages at CTAN [4℄.5 MATH MODE 74 $\displaystyle{\sum_{ \sta krel{ \mbox{\s riptsize$i\in I$} } {j\in J} } } A_{ij} = \underset{j\in J} { \underset{i\in I}{\sum} } A_{ij} $ ) X i2I j 2J Aij = X i2I j 2J Aij Nesting the \underset ommand an be unwieldy. Many of these are des ribed in The LATEX Companion [5. with an expression pla ed to its left or right. \[ \begin{CD} A >a>> B >>> C \\ \alpha VV\beta V \gamma AAA VVV\delta \\ D >>d> E >e>> F \end{CD} \℄ Figure 57: Commutative Diagram Sour e (Result in Figure 58) There are many more renements.

8 Grammar 75 A ? ? y.5.

= 4. Dene before use. As you read arti les noti e that those that are among the most onfusing are when the authors used a term that is not dened until pages later. note the olon before the display and the omma at its end.8 Grammar When writing mathemati al expressions. For example. we might see The distinguishing property of an abelian group is the ommutivity : : :  But a group had not yet been dened. LATEX does this automati ally. D a ! Bx ! C? ? yÆ ? ? d ! E e !F Figure 58: Commutative Diagram Result (Sour e in Figure 57) 5. v au bv . whi h is in orre t to omit. Pun tuate math display mode. if we write au bv . u. then tell the reader something + ( ) = + ( ) . 2. a gure appears after its rst referen e. Referen e obje t is lo ated after the referen e. The expression usually needs a omma or period. people make some ommon errors. The general guide is to treat a mathemati al expression linguisti ally. For example. v . and phrases are appropriately pun tuated. In English this means that every senten e has a subje t and predi ate. For example. For example. A symmetri rearrangement of a matrix has the following form: R = P t MP. An obje t has only one denition. we annot later refer to u. Here are some of the most ommon elements of grammar to onsider. 1. 3. lauses are separated by ommas. where P is a permutation matrix. Sometimes we dene the omplete obje t. but you might want to take ontrol over lo ating gures.

2Fn = Fn+2 2Fn+1 + Fn = 2Fn Fn+1: 3.5 MATH MODE 76  ( ) like. B . this is not orre t. however. 6. the se ond form is learer. when there is no risk of onfusion.' Exer ises. Produ e ea h of the following in math display mode. + ( ) x = (a) 0 otherwise. Be sure your name is on ea h. Produ e ea h of the following formulas in line with text ( onstru t your own senten es that ontain them. `If A.' B . C . Suppose A and C are expressions. 5. (a) (b) ln ex = x sinf + 2g = sin  . instead of uk . (b) If Fn+1 = Fn . `A if and only if should be written as `A if. 2. and the omma is used to larify where the ante edent (A) ends and the onsequent (C ) begins. then C . p x2 = B 2 4AC implies x =  B 2 4AC . Submit a printed opy of the LATEX sour e (tex le) and of the asso iated posts ript result (ps le). If either A or C are ompound. C . and in lude proper pun tuation). We shall use k . In English. The overriding prin iple is larity. The expression. and it is important that the reader be told of this. If : : : then : : : is not orre t.' or `Suppose A.' seems like it ought to be all right.) 1.' The rst form is preferred if A and C are simple expressions. and only if. Produ e the following in math display mode with the array environment and/or with the eqnarray* environment. (Lookup spe ial symbols in the Appendix. it follows that 2 Fn+1 = Fn . The form.  x if x  0. Then. Equivalen e needs ommas. v k . We an write either `If A.

8 Grammar = Pin=i10 xi ) yn+1 ( ) yn (d) 1 X f (x) =  (e) x (f) 77 n=0 Z x2 a f (n) (0) yn = xn xi0 xn n! f (y )dy = 2xf (x2 ) MFe(H2 O)6 = 6MH2O + MFe 4.  1:1 1:2 1:3  +  a1 2:1 2:2 2:3 b1 a2 a3 b2 b3  =  Æ  . Produ e the following equation in math display mode.5.

1. : : : z }| { ~ 1 + . 7. Produ e the expression in the Prefa e. Produ e ea h of the following expressions: (a) (b) x = y mod n def = x y = kn for some k = 0. 6. :   5. Produ e equations (5) and (6).

(a) (b) ? A = fS 2 S : S 62 S g p jF  Pj   0 . Produ e ea h of the following in line with text (that you ompose) and in math display mode.~ 2 x| 2 {z + y}3 8.

.

.

B .

B ( )  a11 a12 a21 a22 CB BC .

1

Produ e ea h of the following formulas in math display mode (with pun tuation): . C C A 9.

C T x)T . Produ e the following symbols: (a) Extended reals: R 1 . ) = p Za 3 ( x 13 + a)2 dx. )T = (0. . ( ) Complex n-ve tors: C n . onditional assignment (with array environment). 10.   A B 0 C  (0. 3 V= 2 0 xT xT  0  xT C = (0. f (x)=xj g if xj = aj if aj < xj < bj if xj = bj 11. (d) Non-negative rational n-ve tors: Q n+ . Combine your knowledge of derivatives. and mathemati al symbols to produ e the following ( alled the trun ated gradient ): 8 > > > > < maxf0. f (x)=xj g r+f (x)j = > f (x)=xj > > > : minf0. (b) Stri tly positive integers: Z++.5 MATH MODE 78 (a) q  (G)  max (b) ( )  2 m(GA ) (G).. pA 1 if G 6= .

f (x) .

12. Produ e the following: xj .

. What is grammati ally wrong with ea h of the following segments. . x=x 13. (a) A key is how to add velo ities the formula is (u +uvv) 1 + 2 where is the velo ity of light.

The following is tri ky to get the evaluation expression. then n < 3. where A is an m  n matrix and b is an m-ve tor. z 2 Z+ and xn + y n = z n . Figure 1 (above) shows how to add velo ities simply as ve tors. Adding velo ity ve tors: u + v. You are to produ e the mathemati al expressions shown in math display mode. 14.5. u u+v v Figure 1. y. (e) Theorem If x. right size and lo ation. Now suppose y (! ) is spe ied and we want to nd x. . The remaining exer ises are more di ult. (d) Now we onsider adding velo ities. ( ) Let x be an n-ve tor and ! a s alar. and dene y = Ax !b.8 Grammar 79 (b) A result of these assumptions is the following equation E = m 2 Einstein rst noti ed this equivalen e between energy (E ) and mass (m).

= (1=22)v 1=4 + 1: 2 .

d f (x + tr+ f (x)).

.

2 a b d e 1 1 A = 26 6 1 34 0 4 0 t = 12 to be the 0 1 1 0 0 0 1 1 0 1 0 1 13 0 77 05 1 . dt t= 1 15. Note the row and olumn labels outside the matrix.

Use a pa kage to import some standard graphi s le. but I do not provide a omplete list of the relevant pa kages (see CTAN [4℄ and The LATEX Companion [5℄). notably the pi ture environment. as follows: . Column pointers:  12  22 " A = 11 21 " olumns olumns in 1 in 2 18. Row and olumn pointers:  A = 11 21 " 12  22 " rows in 1 rows in 2 olumns olumns in 1 in 2 6 Graphi s Graphi s may be part of a LATEX do ument by one of three ways: 1. 2. Use standard LATEX 2" ommands. 6. 3.1 Pi ture Environment If all we want is a series of boxes and arrows. I illustrate ea h. Row pointers:   11 12 A = 21 22 rows in 1 rows in 2 (this arrow is loser to matrix) 17. Use a graphi s pa kage to draw within the do ument.6 GRAPHICS 80 16. we an do this simply with \fbox and a long arrow in math mode.

but it has an optional argument to align its top or bottom with the text. but there is a need for more versatility. like ovals and diagonal arrows. given as 2 m for ea h box. respe tively. This is done by spe ifying \parbox[t℄{width }{text } or \parbox[b℄{width }{text }. Combined with bottom \framebox. top like middle (note how the paragraph spa ing adjusts). However. \begin{ enter} \parbox{2 m}{ \framebox[2 m℄{top} \\ \ enterline{$\downarrow$} \\ \framebox[2 m℄{middle} \\ \ enterline{$\downarrow$} \\ \framebox[2 m℄{bottom} } \end{ enter} Figure 59: Verti al Diagram Sour e (Result in Figure 60) The box reated by \parbox has its enter aligned with the text. \framebox also has two optional arguments to ontrol the length of the box and the position of the text within it. The se ond optional argument is the position of the ins ribed text: l = left. as illustrated in Figures 59 and 60. The rst optional argument of this \framebox ommand is the width of the box. For example. it lets us sta k short phrases.1 Pi ture Environment 81 \fbox{left}$\longrightarrow$\fbox{ enter}$\longrightarrow$\fbox{right} ) left ! enter ! right The \framebox ommand an be used instead of \fbox to produ e the same result. and r = right. and more . along with other box ommands. = enter.6. These ommands an be ombined. we an reate verti al diagrams easily. We an make the ontents of a box obey all paragraph ontrols in text mode by the \parbox ommand. By itself. \framebox[2 m℄[l℄{left}$\longrightarrow$\framebox[2 m℄[ ℄{ enter}$% $\longrightarrow$\framebox[2 m℄[r℄{right} ) left ! enter ! right The % at the end of the rst line is to avoid having a blank between the enter box and the $\longrightarrow$ that follows it.

Going through its parts will serve to explain the various ommands. whi h was reated by the pi ture environment.6 GRAPHICS 82 top # middle # bottom Figure 60: Verti al Diagram Result (Sour e in Figure 59) ontrol over positioning. To begin. A basis for this is the pi ture environment. whose sour e is shown in Figure 62. v top left m? 1 - enter a b bottom right ZZ   Z -~Zoval   . Figure 61 shows a more elaborate hart.

The x. Æ Figure 61: Variety of Obje ts in Pi ture Environment The rst ommand begins a enter environment. where stu an be text or some pi ture obje t. The omplete syntax is: \put(x. and the default for the pi ture environment is 1 pt. or ^ it ould be in the middle of a senten e. as in beginning a paragraph with \noindent.) The lled ir le shows where (0. Every pi ture ommand begins with \put. The parameter that determines this is \unitlength .0) is in this pi ture. whi h is not des ribed here. Then. (There is an alternative way to begin the pi ture environment. it ould be a olumn in a table dened within the tabular environment. we enter the pi ture environment stating that the point of entry is the origin. This ould be at the left margin.0). This means that when I spe ify some length = 5. indi ated by the oordinates (0. just as the smiley fa e appears here (see ( ) ph . and I use the \setlength ommand to set the units of measurement to be 1 in h. I am spe ifying 5 in hes.y ){stu }. whi h is ex lusively for the pi ture environment. y oordinates are relative to where the position is when the pi ture environment is entered.

01}(.43}} \put(1.-. -1){\oval(.-. The next dashed .32.35){\ve tor(1.7.05){1} \put( 1. The next \put puts a dashed box.35..3)[br℄{bottom right} } \put(-.0){.0){.2.3}} \put(-.-. The rst \put in Figure 62 spe ies the position at the origin.6.1 Pi ture Environment 83 \begin{ enter} \setlength{\unitlength}{1in} \begin{pi ture}(0.1}(1.5){\ve tor(4.-1){. but its syntax is dierent.01 in hes. having the same dimensions as the framed box.-3){.-.55.5){\ve tor(0. and the stu is a lled ir le with diameter .5){\framebox(.0){.55}} \put( 0.5}} \put(-.0){.85.-1){\ve tor(1.0){\ ir le*{..2}} \put(-. The general form of the \framebox ommand in the pi ture environment is as follows: = 5 \framebox(width .55}} \put(.-1.7 in hes and height = .5){\dashbox{.height )[posn ℄{text } In the example shown in Figure 62.3975}} \end{pi ture} \end{ enter} \vspa e{1in} Figure 62: Sour e for Figure 61 Exer ise 1). 0){\ ir le*{.. the spe i ations are width = .-1){\ve tor(-1.-1){\ve tor(1.65. with the length of the dash set to . but also the height. In pi ture mode it enables ontrol over not only the width.25)} \put(.3){ enter} } \put(-1. b = bottom.5. The rst is similar to \framebox in text mode..895){\line(1.1){. and this extends the position options to a se ond hara ter: t = top. y : ).1 in hes ( entered at the origin): \put(0.4}} \put( .3)[tl℄{top left} } \put( 1.-1.2.5 in hes below the origin (i.-1){\fbox{$\begin{array}{ }a\\b\\ \end{array}$}} \put(-.1}} \put( 0.-. the position is entered be ause that is the default.5){\dashbox{.1}} ) v The next three ommands put three dierent kinds of boxes.7.e.3 in hes.3. -1){\ ir le{.65..-.7. ea h beginning at .0) \put( 0.-.05){oval} \put(0.

itself. if x 6 . whi h is entered. only its sign matters). y0 ) along the line with slope x until the new x- oordinate is y . (from \put). If y .2 in hes.y ){len } If x . [br℄. we annot in lude the entering of text within the ir le ommand.5 measures the entire width: ( 65 1) ( 65 1) 5 25 '  & width $ 6 . Otherwise. Both \ve tor and \line have the same syntax: \line(x. The a tual length of x0 + len. The same applies to the \oval spe i ation. This is undoubtedly onfusing. the line is verti al. The new point is determined by moving y from (x0 . Now the ode begins to draw the ve tors. the line is horizontal. but that is not where we want to put the ins ribed text to be entered. . lo ated at oordinates : . and len is the amount of hange above or below the original point (it does not matter what the magnitude of y is. This is the same as I used in text mode.y ){len }  =0 \ve tor(x. and the text is at the bottom right be ause of the optional spe i ation. only its sign matters). resulting in fewer dashes to ompose the box. Unlike the box family. the a tual  =0    =0  y hange in x is still len.1 in hes. The oval. . whi h are lines with arrow heads.2 in hes. so onsider Figure 63. dened as usual in math mode: the array has three rows and one olumn. Then. followed by putting text that required some trial and error to lo ate. with diameter = . ex ept here I use it to frame an array. the new y - oordinate is y0 + len  x r 2   y the line segment is len 1 + x . and some trial and error was needed to establish its position.height ? % After the \oval spe i ation. and len is the amount of hange to the right or left of the original point (it does not matter what the magnitude of x is.6 GRAPHICS 84 box has the dash length set equal to . Now we ome to the \ ir le spe i ation. and the slope of the line is x . where . We know the enter of the ir le is at : . The 1 inside the ir le required another \put. The box length is set to 1. has dimensions :  : (in hes). I use the \fbox ommand.

len jyt y0 j. we ould have problems with approximating the results. if yt > y0 otherwise. y must be integer-valued and within to 6. y0 . The rst \ve tor ommand in Figure 62 starts at : . If we we set len : to obtain the orre t x- oordinate. ( 65 1) . but trial and error in sele ting the parameters tends to be just as e ient. and we want our destination point to be xt . then sear hing for a nearest slope approximation. yt . = If xt 6 x0 . y0 : . whi h I al ulated to be from the top left box to the  enter box. there is an important restri tion: x. Suppose our original point is x0 .6. yt x0 : . we would set x . for example. We ould setup a leastsquares estimation problem. The y ( ) = ( + 1 3 + 1 5) =13  = 13  15 losest we ould ome is 45 . . If xt x0 . Suppose. is not ne essarily the best overall approximation. but the restri tions do not permit this. the al ulation is simple: set x . and ( ) =   ( y =  6 ) 1 1  =0 = .1 Pi ture Environment 85 y0 + y slo pe = xy b y y0 + len  x New point b Original point y0 b x0 + len x0 x0 + x Figure 63: Line Parameters As if this unnatural denition of the line segment were not enough. we want xt . we have some work to do. Either way. how should we set the slope parameters? Ideally. Fixing len = xt x0 .

: . y0 . so x and y . as spe ied with \ve tor(1. Finally. the verti al position hanges by moving up half of the height. y0 and h height. The left end point is at the y - oordinate of the enter of the ir le.-. y yt r : . so x : : . : and h : . we need to determine the length. whi h is 12 : sin e . That box begins at . That the arrow begins ( alled its tail ) is :. by omputing the oordinates of the tail and head. : 2: a ounts for the initial position given by \put(-. this involves more al ulations be ause the arrow is not simply horizontal or verti al. spe ied as {. but drawn right to left.2}. It required these omputations to determine the omplete pi ture ommand: \put(-. In this ase. then an arrow at the same end points.3.2 is the diameter spe ied by \ ir le{. The ir les y oordinate is : . whi h is what is spe ied: = 3 = 35 ( 3 5 + 3) = ( 3 35)  =1  =0 (0 5)  = 0 ( 3) = 3 ( )=( + ( ) ) = ( 1 5) ( )= ( ) = = 3 ( 1 + 3 5) = ( 65 5)  =0  0 65 ( 2) ( )=( + ) = ( 65 1 ( 5)+ 1) = ( 65 4) = =4 top left m ? ( nve tor(0. the position of the arrowhead is xh . so the right edge of that box is at x : . so the oordinate where 1 : . drawn left to right.7. 2: . and its width is . and its x- oordinate is to the right by the length of .-1){. : . whi h is a verti al arrow from the same box to the ir le below it. Now onsider the next \ve tor. .-. We want the oordinate of the end of the arrow ( alled the head ) to be ush to the left side of the  enter box.0){. Sin e the arrow is downward. : : : . whi h is its enter. Thus. : x and y < .3}}. and we set len j y j : . so we obtain the oordinates of the arrow's tail: xt . x0 . yh xt .3}. We begin the same way. given by \ve tor(0. : . as spe ied. The initial position is al ulated simply as the midpoint of the bottom edge of the box: x. where the box starts at x0 . y0 :.0). Further. The length is determined by where we want the arrowhead: at the top of the ir le. The arrow is to be horizontal. y x0 12 h. so we use two \ve tor ommands to draw one arrow left to right.86  box begins here ! width - 6 6 GRAPHICS height ? ( 1 5) In Figure 61 the top left box starts at . yt 1 : .35){\ve tor(1.4} 1 The next arrow is double-headed.35).-1). We must add the radius. Starting at y : . : .3.

1){. y1 x r. : . whi h is why we have \ve tor(-1. 128) gives the ommands in the pi ture environment. Some al ulations and some trial and error are needed to align obje ts and lines. The last ve tor also required trial and error. so that is where we \put the rst arrow. The losest slope we an have is with x. and there is very limited ontrol over line thi knesses. : and has a width of 1. There is a better way! .0){. . : to : . but the latter was omputed by knowing that the bottom right box starts at . whi h is what is spe ied. Moving a portion of the pi ture an be tedious. we know only that the enter of the box was put at . the end point was determined to be x . alled Bezier approximations. Now the true slope of the line we want is : : . due to not having the orner of the oval oordinates. The reverse arrow begins at . p. There are pa kages to extend the pi ture environment.6. to a set of points. Table 46 (in the Appendix. There is no dire t way to ontrol the size or style of the arrow heads. These an make using the pi ture environment time onsuming and rather unpleasant. With just a few iterations. . so len x : . The former was found by trial and error. the best hoi e of len an be found as the average of the deviations: (0 1) (0 1) (1 2 895) (1 5) (1 6 5) =0 ( 1 0) =  = 55 (1 6 5) 395 4 (  ) = (1 1) len = 12 (:4 + :395) = :3975: Thus. and this needs some trial and error.2. we spe ify \line(1. and its slope is . but the restri tions do not allow this. the end points were determined to be from : . : . but here are some things to note:     Only boxes an have ins ribed text. so the midpoint of the bottom edge is at : . y . : . . and we an plot urves.1 Pi ture Environment ( )=( + 87 ) = ( 65 + 1 1) = ( 55 1) the radius: x1 . whi h an take some trial and error to position. . the ir les and ovals require separate \put ommands. but we do not know the width of the box. I shall over these in the next se tion with a powerful pa kage alled PSTri ks. In this ase. requiring re- al ulations and more eort for the new positions. . y : :. The head is to be ush with the left edge of the \fbox. However. The un ertainty is the width of the box. Given this slope.3975} to obtain the line shown in Figure 61.55}.

Obje ts an be named (as nodes ) and lines and arrows an be drawn between them by naming the tail and head. 7℄. and slopes need not be al ulated. see [4℄) does not work with PSTri ks.) One thing you need to know is that not all of the pst results an be seen with a dvi viewer. This is espe ially true of ommands that involve rotations. but it does with MetaPost.        Cir les and ovals. in whi h ase you spe ify the parts you use instead of pst-all  see [14℄ for loading individual portions.6 GRAPHICS 88 6. Some require onverting to posts ript and viewing the ps le. written by John D. an have ins ribed text. Arrow heads are adjustable. (It is not standard with MiKTeX. Here are some of the features of PSTri ks that I shall illustrate. . Lines and arrows have the same ommand. some of whi h were listed above. in addition to boxes. and Bezier approximations of four points are available. that do many of the things done by PSTri ks (and some additional things). Shapes are highly variable.2 PSTri ks PSTri ks [14℄ was written by Timothy Van Zandt. for short) is designed to over ome di ulties with using the pi ture environment.) In the preamble spe ify \usepa kage{pst-all} for the entire system. espe ially on varying the types of le outputs (PSTri ks is tied to posts ript). In parti ular. and is provided free of harge. but you an obtain it at CTAN [4℄. Another widely distributed pi ture-drawing system is MetaPost [6. (You an use parts. pdflatex (not overed here. whi h makes it potentially more versatile. PSTri ks (pst. in luding plots of points that an ome from a data le. but MetaPost is more open-ended in its design. identifying any of a great variety of arrowheads simply. Many of these are des ribed in The LATEX Companion [5℄. typi ally available free of harge. Hobby. Drawing urves is simple. also provided free of harge. Only one ommand is needed to put lines through a sequen e of points. thereby eliminating the need for al ulation or trial and error. It is more di ult to learn than PSTri ks. There are many pa kages [4℄.

shown in Table 20. like boxes and ir les.1 m. we an spe ify relevant options as [parameter = value ℄.2 PSTri ks 89 All of the pst ommands have options to override default settings for relevant parameters. For example. an spe ify where to put them.6. The User's Guide [14℄ is freely available and learly written.) The pst gures are drawn after spe ifying \psset{unit=1mm. themselves. I an put that ir le right here: All ommands use the linewidth parameter to ontrol the thi kness of the lines used in the drawing. line olor. so many features are not presented here. and the default ll olor is white. to produ e a solid ir le with radius . this is not the only way to put obje ts. : : : ℄}. the default unit of measurement is 1 m. For example.fill olor=white}. we do want the \rput ommand in order to put text into various obje ts. The origin is determined by where you are when issuing a pst ommand. (As usual. I shall illustrate the ommands in Table 19 rst. For ea h ommand. then I shall show some additional shapes and ommands. and obje ts that ould be made solid. no environment is entered. alled framesep=len. The ommands. and fill olor. For those examples. entered at the origin. This is meant to be an introdu tion. For example. Table 19 gives some of the ommon ommands to draw obje ts and lines. A parameter used by these ommands is the distan e between the border and the text inside. In using these ommands. The idea of a box is to have some shape en lose text.1} (having already set fill olor=gray). themselves. linestyle. Thus. we obtain this oval by writing: : : : we obtain \psovalbox{this oval} : : : .0){. but we an hange them by spe ifying: \psset{unit=1in. where the default value of len is 3 pt.fill olor=gray} A fundamental ommand in pst is \rput. PSTri ks extends the re tangle in \framebox by having a variety of shapes. the unit of measurement was set to 1 mm. use the fillstyle parameter. an be set with the \psset ommand: \psset{parameter = value [. but unlike the \put ommand in the pi ture environment. we write \ps ir le[fillstyle=solid℄(0. The defaults. other parameters in lude linewidth. showing the ease and versatility of PSTri ks. These ommands an be used in the text.

y0 ) : : : (xn . yn) Draws losed polygon with given oordinates.0){2} psellipse(x.0)(5.0) <-> double arrow' <. y ) with radius = r. y1). npsline{|-*} (0. y1 ) npsframe(0.2) Draws re tangle with a orner at (x0 .1)(10. y with horizontal radius = rx and verti al radius = ry psline{a}(x0 . y0) and opposite orner at (x1 .-2)(1. Table 19: Some Basi Drawing Commands in PSTri ks Boxes need not be en losed (like \makebox). Draws ir le entered at (x.no arrow. same as \psline{-} : : : .0)(10. y ){r} nps ir le(5.-3) line from (xn . npsline{<->} (there are more!).-2) ps ir le(x. npspolygon(0. and they an be s aled by spe ifying one of the following: \s alebox{size}{stu} \s alebox{width . y0 ).0) ex ept gure is losed by drawing (0. yn) Draws line or arrow.-2) pspolygon(x0 . y )(rx .ba kward arrow. y0 )(x1 .height}{stu} Here are some examples: s ales stu keeping the same aspe t ratio s ales the width and height individually . y0 ) : : : (xn .0) oordinates.0)(5. yn ) to (x0 . determined by a: . npsline{-}(0. -> forward arrow.0)(10.-3)(6. along path given by (0.6 GRAPHICS 90 psframe(x0 . ry ) npsellipse(3. ( ) Draws ellipse entered at x.

6. Here is how: \rotateleft{Left}\rotatedown{Down} \rotateright{Right} Down .5}{\ps ir lebox{ \begin{tabular}{ } Halving \\ the \\ ir le \end{tabular} } } Halving the ir le Doubling Tall \s alebox{2}{\psframebox{ \textsl{Doubling} }} \s alebox{1 3}{Tall} Wide \s alebox{3 1}{Wide} Right Left There are times when we want to rotate stu.4℄{framebox} psshadowbox{stu} Adds shadow to psframebox shadow added \psshadowbox{shadow added} psdblframebox{stu} double frame Draws double frame \psdblframebox{double frame} ps ir lebox{stu} ir le Draws ir le around stu \ps ir lebox[linewidth=2pt℄{ ir le} psovalbox{stu} oval Draws oval around stu \psovalbox[linestyle=dotted℄{oval} Table 20: Boxes in PSTri ks \s alebox{.2 PSTri ks 91 psframebox{stu} Draws re tangle but ould have rounded orners framebox \psframebox{framebox} framebox \psframebox[framear =.

node separation an be spe ied for either end point. in luding variations of arrowhead shape. Consider the following example: Node A Node B Node C The sour e ode is shown in Figure 64. by themselves and as en losures for boxes.6 GRAPHICS 92 One appli ation is given by the following: Who is the founder of TEX? Who is the founder of \TeX? \rotatedown{Answer: Donald E. the \rput ommand puts a node. using PSTri ks. In general. by spe ifying nodesepA=n. or nodesep=n. or for both end points. the named obje ts are alled nodes. The name is set to A. In PSTri ks. After entering the entering environment and setting the default units of measurement. ea h en losed with a frame. To avoid the tedious al ulations in lo ating the oordinates of the tail and head. The [nodesepA=3pt℄ option gives 3 pt separation between the end of the line and node A. the obje ts being joined an be referen ed by name. Knuth} Answer: Donald E. nodesepB=n. with the \rnode ommand. The separation is exaggerated to 5 pt in the arrow from node C to node A. whi h is what we want when the nodes are en losed boxes. (Try adding one line at a time and observe ea h ee t. like B and C. These an be onne ted by \psline. Knuth So far I have des ribed a variety of shapes. and the text Node A is put there (with no frame).) . Its sour e. the line would tou h Node A text. with a great variety of styles. The \n line ommand has the same arrow options as \psline. Otherwise.) Figure 66 shows a graph that ould represent any number of things. is shown in gure 65. The default value is nodesep=0pt. (nodesepA and nodesepB are keywords and have nothing to do with the names we assign to our nodes. but with the following syntax: \n line{a}{name of node A}{name of node B } The rst \n line in Figure 64 draws a plain line from node A to node B. whi h is not what we want. The syntax for \rnode is: \rnode{name }{stu } The next two ommands put nodes named B and C. respe tively.

2 PSTri ks 93 \begin{ enter} \psset{unit=1 m} \rput( 0. 0){2}{2} \ nodeput( 2.2.loopsize=.-1){4}{4} \pnode(-3.5in} Figure 64: PSTri ks Sour e for Conne ting Nodes \begin{ enter} \psset{unit=1 m} % Nodes \ nodeput(-2.-1){\rnode{B}{\psframebox{Node B}}} \rput( 2.loopsize=.arm=.6.5. 0){1tail} \n line{->}{1tail}{1} % tailess ar into (1) % Ar s (with labels) \n line{->}{1}{2} \aput{:U}{1/2} % \aput puts label above ar \n line{->}{2}{3} \aput{:U}{2/3} \n line{->}{2}{4} \bput{:U}{2/4} % \bput puts label below ar \n ar {->}{3}{4} \Aput{\small 3$\rightarrow$4} % \Aput keeps \n ar {->}{4}{3} \Aput{\small 4$\rightarrow$3} % label horizontal \n loop[angleB=180.-1){\rnode{C}{\psovalbox{Node C}}} \n line[nodesepA=3pt℄{A}{B} \n line[nodesepA=5pt℄{<-}{A}{C} \n line{<->}{B}{C} \end{ enter} \vspa e{. 1){3}{3} \ nodeput[doubleline=true℄( 2.2℄{<-}{4}{4} \Bput[5pt℄{loop} \end{ enter} \vspa e{1 m} Figure 65: Graph Sour e (Result in Figure 66) loop 1 1/2 2/3 2 3 4!3 2/4 3!4 4 loop Figure 66: Graph Result (Sour e in Figure 65) .linear =.2℄{->}{3}{3} \Bput[5pt℄{loop} % \Bput keeps label horizontal and 5pt is % the spa e added between label and ar \n loop[angleA=180.linear =. 0){1}{1} \ nodeput(0.5.2.arm=. 0){\rnode{A}{Node A}} \rput(-2.

y1 ).0) \parabola*[fill olor=bla k. and (x1. whose ommand syntax is: \parabola{a}(x0 .gridlabels=7pt℄(-1.6 GRAPHICS 94 Now I des ribe urves that go through.-1) b b b The Bezier urve joins two end points and omes as lose as possible to two intermediate points. For example. b2 + ) The following shows two ommands: ps urve and ps urve. y1) is the (unique) point dy=dx = 0.griddots=10.showpoints=false℄(1. given points.3) 4 ) 3 2 1 0 -1 0 1 b 2 3 4 Question: What is the pst ommand to draw the parabola given by y = ax2 + bx + . the latter being a losed urve that joins the last point with the rst. y0) is one point on the parabola. where a 6= 0? Answer: nparabola (0. y0 )(x1 .1)(2.0)(1.showpoints=true} (The showpoints=true setting is what auses the points to be in luded in the pi ture you see.5 m.-1)(-1.4) \parabola{<->}(4.0)(4. where having \psgrid[subgriddiv=1.1)(1.3)(2.-1)(-1.1)(-1.0)(1. The ommand syntax is: . )( 2a b 4a . The examples that follow use the following pst settings: \psset{unit=. perhaps approximately.-1) b b b \ps urve(0. (x0 .1)(-1.1)(1.) We begin with the parabola. \parabola* spe ies lling the parabola. b b \ps urve{(->}(0.

whi h I shall explain.8)(39. 7){\textsf{A}} Figure 67: Sour e Code for Drawing Histogram of Test S ores .2)(19.17) \rput[r℄(60.dy=5.1)(3. y1 )(x2 . or nothing around ea h pair. Mathemati a . Maple . perhaps produ ed by mathemati al soft .) +50 15 10 5 0 50 C B F b b b 60 D b b A b b b 70 b 80 b b 90 b b 100 s ore \psset{unit=2mm.0) \rput(35. y0 )(x1 .0)(40.-2){\large s ore} \psline(1. showpoints=false} \fileplot[plotstyle=dots℄{mydata. The data le had y = number of students with test s ore = x . (The oset of 50 was used in establishing the origin in the plot. y3 ) b b \psbezier(0.8)(39.0) \rput(45.Dy=5. MATLAB . 4){\textsf{D}} \psline(20. and . bra es.dat} \psaxes[Ox=50.6)(10. whi h an be separated by a omma or just blank and an have parenthesis.Dx=10.dx=10.6)(10.0)(30.2)(19.3)(2.0) \rput(25.5)(50.Oy=0.ti ks=y℄{<->}(60. 8){\textsf{F}} \psline(11.13){\textsf{C}} \psline(30.11)(29.5)(50.2 PSTri ks 95 \psbezier[parameters ℄{a}(x0 .11)(29.0) \rput( 5. y2 )(x3 .0)(1.0) \rput(14.10){\textsf{B}} \psline(40. O tave ware like gnuplot S-PLUS .0)(11. The following histogram was plotted by the sour e ode in Figure 67.0)(1.0)(20.4) b b We an read data from a le.6. The data le just needs pairs of oordinates.

Here is one of the alternatives: \fileplot[dotstyle=+.2. If x1 . (Setting showpoints=false suppresses plotting the points in the \psline ommands.90) [90.dat} + + + + + + + + ) + + + + + Next.70) [70. su h as plotstyle=line. if x0 . axes are superimposed with the \psaxes ommand: \psaxes[params ℄{a}(x0 .80) [80.0)(8. spe ied by plotstyle=dots.1) 2 1 ) 10 1 2 . x1 . itself.dat 5 2 9 4 15 2 18 1 22 6 27 4 30 2 31 1 35 4 39 1 40 2 45 2 50 1 % % % % % F D C B A = = = = = [0.3) ) 2 1 ) 0 0 1 2 3 \psaxes[unit=. and there are 11 dot styles.6 GRAPHICS 96 After setting the units of measurement to 2 mm.0)(-1.plotstyle=dots℄{mydata. y1 is the Southeast orner.1. . There are other plot styles. the data le is read and its points plotted with the \fileplot ommand. the origin is assumed to be at . and x2 .1.0)(2. y0 )(x1 . y2 is the Northwest orner.100℄ The plot. y1 )(x2 . y0 is the origin.) The data le is plain text and has the following entries: % This is mydata. y0 is absent. y1 is absent. y2 ) ( ) (0 0) ( ) ( ) where x0 . it is assumed to be equal to the origin.5 m℄{->}(4. is just the points. Here are some examples: ( ) ( \psaxes[unit=.65) [65.5 m℄{->}(0. As in \psline.

in luding many examples. (60 2) . The other parameter settings are des ribed in Table 21. . (The default values. See [14℄ for lots more. but this does not exhaust the PSTri ks ommands.6. this is s aled (simply. The remaining ommands draw the histogram boxes and put the letter grade above ea h box in sans serif font. Leaving o the s ore. we obtain the data plot.) Horizontal Verti al Default Meaning Ox=n Oy=n 0 Label at origin Dx=n Dy=n 1 Label in rement dx=n dy=n 0 Label spa ing Table 21: Parameters for \psaxes The next ommand. ush right (indi ated by [r℄) at the oordinates . when I superimpose the ommands \fileplot. by spe ifying \psset{unit=1mm}): We shall stop here. Thus. This is suppressed for the x-axis in Figure 67 by spe ifying the option. dx=dy=0.-2){\large s ore} puts s ore in large font. ti ks=y. Figure 68 shows the sequen e of how ea h \psline and \rput adds to the pi ture.2 PSTri ks 97 Note that ti ks are uniformly spa ed on ea h axes. ause the spa ing to be equal (approximately) by using Dx\psxunit and Dy\psyunit. rput[r℄(60. To t the pi ture and the ode next to it. \psaxes and \rput. respe tively.

4){ntextsf{D}} C 15 10 bb b 80 15 10 b bb 90 B b bb 80 b b b 100 A bb 90 b b npsline(40.6)(10.Dx=10.0) nrput(14.ti ks=y℄{< ->}(60.0)(11.5)(50.0)(20.6)(10.0) nrput(5.Dy=5.dy=5.Oy=0.0) nrput(25. b b b b 60 70 bb b 80 dx=10.13){ntextsf{C}} b 100 npsline(30.8)(39.8){ntextsf{F}} b 100 15 10 F 5 0 b 50 b Db 60 b b 70 F 5 0 b 50 b Db 60 F 5 0 b 50 b 70 5 0 b 50 bb b 90 b Db b b 100 b 70 60 Db b 70 b 90 bb b 80 b bb npsline(20.11)(29.6 GRAPHICS 98 b b b b b b bb b bb b nfileplot[plotstyle=dots℄{mydata.0)(1.5)(50.0) nrput(45.17) bb b 90 b 100 15 10 F 5 0 b 50 b b b b b 60 70 bb b 80 bb b 90 npsline(1.dat} b 15 10 5 0 b 50 b npsaxes[Ox=50.0) nrput(35.7){ntextsf{A}} 100 Figure 68: Sequen e of PSTri ks Commands to Draw Histogram .2)(19.11)(29.8)(39.2)(19.10){ntextsf{B}} B b C b b 80 C 60 F b b 15 10 bb npsline(11.0)(40.0)(30.

in luding histori al ontext. as spe ied in the preamble by \usepa kage{graphi x}.wis . Mathemati a are also ommer ial systems.) Many systems that let us draw gures. O tave extends the apabilities of gnuplot and is also available free of harge. at http://www. Figure 69 shows a gure that was imported with the following statement: \begin{ enter}\in ludegraphi s[s ale=. is given by Keith Re kdahl [12℄. whi h an produ e eps les of plots. MATLAB . xfig is an ex ellent system to draw gures. in luding bitmap (xbm). whi h prints the gure half the size it was produ ed (in this ase by MATLAB.5.edu/o tave/. There are free onversion systems on MS Windows.edu/pub/gnuplot/.5℄{sin.3 Importing pi tures 99 6. An ex eptionally lear des ription of this. and the export options in lude the eps le format. whi h onverts Windows Metales (wmf) to eps. simply spe ify \in ludegraph s[options ℄{lename }. whi h onverts jpeg les to eps. Carlisle. \ps2epsi. Here I use graphi x. and those that plot mathemati al fun tions or data. notably jpeg2ps. like Maple S-PLUS . dartmouth. On e the le is in eps format. and emftoeps. is gnuplot. This is available free of harge at FTP://ftp. There are two pa kages that provide essentially the same apabilities but with dierent syntax. and . The unix systems xv and Image Magi k an do this for a large variety of graphi le formats. or there is a unix onversion utility. To in lude an eps le. have an option to export an eps le. we an import it using the Graphi s Bundle [3℄.eps}\end{ enter} In this ase I spe ied the option. For example. he. provided free of harge. (If you an get a ps le. It omes with MiKTeX and basi unix installations. s ale=. you ould use \psfig. There . One is alled graphi s. by spe ifying print sin -deps . written by David P. A basi plotting system for fun tions and data. the other is graphi x. Another way to obtain an eps le is with onversion. (He also goes deeper into ustomizing pla ements of pi tures in gures.) On unix.3 Importing pi tures The way to import a pi ture into LATEX is to onvert it to en apsulated posts ript (eps). for both unix and DOS that produ es eps les. gif and jpeg les.6.

height=1in℄{sin. The height spe i ation (!) says to maintain the aspe t ratio.4 0.8 0. by Mi hael C.4 −0. read about the PSfrag pa kage.2 −0. whi h omes with a basi installation (in luding MiKTeX).2 0 −0.2 −0.4 −0. .8 −1 −8 −6 −4 −2 0 2 4 6 8 Figure 69: Applying \in ludegraphi s to Import an eps File after plotting the sin fun tion over the indi ated grid). and let it ll the entire width of the page.6 GRAPHICS 100 1 0.6 0. we might want to spe ify width=\textwidth.2 0 −0.eps} \end{ enter} 1 0.8 0. Grant and David Carlisle.4 0.6 −0.6 0. If you nd yourself importing eps les but would like to make some hanges in LATEX. Figure 70 shows the same eps le.height=!.8 −1 −8 −6 −4 −2 0 2 4 6 8 Figure 70: Spe ifying Dimensions in \in ludegraphi s For a very large pi ture. but with the width and height set as follows: \begin{ enter} \in ludegraphi s[width=2in.6 −0.

with eps les produ ed by MATLAB and xg. It an also perform s aling. Although it is feasible to perform the operation after importing a graphi . The box ould ontain text.e.3 Importing pi tures 101 whose do umentation is at CTAN [4℄. It has two basi operations: (1) edit some string or position in the gure (i. Importing graphi s is only one of the fun tions of graphi x. Here are some examples: .. or almost any stu. it is more e ient to spe ify that option in the \in ludegraphi s .6. Here are examples: Double your fun \resizebox{1in}{!}{\fbox{Open wide}} \refle tbox{Refle t on this} \rotatebox[origin= ℄{90}{Lands ape} a Py th W as a sq go ua ra re s ? siht no t eeR Lands ape Open wide \s alebox{2}{Double your fun} \rotatebox[origin=rt℄{45} {\psframebox{ \begin{tabular}{ } Was\\Pythagoras\\a square? \end{tabular} } } These operations are available be ause the programs that perform them are used in the \in ludegraphi s ommand. and (2) translate LATEX ommands that you put in the gure in the rst pla e. rotation. the eps le). pi tures. The do umentation gives examples. and sizing of an arbitrary box.

Submit a printed opy of the LATEX sour e (tex le) and printed opy of the asso iated posts ript result (ps le). 4).5in.origin= ℄{protra tor. . Use the pi ture environment to draw the smiley fa e on page 82. height=!℄{protra tor.width=!.eps} \in ludegraphi s[height=. 2.eps} \in ludegraphi s[width=.eps} Exer ises.6 GRAPHICS 102 \in ludegraphi s {protra tor.v2 m ? vm 3 3. Be sure your name is on ea h. Draw the following graph with the pi ture environment.25\textwidth. Use PSTri ks to draw Figure 3 (p. 1. where \thi klines is spe ied and \unitlength = 1mm vm 1 vm 4 . angle=90.

. Use PSTri ks or the pi ture environment to draw the following.6.3 Importing pi tures 103 4. rhombus 5. Use PSTri ks or the pi ture environment to draw the following.

Make a gure in some system that lets you save it as an eps le (or use some onversion program).) (a) Graphi view of Pythagorean Theorem: leg 2 square of leg 2 hy p square of hypotenuse ot en us e leg 1 square of leg 1 . but this se tion did not des ribe all that is needed. 6. Use whatever means you prefer (or that your instru tor requires) to in lude ea h of the following gures in your do ument. Then. so you must obtain the PSTri ks User's Guide [14℄. 7. (They were drawn here with PSTri ks. in lude it in your do ument.

50) (45. 30) 3 ( ) The sin fun tion: (35. 60) 5 (25. 10) 1 (15. 20) y = sin 1 4 x  2 0 -1 -4 -3 -2 -1 0 1 2 3 4 x (d) Bernoulli family tree: Nikolaus (16231708) Ja ob I (16541705) Nikolaus (16621716) Nikolaus I (16871759) Jahann I (16671748) Nikolaus II (16951726) Daniel (17001782) Johann II (17101790) Johann III (17461807) Jo ob II (17591789) .6 GRAPHICS 104 (b) Network with ar data: (25. 30) (45. 40) 2 (35. 50) (15.

Multiple authors are separated by \and. whi h an be dened anypla e before the \maketitle. titlepage must be spe ied as an option in .1 Cover Page The easiest way to make a over page is with the \maketitle ommand. Typi ally these are put into the preamble.105 7 Making Spe ial Parts 7. su h as in the example shown in Figures 71 and 72.) Spe ifying \date is optional (\maketitle puts in the urrent date if the date is not dened). or right after \begin{do ument} followed immediately by \maketitle . it depends upon your management style. generally just following \begin{do ument}. \title{The \LaTeX\ Companion} \author{Mi hel Goosens \and Frank Mittelba h \and Alexander Samarin} \date{1994} \maketitle Figure 71: Title Page Sour e (Result in Figure 72) The LATEX Companion Mi hel Goosens Frank Mittelba h Alexander Samarin 1994 Figure 72: Title Page Result (Sour e in Figure 71) Sin e arti les often have this information on the rst page of the arti le (rather than a separate page). The ne essary parameters are \author and \title. The over page is by itself and is not numbered. (The jagged edges in Figure 72 mean that there is more spa e between the title and the top of the paper. This is done in the do ument environment.

For example. aliations. Germany Alexander Samarin Geneva. Switzerland 1994 Figure 73: Adding Addresses to Authors . All three authors would be put on separate lines if the address information were extended further. Germany \and Alexander Samarin \\ Geneva Switzerland} As illustrated in Figure 73. Switzerland Mainz. using \\ to reate new lines. This is be ause the added width of author information makes it too long to t on one line. the following does this while spe ifying 12pt font as another option: \do ument lass[12pt. or if the names were very long. Switzerland \and Frank Mittelba h \\ Mainz. For example.titlepage℄{arti le} Addresses.7 MAKING SPECIAL PARTS 106 the \do ument lass ommand. The LATEX Companion Mi hel Goosens Frank Mittelba h Geneva. Figure 73 shows how the authors appear when the \author denition in Figure 71 is hanged to the following: \author{Mi hel Goosens \\ Geneva. and other information about ea h author an be added. \maketitle puts the third author on a separate line.

ex ept arti le.2 Abstra t 107 There are times when we want to a knowledge support for one or more of the authors.2 Abstra t The abstra t environment is in all do ument styles. spe ify titlepage as an option in \do ument lass (even if you do not intend to use \maketitle). Figures 74 and 75 illustrate this along with some variation in the date. Ionia } \date{210 {\s b } (revision of earlier version. 2 Figure 75: Footnotes in the Cover Page Result (Sour e in Figure 74) 7.}\\ Syra use. This environment is dened to produ e an abstra t . using dierent footnote marks for ea h one. 510 b ) Renamed. To have it. 510 {\s b })} Figure 74: Footnotes in the Cover Page Sour e (Result in Figure 75) Pie es of 1 Ar himedes Syra use. Si ily 2 210 1 Pythagoras Samos.7. Supported by the army. The \thanks ommand does this by reating a footnote. Ionia b (revision of earlier version.}} \author{Ar himedes\thanks{Supported by the army. \title{Pie es of $\pi$\thanks{Renamed. Si ily \and Pythagoras \\ Samos.

The table of ontents generally in ludes numbered parts. (Like the over page. itself. is one paragraph and is printed without indentation. We further prove that this onstant is bounded by $\fra {223}{71} < \pi < \fra {22}{7}$.7 MAKING SPECIAL PARTS 108 on a separate page (pla ed wherever you put the environment spe i ation). The abstra t. \end{abstra t} Figure 76: Making an Abstra t Sour e (Result in Figure 77) Abstra t This shows that the ratio of the ir umferen e to the diameter of any ir le is the same onstant value. with the header: Abstra t. Then.3 Other Front Matter The \tableof ontents ommand makes a table of ontents. whi h should be right after the over page. it is pla ed wherever you put the ommand. respe tively. For example. Figure 77: Making an Abstra t Result (Sour e in Figure 76) 7. Figures 76 and 77 illustrate this. whi h is not shown in Figure 77. the table of ontents in this do ument was obtained with the spe i ations given in Figure 78. you an in lude lists of gures and tables with the \listoffigures and \listoftables ommands. denoted  . like se tions and subse tions. . We further 22 prove that this onstant is bounded by 223 71 <  < 7 .) \begin{abstra t} This shows that the ratio of the ir umferen e to the diameter of any ir le is the same onstant value. the abstra t is pla ed far from the top of the paper. in boldfa e and entered. LATEX provides the \add ontentsline ommand. denoted $\pi$. To in lude other front matter.

The \renew ommand enables us to do this. That is why you see the Table of Contents on page i (rst numbered page. The se tion parameter tells the latex program to format it like a se tion  ush left. I also thank the ontributors to the Comprehensive \TeX\ Ar hive Network (CTAN). Then. \end{abstra t} . For now.7. Ea h of these are put on a new page. onsider the following example that illustrates how to have an A knowledgements page: \renew ommand\abstra tname{A knowledgements} \begin{abstra t} I thank my family and friends for all of their support. indi ated by the to spe i ation. I use the \add ontentsline to add it to the table of ontents. Just above ea h de laration. Ÿ8 has more to say about using this ommand to ustomize many things. The same format as the abstra t an be used for other front matter that we want to format the same way.3 Other Front Matter 109 \newpage \pagenumbering{roman} \pagestyle{myheadings} \tableof ontents \newpage \add ontentsline{to }{se tion}{List of Figures} \listoffigures \newpage \add ontentsline{to }{se tion}{List of Tables} \listoftables \newpage Figure 78: Some Front Matter Spe i ations for This Do ument The \pagenumber spe i ation auses the page numbers for the front matter to be put into Roman numerals. just after the over). followed by the list of tables. The only hange we require is another header name. I de lare \listoffigures . This is done by re-dening the \abstra tname parameter used by the abstra t environment. whi h is on page v. The page numbering is reset when we nish the front matter by spe ifying \newpage \pagenumbering{arabi } \pagestyle{headings} This swit hes to the Arabi numerals and initializes the page ounter.

but they generally do not ome with a basi LATEX installation. This is a hieved by the \se tion* ommand. where the * suppresses the numbering. enter at the ommand line: makeindex myfile Then. This is analogous to the use of bibtex (p. Put \makeindex at the end of the preamble. GlossTEX is a pa kage that ombines all of these fun tions. but with no number (and the se tion ounter remains un hanged). but we do not want it to have a se tion number. and is illustrated in Figure 79. Exer ises. Be sure your name is on ea h. we have three things to put into our sour e le: 1. . This ould also be desirable in a long report. Write an arti le with a title page and abstra t.5). After a su essful ompilation. 3. nomen l makes a list of nomen lature. These are all easy to install. There are pa kages to make other ba k matter: a ronym makes a list of a ronyms. Main Results. We might rst want to have appendi es that follow the main text. For example. but it requires more steps to install. Submit a printed opy of both the LATEX sour e (tex le) and the asso iated posts ript result (ps le). \se tion*{Prefa e} puts Prefa e in the same style as any se tion.4 Ba k Matter After the main part of the do ument is nished. To make an index. Put \printindex just before \end{do ument}. 1. 7. and gloss makes a glossary. The last portion in the ba k of any book is its index. ompile again. Put \usepa kage{makeidx} in the preamble. we might want something to look like a se tion (and automati ally added to the table of ontents). and Con lusions. with all referen es resolved. 31). 2. Make the main body have at least three se tions: Introdu tion. you get them from CTAN [4℄. This ould be done with the appendix environment: \begin{appendix} : : : \end{appendix}.7 MAKING SPECIAL PARTS 110 Alternatively. we put the bibliography (see Ÿ3 and Ÿ8.

hoosing only a few of the things you an hange. E 3. and whatever is whatever you want the ommand to do. 8.1 Your Own Abbreviations and Commands The ommand that gives us the ability to make our own has the following form: \new ommand{\name }[n℄{whatever }. Combine exer ises 1 and 2 and add a table of ontents showing not only all se tions and subse tions. where n is the number of arguments.ps makeindex Figure 79: Adding makeindex to the Command Sequen e 2. whi h enable you to dene your own ommands and hange parameter values of existing ommands. but also the abstra t.dvi onvert with dvips print/post myfile.111 reate/edit myfile. Here are two examples simply to abbreviate ommands with long names: \new ommand{\ul}{\underline} \new ommand{\m }{\multi olumn} The rst lets us write \ul{something} to underline something. A key to these hanges are the \new ommand and \renew ommand ommands. Extend exer ise 1 to have a knowledgements and referen es (using BibT X). It is still in the ontext of an introdu tion.tex ompile with latex view/print myfile. 8 Taking Control This se tion introdu es you to fundamentals of ustomizing your do ument. The se ond . a knowledgements and referen es.

so we must be areful not to override them with ours. onsider \new ommand{\Gs}[1℄{G_{#1}}.0) \put( 2. This is a hieved by the ommand: \ensuremath{math stu }. Another reason to have our own ommands is for onsisten y. otherwise. For example. Some publishers have their own notation.7)} \end{pi ture} }} (\mbox is used to ensure text mode).0){\framebox(7. like mynul.. then add to the preamble: \new ommand{\usenul}{\mynul} and spe ify \usenul in the do ument. in the preamble p I spe ied: \new ommand{\ hkbox}{$\Box^\surd\.8 TAKING CONTROL 112 lets us write \m {3}{ }{stuff} to enter a multi olumn. simply hange the one line to: \new ommand{\usenul}{\nul} .. if \Gs{i+j} is spe ied in text mode. no matter whi h mode we are in. The latex ompiler will not let you use a name that is already being used. If you need to use the publisher's. like the null spa e of a matrix.. in either a tabular or an array environment. If we are already in math mode. A way to do this is to hoose a dierent name. if you spe ify \new ommand{\fbox}. For example. having dened the \Box ommand. We an hoose one and dene ( ) \new ommand{\nul}{\ensuremath{\math al{N}}}. Thus. \ hkbox ) Some ommands are spe i ally for math mode. but we want them to work in any mode.$} Then. and obtain the orre t result. it is repla ed by $G_{i+j}$ to put it into math mode rst. some write nul A. Suppose we have a key term. Then. spanning 3 olumns and entered. Consider the following example: \new ommand{\Box}{\mbox{\begin{pi ture}(0. A related use is when the ommand requires some lines of ode. we an spe ify \Gs{subs ript }. you will get a fatal error message sin e there is already a \fbox ommand. we an write \nul(A) to obtain N (A) (and we an be in text or math mode when we write this). Some authors write N A . and there are still more symbols people use. \Gs{i+j} is repla ed by G_{i+j} to produ e Gi+j . Now \Box ) and. we an use it in other new ommands. For example. parti ularly of notation.

8.2 Your Own Names.8. In parti ular. the preamble of this do ument ontains the ommand: \input{mydefs} (The sux . in this do ument the Table of Contents was obtained by spe ifying the following in the preamble: \renew ommand{\ ontentsname}{Table of Contents}.tex (note the . so it is useful to put them in a separate le. Titles and Numbers There are times when we prefer some name other than the default.) Dierent sour e les ould simply input this same le. 48).tex is assumed.2 Your Own Names. The preamble an be ome very long as we add our ommands. Titles and Numbers 113 (where the publisher's ommand name is \nul). Table 22 shows the ommon names we might want to hange.tex sux). The general form is \renew ommand{\the ounter }{something } . say mydefs. We saw an example of this in hanging the ounters for enumeration lists (p. What it is Abstra t Appendix Chapter Contents Index List of Figures List of Tables Part Referen es How it is alled (keyword) \abstra tname \appendixname \ haptername \ ontentsname \indexname \listfigurename \listtablename \partname \refname for arti le style \bibname for book and report styles Table 22: Intrinsi Name Parameters You might want to hange the numbering of some intrinsi ounter. we use the \input ommand to have the latex ompiler read it wherever it is pla ed. For example. Then. so dupli ation of work is avoided.

8 TAKING CONTROL 114 Another example is to hange se tion numbering in a report do ument style.se tion [. sin e the se tion is the rst level division. is to make the  hara ter a letter.1. so the numbering will be hapter. and the \renewenvironment ommand enables us to revise an existing environment. n = number of arguments (omit [0℄ for n ). \makeatletter. \makeatother.3 Your Own Environments The \newenvironment ommand enables us to dene our own environments. where you want it to be ounted as a report. The way to do this is as follows: E \makeatletter \renew ommand\these tion{\arabi \ se tion} \makeatother The pre eding ommand. . This might not be appropriate due to other onsiderations. 8. They have the same syntax: newenvironment{name }[n℄{begin }{end } renewenvironment{name }[n℄{begin }{end } where name is the name of the environment. For example. it will number the rst se tion as 0. similar to a book. restores  to its spe ial meaning (\ is for ertain spa ing. but the format of hapters is dierent. The rst level of division is assumed to be a hapter. and end is what is exe uted upon leaving the environment. su h as entering the do ument into a database using BibT X.subse tion ℄ : : : If you have no hapters. begin is what is exe uted upon entering the environment.1mm}{2. not as an arti le.1mm} \end{des ription}\end{flushleft} } % end proof Then. the following reates a proof environment: =0 \newenvironment{proof} {\begin{flushleft} \begin{des ription} \item \textit{\textbf{Proof:}}~ } % begin proof {\hfill\rule{2. equal to about 2 spa es). Making the rst level division hapters will over ome the numbering problem. Making the do ument lass an arti le will also solve the problem. The su eeding ommand.

Proof: 8. The \hspa e* and \vspa e* ommands provide a great deal of ontrol over horizontal and verti al spa ing.4 Your Own Margins and Spa ing 115 \begin{proof} First. the urrent settings (shown For example. Table 24 lists some you an set with the \setlength ommand. showing their default values (used in this do ument). and you will usually not need to hange them. The geometry pa kage provides easy spe i ations for page layout. they an be hanged by setting ertain parameters in the preamble. in parti ular. if we are using 21  in Table 23) break down the horizontal parts as follows: 8 72.4 Your Own Margins and Spa ing The default margins and spa ing are set with purposeful values. suppose : : : Thus. We might want some global settings to make repeated use of these unne essary. for example. For example.295 pt 390 pt 5. (See Table 25 for onversion fa tors. When you do. The body expands to the right unless we also hange \oddsidemargin. \end{proof} produ es: First. we raise the body 1 in h by spe ifying \topmargin=-1in in the preamble.) paper. suppose \dots \linebreak Thus. however. the theorem follows.14. The margins of the do ument are ontrolled by the parameters shown in Figure 82 and des ribed in Table 23.564 in We an in rease the text width by setting \textwidth=length in the preamble.27 pt 39 pt 1 in 54 in begin body stu 11 6.8.025 pt 1.27 in.5 in end body stu 113. This might be a ompanied by in reasing the text length. respe tively. 1 pt = 72. . Margin settings an be negative.396 in 8. the theorem follows. \textwidth=6in in reases the text width to 6 in hes.

0pt plus 2.5pt minus 1.0pt height of header \hoffset 0.0pt. spa e between paragraphs in the same item of a list.0pt horizontal oset to add to indentation of body \oddsidemargin 17. (Defaults are restored after leaving. the lists in Ÿ2. Here is what happens when we hange \itemsep:  The default value of \itemsep is 5.0pt width of the body \topmargin 17.0pt Meaning spa e between bottom of body and top of footer \headsep 25. indentation at beginning of paragraph. 13) are spa ed by default values. in whi h ase there is also an nevensidemargin parameter) \paperheight 794.295pt width of the paper \textheight 548.96999pt height of the paper \paperwidth 614. spa e between paragraphs. .2 (p. Table 23: Margin Parameters Parameter \itemsep \parindent \parsep \parskip Meaning spa e added to \parsep between items in a list. and I have saved it by: \setlength{\mylength}{\itemsep}.8 TAKING CONTROL 116 Parameter \footskip Current Settingy 30. Table 24: Spa ing Parameters In the ase of list parameters.5pt height of the body \textwidth 390. they must be set after entering the list environment.0pt extra spa e added at left (applies only to odd numbered pages if the style is two-sided.) For example.0pt verti al oset to add to indentation of body yPrinted using \theparameter.0pt spa e between bottom of header and top of body \headheight 12.0pt spa e added before the top of the header \voffset 0.

3in}l} \. We are ba k to normal with \itemsep = 5.4 Your Own Margins and Spa ing     117 See the above spa ing between items.8. so we want to in rease its verti al spa ing. What you see next is with \setlength{\itemsep}{0pt}.x_B = b_N + \fra {1}{2}\theta\delta b_N && \pi_N B = _B + \fra {1}{2}\theta\delta _B \\ B^*x_B > b_B + \fra {1}{2}\theta\delta b_B && \pi_N N < _N + \fra {1}{2}\theta\delta _N \end{array} \℄ Figure 80: Array with Fixed Width Column Sour e (Result in Figure 81) B xB = bN + 21 ÆbN B  xB > bB + 21 ÆbB N B = B + 12 Æ B N N < N + 21 Æ N Figure 81: Array with Fixed Width Column Result (Sour e in Figure 80) .5pt minus 1.0pt plus 2. Figures 80 and 81 show the presentation of an array with a p- olumn to put horizontal spa e between the other two olumns. Note how ongested it is. What you see next is with \setlength{\itemsep}{10pt}.0pt.B\. Next is ba k to normal by \setlength{\itemsep}{\mylength}. \[ \begin{array}{lp{.

8 TAKING CONTROL 118 npagewidth 1 in + nvoffset ntopmargin nheadheight ntextheight nheadsep header noddsidemargin npageheight ntextwidth 1 in + body footer nhoffset Figure 82: Do ument Margins nfootskip .

whi h I formatted to agree with the plain style of BibT X: E E \begin{thebibliography}{99} \bibitem{ ompanion} Mi hel Goosens. \bibliography{mybiblio} and \bibliographystyle{plain}. Here is a omplete example with two referen es. \end{thebibliography} where n is the width of the widest label you want to allow. as des ribed for BibT X in Ÿ3 (p. 30).5 Your Own Bibliography 119 Here is 1.5 Your Own Bibliography You an hoose not to use BibTE X. \textit{The \LaTeX\ Companion}. spe ify the following: E \begin{thebibliography}{n} \bibitem[what appears ℄{label (that you ite)} entry .3 line spa ing: \renew ommand{\arraystret h}{1.6} B xB = bN + 12 ÆbN N B = B + 12 Æ B N N < N + 21 Æ N B  xB > bB + 21 ÆbB Ba k to default: \renew ommand{\arraystret h}{1} N B = B + 12 Æ B N N < N + 21 Æ N B xB = bN + 21 ÆbN B  xB > bB + 21 ÆbB 8.) Ea h \bibitem is an entry.. and use thebibliography environment instead. The option is an alternative to having the referen es numbered.8. Addison-Wesley . and you an enter whatever you like.3} B xB = bN + 21 ÆbN B  xB > bB + 21 ÆbB N B = B + 12 Æ B N N < N + 21 Æ N Here is 1.6 line spa ing: \renew ommand{\arraystret h}{1. (It works if you spe ify 99. Instead of the BibT X ommands. You will have omplete ontrol over the formatting. with label the unique identier used by the \ ite ommand. . Frank Mittelba h and Alexander Samarin. and there will be no sorting  the list of referen es will appear in the order you put them.

whi h you obtain from CTAN [4℄. 41). 1989℄. there is no format monitoring. \textit{The \TeX\ Book}. This is one reason it is usually better to use BibT X. whi h give the author and year. we obtain [2℄ in the text. for example. respe tively. Besides what you an do yourself to elevate the quality of the results. Addison-Wesley Publishing Company. These pa kages provide even more versatility in how the itations appear (see [4℄ or [5. apalike and plainnat (from natbib). MA. use the bibunits pa kage. applies in either ase.8 TAKING CONTROL 120 Publishing Company. but if you are writing a report and have ontrol over the formatting. even though you lose ontrol over what appears (i. Alternative bst les are a hi ago (from the frankenstein pa kage). Knuth. \bibitem{tex} Donald E. su h as [Knuth. available from CTAN [4℄. 1989℄{tex} Donald E. so ea h entry appears however you put it. Reading. 1994. The bib style le. even if there are in onsisten ies in style. ::: in whi h ase \ ite{tex} ) [Knuth. and its three variations (given on p. With you in ontrol. Figure 83 shows the preamble used for . su h as at the end of ea h hapter of a book. Knuth. 1989℄ is preferred to [2℄ be ause it immediately gives the reader information about the do ument without having to ip to the bibliography se tion. \end{thebibliography} These will appear in the do ument's list of referen es even if they are not ited. there are many pa kages. Some publishers give you no hoi e. Most installations ome with more than the basi plain.bst. E Closing Remarks Now you know how to write a mathemati al do ument in LATEX 2" and you know there is mu h more you an learn to gain renements. When iting Knuth's book.e. 1989. 1989℄ instead of [8℄. Thus. If you want to have several bibliographi units in one do ument. Chapter 13℄). MA. Alternatively. it generally helps the reader to know something about the itation. They an be ited in the same way des ribed in Ÿ3: by \ ite{ ompanion} and \ ite{tex}. Reading. they will be numbers).. su h as plain. we an exer ise the option: \bibitem[Knuth. 15th edition. [Knuth.

\usepa kage{graphi x.. As you begin to use pa kages. and there are others with similar properties or for parti ular programming languages (viz. It is designed like a referen e manual for easy lookup.} . -pas al) and listings)). wasysym. beginning with Table 25. The graphtex pa kage spe ializes in all sorts of graphs. and xypi ... the algorithm pa kage enables an environment to write sour e ode with standard language elements. qsymbols.. Also. . it is ne essary to be ome aware of updates..idx (input to makeindex at ommand line) Figure 83: Most of the Preamble for this Do ument Appendix This ontains omplete tables of font information and basi LATEX ommands. You learn about these at CTAN [4℄.APPENDIX 121 this do ument..pst-all} \usepa kage{makeidx} \usepa kage{url} \usepa kage[T1℄{fonten } \usepa kage{fan yvrb.moreverb} \usepa kage{float} \usepa kage{multirow} \usepa kage{amsmath} \usepa kage{amssymb} \usepa kage{ams d} \usepa kage{mathrsfs} \usepa kage{bm} \usepa kage{theorem} % % % % % % % % % % % % % graphi s index \url{.to write \textbf{\texts {. depending upon your te hni al area. You will nd other pa kages useful. whi h gives onversion among three ommon units of measurement. Here are some pa kages that give you spe ial symbols: hemsym. in luding those ommonly found in automata theory.}} verbatim enable float [H℄ option like multi olumn formerly amstex ams symbols (\mathbb fonts) draws ommutative diagrams more math symbols (like \maths r) bold math fonts (\mathbm) enables more ontrol over newtheorem \renew ommand\ ontentsname{Table of Contents} % Change `Contents' \renew ommand\url{\begingroup\urlstyle{sf}\Url} % put url in sf font \input{mydefs} % My ommands and environments \makeindex % make myfile.

54 m 28. and Table 46 gives the ommands for the pi ture environment. Triangles and Lines Variable Size Symbols Table 26: Referen e Tables .APPENDIX 122 pt in m pt 1 .03515 in 72.01384 .27 1 2. Table 45 gives spe ial symbols that an be used in either text or math mode. Afterwards. Text mode Table Contents 27 28 29 30 31 32 Math mode 33 34 35 36 37 38 39 40 41 42 43 44 Commands/Environments for Font Appearan e Commands/Environments for Controlling Position Text A ents and Symbols Commands for Counters Commands/Environments to Organize Do ument Commands to Control Do ument Style Commands to Control Fonts in Math Mode Mathemati al A ents and Symbols Greek and Spe ial Letters Spa ing Commands in Math Mode Frequently Used Mathemati al Symbols Binary Operations Operators and Quantiers Spe ial Fun tions Relation Symbols Arrows Dots Cir les.45 .3937 1 Table 25: Conversions of Common Units of Measurement Table 26 is a guide to how most of the remaining tables are organized.

APPENDIX textbf tiny Large verbatim 123 textit s riptsize LARGE textrm footnotesize huge texts small Huge textsf normalsize underline texttt large verb Table 27: Commands/Environments for Text Font Appearan e bigskip flushright medskip pagebreak smallskip vspa e enter hfill newpage quotation tabbing vspa e* enterline hspa e noindent quote tabular learpage hspa e* nolinebreak raisebox verse flushleft linebreak nopagebreak samepage vfill Table 28: Commands/Environments for Controlling Text Position á è î ö æ Æ Š \'{a} \`{e} \^{i} \"{o} \ae \AE \L u  ñ  H oo ÷ × ÿ \u{u} \~{n} \H{H} \t{oo} \oe \OE \ss ç d. b : : : å Å ¾ \ { } \d{d} \b{b} \dots \aa \AA ?` x z  v \.{x} \={z} \v{v} ø Ø ½ \o \O !` Table 29: Text A ents and Spe ial Symbols addto ounter ref the ounter label refstep ounter value new ounter set ounter Table 30: Commands for Counters pageref step ounter .

to avoid the lash between the a ent and dot. rather than j . rather than i.) Table 34: A ents in Math Mode . and \jmath.APPENDIX 124 abstra t appendix listoffigures maketitle subse tion tableof ontents add ontentsline bibliography listoftables printindex subsubse tion thanks addto ontents bibliographystyle makeindex se tion subsubsubse tion thebibliography Table 31: Commands/Environments to Organize Do ument markright renew ommand markboth setlength pagenumbering thispagestyle pagestyle Table 32: Commands to Control Do ument Style left al mathit mathtt right boldmath (set displaystyle mathnormal mbox textstyle in text mode) mathbf math al mathrm mathsf overbra e overline underbra e underline Table 33: Commands to Control Fonts in Math Mode a \ he k{a} e x_ \dot{x} y ^{ nhat{nimath} xyz d nwidehat{xyz} \breve{e} i \a ute{i} \ddot{y} z \bar{z} |~ ntilde{njmath} f nwidetilde{ab } ab o \grave{o} ~v \ve {v} ~ \hbar (Note that it is better style to use \imath.

APPENDIX 125 .

y x\quad y x\qquad y x\!y x\negmedspa e y x\negthi kspa e y ) ) ) ) ) ) ) ) What you see xy xy xy x y x y xy xy xy no spa e thin spa e medium spa e spa e = 1em spa e = 2em negative thin spa e negative medium spa e negative thi k spa e Table 36: Spa ing Commands in Math Mode {supers ript} {subs ript} ^{} _{} 0 \prime 1 \infty .y x\. \emptyset Table 37: Frequently Used Mathemati al Symbols . Æ  "   \alpha  \beta # \gamma  \delta  \epsilon  \varepsilon  \zeta  \eta  \Gamma   \Delta   \Theta   \aleph ` A : : : Z {nmath al A \theta \vartheta \iota \kappa \lambda \mu \nu$ \xi \Lambda \Xi \Pi \ell : : : Z} o  $  %  & o \pi \varpi \rho \varrho \sigma \varsigm    '  ! \tau \upsilon \phi \varphi \ hi \psi \omega  \Sigma \Psi  \Upsilon \Omega  \Phi < = \Re \Im Table 35: Greek and Spe ial Letters What you write x y x\.

APPENDIX 126     n nU \pm \mp \times \div \setminus \ba kslash \biguplus \ u ^ _T \ ap \sq ap \wedge \vee \big ap \bigvee \bigwedge W V [ t ℄ S L F \ up \sq up \uplus \oplus \big up \bigoplus \bigsq up .

J \odot \otimes \oslash \ominus \bigodot \bigotimes N Table 38: Binary Operations r 8 \nabla \forall  \partial 9 \exists p : \surd \neg } \wp Table 39: Operators and Quantiers ar os s lg Pr ar sin det lim se ar tan dim liminf sin arg exp limsup sinh os g d ln sup osh hom log tan ot inf max tanh oth ker min  \equiv / 2 3 \propto \in \ni Table 40: Spe ial Fun tions       v \leq \pre \pre eq \ll \subset \subseteq \sqsubseteq       w \geq \su \su eq \gg \supset \supseteq \sqsupseteq 6=  ' =   \neq \sim \simeq \ ong \asymp \approx Table 41: Relation Symbols =: \doteq j= \models .

APPENDIX ( ! ) $ ./ > a \ j \ ir \ dots \vdots \frown \triangle \triangleright \bigtriangleup \bowtie \top \dashv \angle \mid . Cir les.! * + \longleftarrow \Longleftarrow \longrightarrow \Longrightarrow \longleftrightarrow \Longleftrightarrow \longmapsto \hookrightarrow \rightharpoonup \rightharpoondown " * # + l m % & . 4 .. - Table 42: Arrows Æ  . .  ^  / 5 ? ? ` k k \big ir \ddots \bullet \smile \diamond \triangleleft \bigtriangledown \perp \bot \vdash \| \parallel Table 43: Dots. 7 ! ( ) 127 \leftarrow \Leftarrow \rightarrow \Rightarrow \leftrightarrow \Leftrightarrow \mapsto \hookleftarrow \leftharpoonup \leftharpoondown \rightleftharpoons (= ! =) ! () 7! . Triangles and Lines \uparrow \Uparrow \downarrow \Downarrow \updownarrow \Updownarrow \nearrow \searrow \swarrow$ \nwarrow .. _ 4 . .

rbg. a multilingual style-option system for use with LATEX's standard do ument styles.r. height)[p℄{text} ve tor(x.t. For oval. } \ oprod : \overline{ . y ){number }{stuff } line(x. height)[p℄{text} ir le*{radius) oval(width. y ){stuff } multiput(x. height)[p℄ linethi kness{dimension} p 2 fl. Table 46: Commands and Parameters in Pi ture Environment Referen es [1℄ Johannes L. 12(2):291301. Available at CTAN [4℄.lb. TUGboat. y ){length} framebox(width. } These use nleft and nright fg b i | \oint [℄ \{ \} \lfloor [ ℄ \rfloor \rangle Table 44: Variable Size Symbols y z ::: \dag \ddag \ldots Ÿ { \S \P ¿ \ opyright \pounds Table 45: Spe ial Symbols in Both Text and Math Modes put(x. y ){length} dashbox{dashs ize}(width. 1991. height)[p℄{text} ir le{radius) makebox(width. } \underline{ .lt. p is where the text goes. y )(x. it is the portion sele ted. } n d \fra {n}{d} () ( ) j h H \int p: \langle : |{z} : \underbra e{ .b. Babel.rt. . } \sqrt{ . for boxes. Braams.REFERENCES 128 P Q ` R \sum : \prod z}|{ \overbra e{ .

Chris Rowley.umb. Knuth. David P. BibT Xing. Frank Mittelba h. Murray Hill. [8℄ Donald E. Carlisle.a . Braams. World Wide Web site Version 2. Addison-Wesley Publishing Company. .REFERENCES 129 [2℄ Johannes L. [11℄ Oren Patashnik. A User's Manual for MetaPost. LATEX 2" and the LaTeX3 proje t.ps (see [4℄ for repla ing CTAN).tex. 164. AT&T Bell Laboratories. Carlisle. AddisonWesley Publishing Company. 162.ps.ps (see [4℄ for repla ing CTAN). 1994). These are host sites. MA. http://www. UK: ftp.org/latex3. Hobby. Alan Jerey.edu/ tex-ar hive/ . Available at http:// m. Reading. html/.tug2. and Rainer S höpf. [3℄ David P. AT&T Bell Laboratories.latex-proje t. [5℄ Mi hel Goosens. [9℄ Leslie Lamport. 1993. The LATEX Companion. USA: ftp. Available at http:// m.ui . 1986 (also see 2nd edition. World Wide Web. [10℄ LATEX 2" for authors. 1992. 1989. MA. 199597. Computing S ien e Te hni al Report no. http://www. [6℄ John D. E [12℄ Keith Re kdahl. CTAN/info/epslatex. CTAN/ma ros/latex/do /usrguide. Addison-Wesley Publishing Company.bell-labs.0.uk/tex-ar hive/. New Jersey. and Alexander Samarin. s. Computing S ien e Te hni al Report no.dante. World Wide Web. Hobby. [7℄ John D. [4℄ Comprehensive TEX ar hive (CTAN). The TEX Book. 199499.ps. Reading. Frank Mittelba h. Drawing Graphs with MetaPost. om/who/hobby/MetaPost. CTAN/ma ros/latex/required/graphi s/ (see [4℄ for repla ing CTAN). Germany: ftp. Comprehensive TEX Ar hive. whi h ontain a list of mirror sites. World Wide Web.gz. New Jersey. 15th edition. 199499. MA. 1988. Pa kages in the `graphi s' bundle. om/ s/ str/164. 199599. Reading.de/tex-ar hive/. 1994. Murray Hill.bell-labs.html. LATEX: A Do ument Preparation System.edu/ depts/adn/infwww/ps/btxdo . Using imported graphi s in LATEX 2" .

130 REFERENCES [13℄ Christian S henk.de/. http:// www. [14℄ Timothy Van Zandt. http://www. 199398. World Wide Web.2).org/appli ations/PSTri ks/. World Wide Web.miktex. 199899 (version 1. . MiKTEX Lo al Guide. PSTri ks: PostS ript ma ros for Generi TeX.tug.

115 noverbra e. 53. 21. 45 n line. 43. 11. 46 nfbox. 108 nmakebox. 27. 71 nbigskip. 57. 7. 40. 71 nBig. 106 ndotfill. 45 nnewtheorem. 61 ndo ument lass. 62. 82 ndate. 108 nlistoftables. 124 nkill. 65 nmedskip. 71 nboldmath. 109 nBigg. 114 nnewline. 83 nframe. 47 nnewenvironment. 10. 73 npagebreak. 67 nmathfont. 52 nmbox. 59 nleft. 12 nmulti olumn. 13. 11. 27 131 . 60 nhrulefill. 26 nline. 61. 128 nlinebreak. 11 nnolinebreak. 112 nnew ommand. 10 nhfill. 119 nauthor. 112 nfboxrule. 46 nfboxsep. 26 nnopagebreak. 51 n dots. 62 nbibliographystyle. 84 nlistoffigures. 17. 26. 27 npagenumbering. 66 nmaths r. 21 n ite. 105 ndisplaystyle. 27 nhspa e*. 40 nbibliography.Index nhspa e. 67 nframebox. 63. 1. 113 njmath. 8 ndvips. 26 nnewpage. 17 ndashbox. 47 narraystret h. 27 nimath. 124 ninput. 68 n enterline. 82 nmaketitle. 41 n learpage. 3 nensuremath. 27 ndots. 111 nnew ounter. 27 noddsidemargin. 62. 62 noverset. 12 nbig. 70 nno ite. 25 nlabel. 62 noverline. 28. 41 nnoindent. 84 nfra . 27 nhline. 69. 80. 40 nbigg. 105 nmathbb. 54. 81. 71 naddto ounter. 46. 105 nbaselineskip.

4. 27 nvspa e*. 24 AMS. 27 nvspa e. 62 nwidetilde. 48 ntitle. 62 nwidehat. 110 nse tion. 48 nthe ounter. 81 npartial. 37. 69. 10. 84 nverb. 82 nurl. 74 ntableof ontents. 45. 109 nparbox. 27 nse tion*.INDEX 132 npageref. 48. 88 nvalue. 88 titlepage. 62. 59. 27. 105 nunderbra e. 7 . 73 nstep ounter. 99 environment. 69 Bezier urve. 109. 44. 81 olumn spe i ation. 106 a ents. 12 nsqrt. 73 nunitlength. 23 omments. 108 ntextstyle. 46. 54 ntextwidth. 67 do ument styles. 1 amsmath. 111 nrenewenvironment. 11 debugging. 44. 53 nsta krel. 63 nraisebox. 1. 62 ross referen ing. 47 nsetlength. 1 DOS. 2 onditional assignment. 47 nsubse tion. 6 nset ounter. 43. 23 nvfill. 115 ntextfont. 6 nsubsta k. 16 pdftex. 39 dash. 67. 44. 30 dvi viewer. 9 nthanks. 43. 107 ntheenumi. 21. 30 body. 28. 94 bibtex program. 18. 66. 82 nsmallskip. 1 omment. 48 nref. 70 nrenew ommand. 62 nn. 48 nve tor. 63 nrefstep ounter. 70 npagestyle. 3 emftoeps. 37 nusepa kage. 1 box. 114 nright. 2 derivative. 128 nsamepage. 62 nunderset. 89 nraggedright. 1 ompile. 5. 62 nunderline. 3. 20. 60 nprod. 18 ommand line. 53 npsset. 67 nprime.

36 wmf. 52 itali . 9 small aps. 31. 24 Roman. 7. 63 ushright. 11 quote. 92 Hamiltonian. 59 equation. 9. 45 oat page. 69 verbatim. 88. 1. 18 math mode. 11 jpeg2ps. 7 gather. 49 glossary. 1. 22 pi ture. 18 sans serif. 72 gather*. 51 alligraphi . 67 Lapla e transform. 10 longtable. 99 oat. 45 oating obje t. 57. 9 fra tions. 67 latex ommand. 9 underlined. 66 non-English. 82 quotation. 45 font size. 36. 9 boldmath. 13. 2. 46 tabular. 10 smallmatrix. 70 des ription. 58 eqnarray*. 99 . 120 dvi. 40. 2 list environment. 99 jpeg. 13 des ription. 60. 23 do ument. 9 slanted. 7 orollary. 99 Lagrangian. 16. 52 Greek. 109 appendix. 63 axiom. 45. 70 enter. 23. 62 font style bold small aps. 59 gure. 60. 9 boldfa e. 24 table. 45. 88 eps. 51. 107. 30. 46 ushleft. 119 theorem. 73 tabbing. 3840 bst (bib style). 99 tex. 9.INDEX le 133 abstra t. 9. 21. 18 typewriter. 14 large. 63 thebibliography. 72 itemize. 20. 10. 12 ps (posts ript). 4 global setting. 105 enumerate. 3. 23 verse. 4. 13 ghostview. 110 graph. 110 array. 15 eqnarray. 67 horizontal ll. 46. 53 bib. 52.

110 algorithm. 100 pstri ks. 74 amsmath. 26 horizontal. 88 MiKTeX. 99 graphtex. 2 MetaPost. 50 sta k. 5. 60 . 24 bibunits. 14. 32. 121 setspa e. 115. 69. 46 math display mode. 121 xypi . 50 tabbing ommands. 88 qsymbols. 17. 5. 110 psfrag. 1. 7 a ronym. 2 Repeated entry. 97 transpose. 99 nodes. 1 spa ing.INDEX 134 enumerate. 66 babel. 1. 92 pa kage. 119 verti al. 54. 12. 16 ti ks. 27. 39. 2 Overfull : : : . 121 paragraph positions. 114 ntextspe . 53. 56. 1. 58 matrix equation. 110 graphi x. 7 preamble. 121 nomen l. 15 itemize. 45 fonten . 2 warning. 27 spe ial hara ter. 121 listings. 5. ix. 120 geometry. 121 oat. 115 gloss. 22 makeidx. 50. 3. 121 hemsym. 44 theorem. 41 Underfull : : : . 121 fan yvrb. 53 -pas al. 67 morevrb. 6 SIAM. 121 ams d. 110 mathrsfs. 120 quotation marks. 9 frankenstein. 60 message. 73 subs ript. 121 longtable. 6 supers ript. 11 se tion. 37 wasysym. 23 in url. 110 glosstex. 120 bm. 24 table. 73 subse tion. 14 ~. 14 lo al setting. 50. 27 math mode. 71 url. 23. 36 spe ial fun tion. 88. 65 sta king. 72 amssymb. 28 showkeys. 87.

122 unix. 18. 4. 30. 82. 3 135 . 3. 96. 3 YAP. 65 units of measurement. 121. 99 xdvi.INDEX trigonometri fun tions. 4. 92. 89.