337 105 562KB
English Pages 114 Year 1996
Math into LATEX
An Introduction to LATEX and AMS-LATEX
This book is dedicated to those who worked so hard and for so long to bring these important tools to us:
The LATEX3 team and in particular Frank Mittelbach (project leader) and David Carlisle
The AMS team
and in particular Michael J. Downes (project leader) and David M. Jones
George Gr¨atzer
Math into LATEX
An Introduction to LATEX and AMS-LATEX
¨ U SE R B I R K H A BO ST O N
• BASE L • BE RLI N
George Gr¨atzer Department of Mathematics U niversity of Manitoba Winnipeg, Manitoba Canada R3T 2N2
Library of Congress Cataloging-in-Publication D ata Gr¨atzer, George A. Math into LaTeX : an introduction to LaTeX and AMS-LaTeX / George Gr¨atzer p. cm. Includes index. ISBN 0-8176-3805-9 (acid-free paper) (pbk. : alk. paper) 1. AMS-LaTeX. 2. Mathematics printing–Computer programs. 3. Computerized typesetting. I. Title. Z253.4A65G69 1995 95-36881 CIP 688.2 ′ 2544536–dc20
Printed on acid-free paper c Birkh¨auser Boston 1996 ° All rights reserved.
Typeset by the Author in LATEX Design, layout, and typography by Mery Sawdey, Minneapolis, MN
Short contents Preface
xviii
Introduction
xix
I
A short course
1
1
Typing your first article
3
II
Text and math
59
2
Typing text
3
Text environments
11 1
4
Typing math
14 0
5
Multiline math displays
18 0
III
61
D ocument structure
20 9
6 LATEX documents
21 1
7
Standard LATEX document classes
23 5
8
AMS-LATEX documents
24 3 v
vi
Short contents
IV 9
V
Customizing
265
Customizing LATEX
26 7
Long bibliographies and indexes
309
10 B I BTEX
31 1
11 MakeIndex
33 2
A Math symbol tables
34 5
B Text symbol tables
35 6
C The AMS-LATEX sample article
36 0
D Sample article with user-defined commands
37 2
E Background
37 9
F PostScript fonts
38 7
G Getting it
39 2
H Conversions
40 2
I
41 0
Final word
Bibliography
41 3
Afterword
41 6
Index
41 9
Contents Preface
xviii
Introduction Typographical conventions . . . . . . . . . . . . . . . . . . . . . . . .
xix xxvi
I
A short course
1
1
Typing your first article 1.1 Typing a very short “article” . . . . . . 1.1.1 The keyboard . . . . . . . . . . 1.1.2 Your first note . . . . . . . . . . 1.1.3 Lines too wide . . . . . . . . . 1.1.4 More text features . . . . . . . 1.2 Typing math . . . . . . . . . . . . . . . 1.2.1 The keyboard . . . . . . . . . . 1.2.2 A note with math . . . . . . . . 1.2.3 Building blocks of a formula . . 1.2.4 Building a formula step-by-step 1.3 Formula gallery . . . . . . . . . . . . . 1.4 Typing equations and aligned formulas 1.4.1 Equations . . . . . . . . . . . . 1.4.2 Aligned formulas . . . . . . . . 1.5 The anatomy of an article . . . . . . . . 1.5.1 The typeset article . . . . . . . 1.6 Article templates . . . . . . . . . . . . 1.7 Your first article . . . . . . . . . . . . . 1.7.1 Editing the top matter . . . . . vii
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . .
3 4 4 5 7 9 10 10 10 14 20 22 29 29 31 33 38 41 42 42
viii
Contents
1.8 1.9 1.10 1.11
1.12
II 2
1.7.2 Sectioning . . . . . . . . 1.7.3 Invoking proclamations . 1.7.4 Inserting references . . . LATEX error messages . . . . . . Logical and visual design . . . . A brief overview . . . . . . . . . U sing LATEX . . . . . . . . . . . 1.11.1 AMS-LATEX revisited . . 1.11.2 Interactive LATEX . . . . 1.11.3 Files . . . . . . . . . . . 1.11.4 Versions . . . . . . . . . What’s next? . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
Text and math Typing text 2.1 The keyboard . . . . . . . . . . . . . 2.1.1 The basic keys . . . . . . . . . 2.1.2 Special keys . . . . . . . . . . 2.1.3 Prohibited keys . . . . . . . . 2.2 Words, sentences, and paragraphs . . 2.2.1 The spacing rules . . . . . . . 2.2.2 The period . . . . . . . . . . 2.3 Instructing LATEX . . . . . . . . . . . 2.3.1 Commands and environments 2.3.2 Scope . . . . . . . . . . . . . 2.3.3 Types of commands . . . . . . 2.4 Symbols not on the keyboard . . . . . 2.4.1 Q uotes . . . . . . . . . . . . 2.4.2 Dashes . . . . . . . . . . . . . 2.4.3 Ties or nonbreakable spaces . 2.4.4 Special characters . . . . . . . 2.4.5 Ligatures . . . . . . . . . . . 2.4.6 Accents and symbols in text . 2.4.7 Logos and numbers . . . . . . 2.4.8 H yphenation . . . . . . . . . 2.5 Commenting out . . . . . . . . . . . 2.6 Changing font characteristics . . . . . 2.6.1 The basic font characteristics . 2.6.2 The document font families . 2.6.3 Command pairs . . . . . . . . 2.6.4 Shape commands . . . . . . .
43 44 44 46 48 51 52 52 54 54 55 56
59 . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
61 62 62 63 63 64 64 66 67 67 70 72 73 73 73 74 74 75 75 76 78 81 83 83 84 85 85
Contents
ix . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
86 87 88 88 89 89 90 90 93 94 95 96 96 97 99 99 100 100 103 104 105 106 107 107 108 108 109
Text environments 3.1 List environments . . . . . . . . . . . . . . . . . . 3.1.1 Numbered lists: enumerate . . . . . . . . 3.1.2 Bulleted lists: itemize . . . . . . . . . . . 3.1.3 Captioned lists: description . . . . . . . 3.1.4 Rule and combinations . . . . . . . . . . . 3.2 Tabbing environment . . . . . . . . . . . . . . . . 3.3 Miscellaneous displayed text environments . . . . 3.4 Proclamations (theorem-like structures) . . . . . . 3.4.1 The full syntax . . . . . . . . . . . . . . . 3.4.2 Proclamations with style . . . . . . . . . . 3.5 Proof environment . . . . . . . . . . . . . . . . . 3.6 Some general rules for displayed text environments 3.7 Tabular environment . . . . . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
11 1 112 112 112 113 114 116 118 123 127 127 130 131 132
2.7
2.8
2.9
2.10 2.11
3
2.6.5 Italic correction . . . . 2.6.6 Two-letter commands 2.6.7 Series . . . . . . . . . 2.6.8 Size changes . . . . . . 2.6.9 O rthogonality . . . . . 2.6.10 Boxed text . . . . . . . Lines, paragraphs, and pages . 2.7.1 Lines . . . . . . . . . . 2.7.2 Paragraphs . . . . . . . 2.7.3 Pages . . . . . . . . . 2.7.4 Multicolumn printing . Spaces . . . . . . . . . . . . . 2.8.1 H orizontal spaces . . . 2.8.2 Vertical spaces . . . . . 2.8.3 Relative spaces . . . . 2.8.4 Expanding spaces . . . Boxes . . . . . . . . . . . . . 2.9.1 Line boxes . . . . . . . 2.9.2 Paragraph boxes . . . . 2.9.3 Marginal comments . . 2.9.4 Solid boxes . . . . . . 2.9.5 Fine-tuning boxes . . . Footnotes . . . . . . . . . . . 2.10.1 Fragile commands . . Splitting up the file . . . . . . 2.11.1 Input and include . . . 2.11.2 Combining files . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
x
Contents
4
3.8 Style and size environments . . . . . . . . . . . . . . . . . . . .
138
Typing math 4.1 Math environments . . . . . . . . . . . . . 4.2 The spacing rules . . . . . . . . . . . . . . 4.3 The equation environment . . . . . . . . . 4.4 Basic constructs . . . . . . . . . . . . . . . 4.4.1 Arithmetic . . . . . . . . . . . . . . 4.4.2 Subscripts and superscripts . . . . . 4.4.3 Roots . . . . . . . . . . . . . . . . 4.4.4 Binomial coefficients . . . . . . . . 4.4.5 Integrals . . . . . . . . . . . . . . . 4.4.6 Ellipses . . . . . . . . . . . . . . . 4.5 Text in math . . . . . . . . . . . . . . . . . 4.6 Delimiters . . . . . . . . . . . . . . . . . . 4.6.1 Delimiter tables . . . . . . . . . . . 4.6.2 Delimiters of fixed size . . . . . . . 4.6.3 Delimiters of variable size . . . . . 4.6.4 Delimiters as binary relations . . . . 4.7 O perators . . . . . . . . . . . . . . . . . . 4.7.1 O perator tables . . . . . . . . . . . 4.7.2 Declaring operators . . . . . . . . . 4.7.3 Congruences . . . . . . . . . . . . 4.8 Sums and products . . . . . . . . . . . . . 4.8.1 Large operators . . . . . . . . . . . 4.8.2 Multiline subscripts and superscripts 4.9 Math accents . . . . . . . . . . . . . . . . 4.10 H orizontal lines that stretch . . . . . . . . 4.10.1 H orizontal braces . . . . . . . . . . 4.10.2 O ver and underlines . . . . . . . . 4.10.3 Stretchable arrow math symbols . . 4.11 The spacing of symbols . . . . . . . . . . . 4.12 Building new symbols . . . . . . . . . . . . 4.12.1 Stacking symbols . . . . . . . . . . 4.12.2 Declaring the type . . . . . . . . . 4.13 Vertical spacing . . . . . . . . . . . . . . . 4.14 Math alphabets and symbols . . . . . . . . 4.14.1 Math alphabets . . . . . . . . . . . 4.14.2 Math alphabets of symbols . . . . . 4.14.3 Bold math symbols . . . . . . . . . 4.14.4 Size changes . . . . . . . . . . . . . 4.14.5 Continued fractions . . . . . . . . .
14 0 141 143 144 146 146 147 148 149 149 150 151 152 153 153 154 155 155 156 157 158 159 159 160 161 162 162 163 164 164 166 167 168 169 170 171 172 173 175 175
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents
xi
5
4.15 Tagging and grouping . . . . . . . . . . . . . . . . . . . . . . . 4.16 Generalized fractions . . . . . . . . . . . . . . . . . . . . . . . . 4.17 Boxed formulas . . . . . . . . . . . . . . . . . . . . . . . . . . .
176 178 179
Multiline math displays 5.1 Gathering formulas . . . . . . . . . . . . . . . . . . . . 5.2 Splitting a long formula . . . . . . . . . . . . . . . . . . 5.3 Some general rules . . . . . . . . . . . . . . . . . . . . 5.3.1 The subformula rule . . . . . . . . . . . . . . . 5.3.2 Group numbering . . . . . . . . . . . . . . . . 5.4 Aligned columns . . . . . . . . . . . . . . . . . . . . . 5.4.1 The subformula rule revisited . . . . . . . . . . 5.4.2 Align variants . . . . . . . . . . . . . . . . . . . 5.4.3 Intertext . . . . . . . . . . . . . . . . . . . . . . 5.5 Aligned subsidiary math environments . . . . . . . . . . 5.5.1 Subsidiary variants of aligned math environments 5.5.2 Split . . . . . . . . . . . . . . . . . . . . . . . . 5.6 Adjusted columns . . . . . . . . . . . . . . . . . . . . . 5.6.1 Matrices . . . . . . . . . . . . . . . . . . . . . . 5.6.2 Arrays . . . . . . . . . . . . . . . . . . . . . . . 5.6.3 Cases . . . . . . . . . . . . . . . . . . . . . . . 5.7 Commutative diagrams . . . . . . . . . . . . . . . . . . 5.8 Pagebreak . . . . . . . . . . . . . . . . . . . . . . . . .
18 0 181 182 184 185 186 187 188 189 192 193 193 195 198 198 201 203 204 205
III
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
D ocument structure
6 LATEX documents 6.1 The structure of a document . . 6.2 The preamble . . . . . . . . . . 6.3 Front matter . . . . . . . . . . . 6.3.1 Abstract . . . . . . . . . 6.3.2 Table of contents . . . . 6.4 Main matter . . . . . . . . . . . 6.4.1 Sectioning . . . . . . . . 6.4.2 Cross-referencing . . . . 6.4.3 Tables and figures . . . . 6.5 Back matter . . . . . . . . . . . 6.5.1 Bibliography in an article 6.5.2 Index . . . . . . . . . . 6.6 Page style . . . . . . . . . . . .
20 9 . . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
21 1 212 213 214 214 215 217 217 220 223 227 227 231 232
xii
Contents 7
8
IV 9
Standard LATEX document classes 7.1 The article, report, and book document classes 7.1.1 More on sectioning . . . . . . . . . . . . . 7.1.2 O ptions . . . . . . . . . . . . . . . . . . . 7.2 The letter document class . . . . . . . . . . . . 7.3 The LATEX distribution . . . . . . . . . . . . . . . 7.3.1 Tools . . . . . . . . . . . . . . . . . . . . AMS-LATEX documents 8.1 The three AMS document classes 8.1.1 Font size commands . . . 8.2 The top matter . . . . . . . . . . 8.2.1 Article info . . . . . . . . 8.2.2 Author info . . . . . . . . 8.2.3 AMS info . . . . . . . . . 8.2.4 Multiple authors . . . . . 8.2.5 Examples . . . . . . . . . 8.3 AMS article template . . . . . . . 8.4 O ptions . . . . . . . . . . . . . . 8.4.1 Math options . . . . . . . 8.5 The AMS-LATEX packages . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . .
. . . . . . . . . . . .
. . . . . .
. . . . . . . . . . . .
. . . . . .
. . . . . . . . . . . .
. . . . . .
. . . . . . . . . . . .
. . . . . .
. . . . . . . . . . . .
. . . . . .
. . . . . . . . . . . .
. . . . . .
. . . . . . . . . . . .
. . . . . .
23 5 235 236 237 239 240 241
. . . . . . . . . . . .
24 3 243 244 244 245 246 249 250 250 253 257 260 261
Customizing Customizing LATEX 9.1 U ser-defined commands . . . . . . . . . . . . . . . 9.1.1 Commands as shorthand . . . . . . . . . . . 9.1.2 Arguments . . . . . . . . . . . . . . . . . . 9.1.3 Redefining commands . . . . . . . . . . . . 9.1.4 O ptional arguments . . . . . . . . . . . . . . 9.1.5 Redefining names . . . . . . . . . . . . . . . 9.1.6 Showing the meaning of commands . . . . . 9.2 U ser-defined environments . . . . . . . . . . . . . . 9.2.1 Short arguments . . . . . . . . . . . . . . . 9.3 Numbering and measuring . . . . . . . . . . . . . . 9.3.1 Counters . . . . . . . . . . . . . . . . . . . 9.3.2 Length commands . . . . . . . . . . . . . . 9.4 Delimited commands . . . . . . . . . . . . . . . . . 9.5 A custom command file . . . . . . . . . . . . . . . . 9.6 Custom lists . . . . . . . . . . . . . . . . . . . . . . 9.6.1 Length commands for the list environment 9.6.2 The list environment . . . . . . . . . . . .
265 . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
26 7 268 268 271 274 275 276 276 279 282 282 283 287 290 292 297 297 299
Contents
xiii 9.6.3 Two complete examples . . . . . . . . . . . . . . . . . . 9.6.4 The trivlist environment . . . . . . . . . . . . . . . . 9.7 Custom formats . . . . . . . . . . . . . . . . . . . . . . . . . . .
V
Long bibliographies and indexes
30 9
10 B I BTEX 10.1 The database . . . . . . . . . . . . . . . . . . 10.1.1 Entry types . . . . . . . . . . . . . . . 10.1.2 Articles . . . . . . . . . . . . . . . . . 10.1.3 Books . . . . . . . . . . . . . . . . . . 10.1.4 Conference proceedings and collections 10.1.5 Theses . . . . . . . . . . . . . . . . . . 10.1.6 Technical reports . . . . . . . . . . . . 10.1.7 Manuscripts . . . . . . . . . . . . . . . 10.1.8 O ther entry types . . . . . . . . . . . . 10.1.9 Abbreviations . . . . . . . . . . . . . . 10.2 U sing B I BTEX . . . . . . . . . . . . . . . . . . 10.2.1 The sample files . . . . . . . . . . . . . 10.2.2 The setup . . . . . . . . . . . . . . . . 10.2.3 The four steps of B I BTEXing . . . . . . 10.2.4 The files of B I BTEX . . . . . . . . . . . 10.2.5 B I BTEX rules and messages . . . . . . . 10.2.6 Concluding comments . . . . . . . . . 11 MakeIndex 11.1 Preparing the document . . 11.2 Index entries . . . . . . . . 11.3 Processing the index entries 11.4 Rules . . . . . . . . . . . . . 11.5 Glossary . . . . . . . . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
301 304 304
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . . . . . . . . . . . . . .
. . . . .
. . . . . . . . . . . . . . . . .
. . . . .
. . . . . . . . . . . . . . . . .
. . . . .
. . . . . . . . . . . . . . . . .
. . . . .
. . . . . . . . . . . . . . . . .
. . . . .
. . . . . . . . . . . . . . . . .
. . . . .
. . . . . . . . . . . . . . . . .
. . . . .
. . . . . . . . . . . . . . . . .
. . . . .
. . . . . . . . . . . . . . . . .
. . . . .
. . . . . . . . . . . . . . . . .
31 1 311 312 315 316 317 319 320 321 321 322 323 323 325 325 327 329 331
. . . . .
33 2 332 335 339 342 344
A Math symbol tables
34 5
B Text symbol tables
35 6
C The AMS-LATEX sample article
36 0
D Sample article with user-defined commands
37 2
xiv
Contents E Background E.1 A short history . . . . . . . . . . . E.1.1 The first interim solution . . E.1.2 The second interim solution E.2 H ow does it work? . . . . . . . . . E.2.1 The layers . . . . . . . . . . E.2.2 Typesetting . . . . . . . . . E.2.3 Viewing and printing . . . . E.2.4 The files of LATEX . . . . . .
. . . . . . . .
37 9 379 381 382 382 382 383 384 385
F PostScript fonts F.1 The Times font and MathTıme . . . . . . . . . . . . . . . . . . . F.2 LucidaBright fonts . . . . . . . . . . . . . . . . . . . . . . . . .
38 7 387 390
G Getting it G.1 Getting TEX . . . . . . . . G.2 Where to get it? . . . . . . G.3 Getting ready . . . . . . . G.4 Transferring files . . . . . G.5 More advanced file transfer G.6 The sample files . . . . . . G.7 AMS and the user groups
. . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . commands . . . . . . . . . . . . . . .
H Conversions H .1 From Plain TEX . . . . . . . . H .1.1 TEX code in LATEX . . H .2 From LATEX . . . . . . . . . . H .2.1 Version 2e . . . . . . . H .2.2 Version 2.09 . . . . . H .2.3 The LATEX symbols . . H .3 From AMS-TEX . . . . . . . . H .4 From AMS-LATEX version 1.1 I
. . . . . . . .
Final word I.1 What was left out? . . . . . . I.1.1 O mitted from LATEX I.1.2 O mitted from TEX . I.2 Further reading . . . . . . .
. . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
39 2 392 393 395 396 398 400 400
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
40 2 402 403 403 404 404 405 405 406
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
41 0 410 410 411 411
Bibliography
41 3
Afterword
41 6
Index
41 9
List of tables . . . . . .
74 76 76 77 77 85
3.1 Tabular table . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Floating table with \multicolumn . . . . . . . . . . . . . . . . . 3.3 Tabular table with \multicolumn and \cline . . . . . . . . . .
133 136 137
2.1 2.2 2.3 2.4 2.5 2.6
Special characters . . . . . . . . . . . . . . . . . . . . Font table for Computer Modern typewriter style font European accents . . . . . . . . . . . . . . . . . . . . Extra text symbols . . . . . . . . . . . . . . . . . . . . European characters . . . . . . . . . . . . . . . . . . . Font family switching commands . . . . . . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
xv
. . . . .
. . . . . . . .
. . . . .
. . . . . . . .
. . . . .
. . . . . . . .
. . . . .
. . . . . . . .
. . . . .
. . . . . . . .
. . . . .
. . . . . . . .
. . . . .
. . . . . . . .
. . . . .
. . . . . . . .
. . . . .
. . . . . . . .
. . . . .
. . . . . . . .
. . . . .
. . . . . . . .
. . . . .
. . . . . . . .
. . . . .
. . . . . . . .
. . . . .
. . . . . . . .
. . . . . .
277 283
. . . . .
. . . . . . . .
. . . . . .
9.1 Table of redefinable names in LATEX . . . . . . . . . . . . . . . . 9.2 Standard LATEX counters . . . . . . . . . . . . . . . . . . . . . . H ebrew letters . . . . . . . . . Greek characters . . . . . . . . LATEX binary relations . . . . . AMS binary relations . . . . . AMS negated binary relations .
. . . . . . . .
. . . . . .
153 153 157 157 158 159 161 165
A.1 A.2 A.3 A.4 A.5
. . . . . . . .
. . . . . .
. . . . . . . .
4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8
Standard delimiters . . . Arrow delimiters . . . . O perators without limits O perators with limits . . Congruences . . . . . . Large operators . . . . . Math accents . . . . . . Spacing commands . . .
. . . . . .
. . . . .
. . . . . . . .
. . . . .
. . . . .
345 346 347 348 349
xvi
List of tables A.6 A.7 A.8 A.9 A.10 A.11 A.12 A.13
Binary operations . . . . Arrows . . . . . . . . . . Miscellaneous symbols . . Math spacing commands Delimiters . . . . . . . . O perators . . . . . . . . Math accents . . . . . . . Math font commands . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
350 351 352 353 353 354 355 355
B.1 B.2 B.3 B.4 B.5 B.6 B.7 B.8
Special text characters . . . Text accents . . . . . . . . Some European characters Extra text symbols . . . . . Text spacing commands . Text font commands . . . Font size changes . . . . . AMS font size changes . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
356 357 357 357 358 358 359 359
F.1 Lower font table for the Times font . . . . . . . . . . . . . . . . F.2 U pper font table for the Times font . . . . . . . . . . . . . . . .
389 389
G.1 Some U NIX commands . . . . . . . . . . . . . . . . . . . . . . G.2 Some ftp commands . . . . . . . . . . . . . . . . . . . . . . . .
395 396
H .1 H .2 H .3 H .4
TEX commands to avoid in LATEX . . . . . . . . . . A translation table . . . . . . . . . . . . . . . . . . . AMS-TEX style commands dropped in AMS-LATEX AMS-TEX commands to avoid . . . . . . . . . . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
404 405 407 408
List of figures 1.1 A schematic view of an article . . . . . . . . . . . . . . . . . . . 1.2 The structure of LATEX . . . . . . . . . . . . . . . . . . . . . . . 1.3 U sing LATEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
212 219 219 233
8.1 fleqn and reqno options for equations . . . . . . . . . . . . . . 8.2 Top-or-bottom tags option for split . . . . . . . . . . . . . . . 8.3 AMS-LATEX package and document class interdependency . . . .
258 258 263
9.1 The layout of a custom list . . . . . . . . . . . . . . . . . . . . .
298
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
326 326
11.1 A sample index . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 U sing MakeIndex, Step 1 . . . . . . . . . . . . . . . . . . . . . . 11.3 U sing MakeIndex, Step 2 . . . . . . . . . . . . . . . . . . . . . .
335 340 340
6.1 6.2 6.3 6.4
The structure of a document . . . . . . . . . . . . . . Sectioning commands in the article document class Sectioning commands in the amsart document class . Page layout for the article document class . . . . .
10.1 U sing B I BTEX, Step 2 10.2 U sing B I BTEX, Step 3
xvii
. . . .
. . . .
. . . .
. . . .
. . . .
34 51 53
Preface It is indeed a lucky author who is given the opportunity to completely rewrite a book barely a year after its publication. Writing about software affords such opportunities (especially if the original edition sold out), since the author is shooting at a moving target. LATEX and AMS-LATEX improved dramatically with the release of the new standard LATEX (called LATEX2 ε ) in June of 1994 and the revision of AMS-LATEX (version 1.2) in February of 1995. The change in AMS-LATEX is profound. LATEX2 ε made it possible for AMS-LATEX to join the LATEX world. O ne of the main points of the present book is to make this clear. This book introduces LATEX as a tool for mathematical typesetting, and treats AMS-LATEX as a set of enhancements to the standard LATEX, to be used in conjunction with hundreds of other LATEX2 ε enhancements. I am not a TEX expert. Learning the mysteries of the system has given me great respect for those who crafted it: Donald Knuth, Leslie Lamport, Michael Spivak, and others did the original work; David Carlisle, Michael J. Downes, David M. Jones, Frank Mittelbach, Rainer Sch o¨ pf, and many others built on the work of these pioneers to create the new LATEX and AMS-LATEX. Many of these experts and a multitude of others helped me while I was writing this book. I would like to express my deepest appreciation and heartfelt thanks to all who gave their time so generously. Their story is told in the Afterword. O f course, the responsibility is mine for all the mistakes remaining in the book. Please send corrections—and suggestions for improvements—to me at the following address: Department of Mathematics U niversity of Manitoba Winnipeg MB, R3T 2N2 Canada e-mail: George [email protected] xviii
Introduction Is thi s book for you? This book is for the mathematician, engineer, scientist, or technical typist who wants to write and typeset articles containing mathematical formulas but does not want to spend much time learning how to do it. I assume you are set up to use LATEX, and you know how to use an editor to type a document, such as: \documentclass{article} \begin{document} The square root of two: $\sqrt{2}$. \end{document}
I can type math!
I also assume you know how to typeset a document, such as this example, with LATEX to get the printed version:
The square root of two:
√ 2. I can type math!
and you can view and print the typeset document. And what do I promise to deliver? I hope to provide you with a solid foundation in LATEX, the AMS enhancements, and some standard LATEX enhancements, so typing a mathematical document will become second nature to you.
H ow to read thi s book? Part I gives a short course in LATEX. Read it, work through the examples, and you are ready to type your first paper. Later, at your leisure, read the other parts to become more proficient. xix
xx
Introduction The rest of this section introduces TEX, LATEX, and AMS-LATEX, and then outlines what is in this book. If you already know that you want to use LATEX to typeset math, you may choose to skip it.
TEX, LATEX, and AMS-LATEX TEX is a typesetting language created by Donald E. Knuth; it has extensive capabilities to typeset math. LATEX is an extension of TEX designed by Leslie Lamport; its major features include a strong focus on document structure and the logical markup of text; automatic numbering and cross-referencing. AMS-LATEX distills the decades-long experience of the American Mathematical Society (AMS) in publishing mathematical journals and books; it addsto LATEX a host of features related to mathematical typesetting, especially the typesetting of multiline formulas and the production of finely-tuned printed output. Articles written in LATEX (and AMS-LATEX) are accepted for publication by an increasing number of journals, including all the journals of the AMS. Look at the typeset sample articles: sampart.tex (in Appendix C, on pages 361–363) and intrart.tex (on pages 39–40). You can begin creating such highquality typeset articles after completing Part I.
What i s document markup? Most word processing programs are WYSIWYG (what you see is what you get); as you work, the text on the computer monitor is shown, more or less, as it’ll look when printed. Different fonts, font sizes, italics, and bold face are all shown. A different approach is taken by a markup language. It works with a text editor, an editing program that shows the text, the source file, on the computer monitor with only one font, in one size and shape. To indicate that you wish to change the font in the printed copy in some way, you must “mark up” the source file. For instance, to typeset the phrase “Small Caps” in small caps, you type \textsc{Small Caps} The \textsc command is a markup command, and the printed output is
Small Caps TEX is a markup language; LATEX is another markup language, an extension of TEX. Actually, it’s quite easy to learn how to mark up text. For another example, look at the abstract of the sampart.tex sample article (page 364), and the instruction
Introduction
xxi
\emph{complete-simple distributive lattices} to emphasize the phrase “complete-simple distributive lattices”, which when typeset looks like
complete-simple distributive lattices O n pages 364–371 we show the source file and the typeset version of the sampart.tex sample article together. The markup in the source file may appear somewhat bewildering at first, especially if you have previously worked on a WYSIWYG word processor. The typeset article is a rather pleasing-to-the-eye polished version of that same marked up material.1
TEX TEX has excellent typesetting capabilities. It deals with mathematical formulas as √ 2 2 well as text. To get a + b in a formula, type \sqrt{a^{2} + b^{2}}. There is no need to worry about how to construct the square root symbol that covers a2 + b2 . A tremendous appeal of the TEX language is that a source file is plain text, sometimes called an ASCII file.2 Therefore articles containing even the most complicated mathematical expressions can be readily transmitted electronically—to colleagues, coauthors, journals, editors, and publishers. TEX is platform independent. You may type the source file on a Macintosh, and your coauthor may make improvements to the same file on an IBM compatible personal computer; the journal publishing the article may use a DEC minicomputer. The form of TEX, a richer version, used to typeset documents is called Plain TEX . I’ll not try to distinguish between the two. TEX, however, is a programming language, meant to be used by programmers.
LATEX LATEX is much easier and safer to work with than TEX; it has a number of built-in safety features and a large set of error messages. LATEX, building on TEX, provides the following additional features: An article is divided into logical units such as an abstract, sections, theorems, a bibliography, and so on. The logical units are typed separately. After all the 1 O f course, markup languages have always dominated typographic work of high quality. O n the Internet, the most trendy communications on the World Wide Web are written in a markup language called H TML (H yperText Markup Language). 2 ASCII stands for American Standard Code for Information Interchange.
xxii
Introduction units have been typed, LATEX organizes the placement and formatting of these elements. Notice line 4 of the source file of the sampart.tex sample article \documentclass{amsart} on page 364. H ere the general design is specified by the amsart “document class”, which is the AMS article document class. When submitting your article to a journal that is equipped to handle LATEX articles (and the number of such journals is increasing rapidly), only the name of the document class is replaced by the editor to make the article conform to the design of the journal. LATEX relieves you of tedious bookkeeping chores. Consider a completed article, with theorems and equations numbered and properly cross-referenced. U pon final reading, some changes must be made—for example, section 4 has to be placed after section 7, and a new theorem has to be inserted somewhere in the middle. Such a minor change used to be a major headache! But with LATEX, it becomes almost a pleasure to make such changes. LATEX automatically redoes all the numbering and cross-references. Typing the same bibliographic references in article after article is a tedious chore. With LATEX you may use B I BTEX, a program that helps you create and maintain bibliographic databases, so references need not be retyped for each article. B I BTEX will select and format the needed references from the databases. All the features of LATEX are made available by the LaTeX format, which you should use to typeset the sample documents in this book.
AMS-LATEX The AMS enhanced the capabilities of LATEX in three different areas. You decide which of these are important to you. 1. Math enhancements. The first area of improvement is a wide variety of tools for typesetting math. AMS-LATEX provides excellent tools to deal with multiline math formulas requiring special alignment. For instance, in the following formula, the equals sign (=) is vertically aligned and so are the explanatory comments: x = (x + y)(x + z) = x + yz = yz
(by distributivity) (by Condition (M))
Introduction
xxiii numerous constructs for typesetting math, exemplified by the following formula: 2 if x < 0; −x , f (x) = α + x, if 0 ≤ x ≤ 1; x2 , otherwise. special spacing rules for dozens of formula types, for example a ≡ b (mod Θ) If the above formula is typed inline, it becomes: a ≡ b (mod Θ); the spacing is automatically changed. multiline “subscripts” as in X 2 αi,j i
\eqslantless
0
\eqslantgtr
1
\lesssim
.
\gtrsim
&
\lessapprox
/
\gtrapprox
'
\approxeq
≅
\lessdot
⋖
\gtrdot
⋗
\lll
≪
\ggg
≫
\lessgtr
≶
\gtrless
≷
\lesseqgtr
⋚
\gtreqless
R
\lesseqqgtr
S
\gtreqqless
T
\doteqdot
+
\eqcirc
≖
\circeq
⊜
\fallingdotseq
;
\risingdotseq
:
\triangleq
,
\backsim
∽
\thicksim
∼
\backsimeq
⋍
\thickapprox
≈
\preccurlyeq
4
\succcurlyeq