ebook img

TeX for the impatient PDF

354 Pages·2003·1.429 MB·english
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview TeX for the impatient

T X for the Impatient E Copyright(cid:13)c 2003PaulW.Abrahams,KathrynA.Hargreaves,andKarl Berry. ‘TEX’isatrademarkoftheAmericanMathematicalSociety. ‘METAFONT’isatrademarkofAddison-WesleyPublishingCompany. This book, TEX for the Impatient, contains both tutorial and reference informationonallfeaturesofbothplainandprimitiveTEX. Preface DonaldKnuth’sTEX,acomputerizedtypesettingsystem,providesnearly everythingneededforhigh-qualitytypesettingofmathematicalnotations as well as of ordinary text. It is particularly notable for its flexibility, its superb hyphenation, and its ability to choose aesthetically satisfying line breaks. Because of its extraordinary capabilities, TEX has become the leadingtypesettingsystemformathematics,science,andengineeringand has been adopted as a standard by the American Mathematical Society. A companion program, METAFONT, can construct arbitrary letterforms including,inparticular,anysymbolsthatmightbeneededinmathemat- ics. Both TEX and METAFONT are widely available within the scientific and engineering community and have been implemented on a variety of computers. TEX isn’t perfect—it lacks integrated support for graphics, and some effects such as revision bars are very difficult to produce—but thesedrawbacksarefaroutweighedbyitsadvantages. TEX for the Impatient is intended to serve scientists, mathematicians, andtechnicaltypistsforwhomTEXisausefultoolratherthanaprimary interest, as well as computer people who have a strong interest in TEX for its own sake. We also intend it to serve both newcomers to TEX and those who are already familiar with TEX. We assume that our readers are comfortable working with computers and that they want to get the information they need as quickly as possible. Our aim is to provide that informationclearly,concisely,andaccessibly. Thisbookthereforeprovidesabrightsearchlight,astoutwalking-stick, anddetailedmapsforexploringandusingTEX. Itwillenableyoutomas- ter TEX at a rapid pace through inquiry and experiment, but it will not lead you by the hand through the entire TEX system. Our approach is to provideyouwithahandbookforTEXthatmakesiteasyforyoutoretrieve whateverinformationyouneed. WeexplainboththefullrepertoireofTEX commandsandtheconceptsthatunderliethem. Youwon’thavetowaste yourtimeplowingthroughmaterialthatyouneitherneednorwant. In the early sections we also provide you with enough orientation so thatyoucangetstartedifyouhaven’tusedTEXbefore. Weassumethat you have access to a TEX implementation and that you know how to use a text editor, but we don’t assume much else about your background. Becausethisbookisorganizedforreadyreference,you’llcontinuetofind it useful as you become more familiar with TEX. If you prefer to start with a carefully guided tour, we recommend that you first read Knuth’s The TEXbook (see page 18 for a citation), passing over the “dangerous bend” sections, and then return to this book for additional information and for reference as you start to use TEX. (The dangerous bend sections ofTheTEXbook coveradvancedtopics.) The structure of TEX is really quite simple: a TEX input document consists of ordinary text interspersed with commands that give TEX fur- ther instructions on how to typeset your document. Things like math formulas contain many such commands, while expository text contains relatively few of them. The time-consuming part of learning TEX is learning the commands andtheconceptsunderlyingtheirdescriptions. Thuswe’vedevotedmost of the book to defining and explaining the commands and the concepts. We’ve also provided examples showing TEX typeset output and the cor- responding input, hints on solving common problems, information about error messages, and so forth. We’ve supplied extensive cross-references bypagenumberandacompleteindex. We’vearrangedthedescriptionsofthecommandssothatyoucanlook themupeitherbyfunctionoralphabetically. Thefunctionalarrangement is what you need when you know what you want to do but you don’t know what command might do it for you. The alphabetical arrangement is what you need when you know the name of a command but you don’t know exactly what it does. We must caution you that we haven’t tried to provide a complete def- inition of TEX. For that you’ll need The TEXbook, which is the original source of information on TEX. The TEXbook also contains a lot of infor- mation about the fine points of using TEX, particularly on the subject of composingmathformulas. Werecommendithighly. In 1989 Knuth made a major revision to TEX in order to adapt it to 8-bit character sets, needed to support typesetting for languages other than English. The description of TEX in this book incorporates that revision (see p.18). YoumaybeusingaspecializedformofTEXsuchasLATEXorAMS-TEX (see p.18). Although these specialized forms are self-contained, you may stillwanttousesomeofthefacilitiesofTEXitselfnowandtheninorderto gainthefinercontrolthatonlyTEXcanprovide. Thisbookcanhelpyou to learn what you need to know about those facilities without having to learnaboutalotofotherthingsthatyouaren’tinterestedin. Twoofus(K.A.H.andK.B.)weregenerouslysupportedbytheUniver- sity of Massachusetts at Boston during the preparation of this book. In particular,RickMartinkeptthemachinesrunning,andRobertA.Morris and Betty O’Neil made the machines available. Paul English of Interleaf helpedusproduceproofsforacoverdesign. We wish to thank the reviewers of our book: Richard Furuta of the University of Maryland, John Gourlay of Arbortext, Inc., Jill Carter Knuth, and Richard Rubinstein of the Digital Equipment Corporation. Wetooktohearttheirperceptiveandunsparingcriticismsoftheoriginal manuscript,andthebookhasbenefittedgreatlyfromtheirinsights. We are particularly grateful to our editor, Peter Gordon of Addison- Wesley. This book was really his idea, and throughout its development he has been a source of encouragement and valuable advice. We thank hisassistantatAddison-Wesley,HelenGoldstein,forherhelpinsomany ways, and Loren Stevens of Addison-Wesley for her skill and energy in shepherding this book through the production process. Were it not for ourcopyeditor,JaniceByer,anumberofsmallbutirritatingerrorswould have remained in this book. We appreciate her sensitivity and taste in correcting what needed to be corrected while leaving what did not need to be corrected alone. Finally, we wish to thank Jim Byrnes of Prometheus Inc. for making this collaboration possible by introducing us to each other. Deerfield, Massachusetts P.W.A. Manomet, Massachusetts K.A.H., K.B. Prefacetothefreeedition: Thisbookwasoriginallypublishedin1990 by Addison-Wesley. In 2003, it was declared out of print and Addison- Wesley generously reverted all rights to us, the authors. We decided to make the book available in source form, under the GNU Free Documen- tationLicense,asourwayofsupportingthecommunitywhichsupported the book in the first place. See the copyright page for more information on the licensing. The illustrations which were part of the original book are not included here. Someofthefontshavealsobeenchanged;now,onlyfreely-available fontsareused. Weleftthecropmarksandgalleyinformationonthepages, to serve as identification. An old version of Eplain was used to produce it; seetheeplain.texfilefordetails. We don’t plan to make any further changes or additions to the book ourselves, except for correction of any outright errors reported to us, and perhapsinclusionoftheillustrations. Our distribution of the book is at ftp://tug.org/tex/impatient. [email protected]. Brief contents 1 \ Using this book 1 2 \ Using TEX 7 3 \ Examples 21 4 \ Concepts 43 5 \ Commands for composing paragraphs 97 6 \ Commands for composing pages 133 7 \ Commands for horizontal and vertical modes 153 8 \ Commands for composing math formulas 187 9 \ Commands for general operations 221 10 \ Tips and techniques 265 11 \ Making sense of error messages 283 12 \ A compendium of useful macros 291 13 \ Capsule summary of commands 313 GNU Free Documentation License 341 Index 351 Contents 1 \ Using this book 1 Syntactic conventions 2 Descriptions of the commands 3 2 \ Using TEX 7 Turning input into ink 7 Programs and files you need ·7 Running TEX ·9 Preparing an input file 10 Commands and control sequences ·10 Arguments ·11 Parameters ·12 Spaces ·12 Comments ·13 Punctuation ·13 Special characters ·15 Groups ·15 Math formulas ·16 How TEX works 16 New TEX versus old TEX 18 Resources 18 3 \ Examples 21 Entering simple text 22 Indentation 24 Fonts and special characters 26 Interline spacing 28 Spacing, rules, and boxes 30 Odds and ends 32 Using fonts from other sources 34 A ruled table 36 Typesetting mathematics 38 More mathematics 40 4 \ Concepts 43 5 \ Commands for composing paragraphs 97 Characters and accents 97 Letters and ligatures for European alphabets ·97 Special symbols ·98 Arbitrary characters ·99 Accents ·100 Defeating boundary ligatures ·101 Selecting fonts 102 Particular fonts ·102 Type styles ·103 Uppercase and lowercase 103 Interword spacing 104 Centering and justifying lines 108 Shaping paragraphs 110 Starting, ending, and indenting paragraphs ·110 Shaping entire paragraphs ·114 Line breaks 120 Encouraging or discouraging line breaks ·120 Line breaking parameters ·123 Hyphenation ·126 Section headings, lists, and theorems 129 6 \ Commands for composing pages 133 Interline and interparagraph spaces 133 Page breaks 136 Encouraging or discouraging page breaks ·136 Page breaking parameters ·138 Page layout 140 Page description parameters ·140 Page numbers ·142 Header and footer lines ·143 Marks ·144 Insertions 145 Footnotes ·145 General insertions ·146 Modifying the output routine 148 Splitting vertical lists 149 7 \ Commands for horizontal and vertical modes 153 Producing space 153 Fixed-width horizontal space ·153 Fixed-length vertical space ·154 Variable-size space ·155 Manipulating boxes 160 Constructing hboxes and vboxes ·160 Setting and retrieving the contents of boxes ·164 Shifting boxes ·166 Dimensions of box registers ·167 Struts, phantoms, and empty boxes ·167 Parameters pertaining to malformed boxes ·170 Retrieving the last item from a list 171 Rules and leaders 172 Alignments 176 Tabbing alignments ·176 General alignments ·178 8 \ Commands for composing math formulas 187 Simple parts of formulas 187 Greek letters ·187 Miscellaneous ordinary math symbols ·188 Binary operations ·189 Relations ·190 Left and right delimiters ·191 Arrows ·192 Named mathematical functions ·193 Large operators ·194 Punctuation ·196 Superscripts and subscripts 197 Selecting and using styles ·198 Compound symbols 199 Math accents ·199 Fractions and other stacking operations ·200 Dots ·203 Delimiters ·204 Matrices ·205 Roots and radicals ·206 Equation numbers 207 Multiline displays 208 Fonts in math formulas 209 Constructing math symbols 211 Making delimiters bigger ·211 Parts of large symbols ·211 Aligning parts of a formula 212 Aligning accents ·212 Aligning material vertically ·213 Producing spaces 214 Fixed-width math spaces ·214 Variable-width math spaces ·215 Spacing parameters for displays ·216 Other spacing parameters for math ·217 Categorizing math constructs 218 Special actions for math formulas 218 9 \ Commands for general operations 221 Naming and modifying fonts 221 Converting information to tokens 224 Numbers ·224 Environmental information ·224 Values of variables ·226 Grouping 227 Macros 230 Defining macros ·230 Other definitions ·232 Controlling expansion ·233 Conditional tests ·235 Repeated actions ·240 Doing nothing ·241 Registers 242 Using registers ·242 Naming and reserving registers, etc. ·244 Doing arithmetic in registers ·245 Ending the job 246 Input and output 247 Operations on input files ·247 Operations on output files ·249 Interpreting input characters ·251 Controlling interaction with TEX 252 Diagnostic aids 253 Displaying internal data ·253 Specifying what is traced ·256 Sending messages ·261 Initializing TEX 263 10 \ Tips and techniques 265 Correcting bad page breaks 265 Preserving the end of a page 267 Leaving space at the top of a page 267 Correcting bad line breaks 268 Correcting overfull or underfull boxes 268 Recovering lost interword spaces 270 Avoiding unwanted interword spaces 270 Avoiding excess space around a display 271 Avoiding excess space after a paragraph 271 Changing the paragraph shape 272 Putting paragraphs into a box 272 Drawing lines 273 Creating multiline headers or footers 274 Finding mismatched braces 275 Setting dimensions 276 Creating composite fonts 276 Reproducing text verbatim 277 Using outer macros 279 Changing category codes 280 Making macro files more readable 281

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.