\Title{Formatting Information}
Total Page:16
File Type:pdf, Size:1020Kb
\title{formatting information} An introduction to typesetting with LATEX Peter Flynn Formatting information An introduction to typesetting with LATEX This document is copyright © 1999–2011 by Silmaril Consultants under the terms of what is now the GNU Free Documentation License (copyleft). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front• Cover Texts, and no Back•Cover Texts. A copy of the license is included in Appendix D. You are allowed to distribute, reproduce, and modify this document without fee or further requirement for consent subject to the conditions in §D.4. The author has asserted his right to be identified as the author of this document. If you make useful modifications you are asked to inform the author so that the master copy can be updated for the benefit of others. Acknowledgments Earlier editions of ‘Formatting Information’ were prompted by the gener• ous help I received from TEX users too numerous to mention individually. Shortly after TUGboat published the November 2003 edition, I was re• minded by a spate of email of the fragility of documentation for any system which is constantly under development. While the core of LATEX is as stable as ever, there been revisions to packages, issues of new distributions, new tools, new interfaces, new books and online documents, corrections to my own errors, suggestions for rewording, and in one or two cases mild abuse for having omitted package X which the author felt to be indispensable. The current edition is the result of a few years of allowing it to lie fallow, accumulating suggestions and finding errors, but taking on board the large number of changes which daily pass in front of all of us who read comp.text.tex, and the sometimes more obvious changes visible when one installs a new version of TEX. I am grateful as always to the people who sent me corrections and suggestions for improvement. Please keep them coming: only this way can this book reflect what people want to learn. The same limitation still applies, however: no mathematics, as there are already a dozen or more excellent books on the market — as well as online documents — dealing with mathematical typesetting in TEX and LATEX in finer and better detail than I am capable of (and listed in About this book on p.xvii). As I was finishing an earlier edition, I was asked to review an article for The PracTEX Journal, which grew out of the Practical TEX Conference in 2004. The author specifically took the writers of documentation to task for failing to explain things more clearly, and as I read more, I found myself agreeing, and resolving to clear up some specific problems areas as far as possible. I was delighted to see at the Practical TEX Conference, in 2006 and later, that more presenters, especially in the Humanities, have stepped up to Peter Flom’s challenge. It is very difficult for people who write technical documentation to remember how they struggled to learn what has now become to them a familiar system. So much of what we do is second nature, and a lot of it actually has nothing to do with the software, but more with the way in which we view and approach information, and the general level of knowledge of computing. As computer systems become more sophisticated, they require less detailed knowledge from users, even while the takeup of computer usage rises. The result is a generation of users who know what they want, but who are wholly incapable of knowing when they’ve got it; who have only ever seen one way of doing something, and believe that if the result looks pretty, it means it must be right. As technical writers, we need to explain why, not just how, so if I have obscured something by making Formatting information ✄ i ✂ ✁ unreasonable assumptions about your knowledge, please let me know so that I can correct it. The author Peter Flynn has been using structured text systems since the early 1980s and is author of The HTML Handbook and Understanding SGML and XML Tools, and editor of The XML FAQ (all typeset with LATEX). Peter was Ireland’s first webmaster, and also runs the text management consultancy Silmaril. When not TEXing or XMLing, he likes to cook, surf, read science fiction, and listen to Early and Baroque music. In his increasingly fractal spare time he is finishing his PhD on the usability of editors for structured text. Technical note This book is written and maintained in XML using the DocBook DTD with a customization layer for typographic markup. XSLT is used to generate HTML (for the Web and plain•text versions) and LATEX (for PDF). The November 2003 edition was published in TUGboat. ✄ ii Formatting information ✂ ✁ Contents Foreword..................................... ix Preface ...................................... xi Aboutthisbook................................. xv Whoneedsthisbook? ........................... xv Skillsneeded ................................ xv Objectivesofthisbook. xvi Synopsis................................... xvii Where’sthemath? ............................. xvii Availability of LATEXsystems........................ xviii Symbolsandconventions . xxi Productionnote .............................. xxi 1 Installing TEX and LATEX 1 1.1 Installingthesoftware .......................... 2 1.1.1 UnixandGNU/Linux ....................... 2 1.1.2 AppleMacOSX .......................... 4 1.1.3 MicrosoftWindows ........................ 5 1.2 Adding your personal TEXdirectory................... 8 1.2.1 UnixandGNU/Linux . 10 1.2.2 AppleMacOSX .......................... 10 1.2.3 MicrosoftWindows . 10 1.3 PickinganEditor ............................. 12 1.4 Installationproblems . .. .. .. .. .. .. .. 13 2 Using your editor to create documents 27 2.1 Markup .................................. 28 2.2 Quickstartfortheimpatient. 29 2.3 LATEXcommands.............................. 30 2.3.1 Simplecommands . .. .. .. .. .. .. 31 2.3.2 Commandswitharguments . 32 2.3.3 White•space in LATEX........................ 33 2.4 Specialcharacters ............................. 34 2.4.1 Usingthespecialcharacters . 34 2.5 Quotationmarks ............................. 35 2.6 Accents................................... 36 2.7 Dimensions, hyphenation, justification, and breaking . ....... 39 2.7.1 Specifyingsizeunits. 40 2.7.2 Hyphenation............................ 41 2.7.3 Unbreakabletext.. .. .. .. .. .. .. 42 2.7.4 Dashes ............................... 42 2.7.5 Justification ............................ 43 2.7.6 Languages ............................. 44 2.8 Mathematics................................ 44 Formatting information ✄ iii ✂ ✁ FORMATTING INFORMATION 3 Basic document structures 47 3.1 TheDocumentClassDeclaration . 48 3.1.1 Documentclassoptions. 50 3.2 Thedocumentenvironment . 51 3.3 Titling ................................... 52 3.4 Abstractsandsummaries. 53 3.5 Sections .................................. 56 3.5.1 Sectionnumbering. 58 3.6 Ordinaryparagraphs .. .. .. .. .. .. .. 59 3.7 Tableofcontents ............................. 61 4 Typesetting, viewing and printing 63 4.1 Typesetting ................................ 64 4.1.1 Running LATEX ........................... 64 4.1.2 Standard LATEX and pdfLATEX.................... 65 4.2 Errorsandwarnings ........................... 66 4.2.1 Errormessages........................... 67 4.2.2 Warnings.............................. 67 4.2.3 Examples.............................. 68 4.3 Screenpreview .............................. 70 4.3.1 PreviewingDVIoutput . 71 4.3.2 PreviewingwithPostScript . 71 4.3.3 PreviewingwithPDF . 73 4.4 Printeroutput............................... 73 5 CTAN, packages, and online help 77 5.1 Packages .................................. 78 5.1.1 Usinganexistingpackage . 78 5.1.2 Packagedocumentation . 79 5.2 Downloading and installing packages . .. 80 5.2.1 Downloadingpackages . 80 5.2.2 Installingapackage . 81 5.2.3 ReplicatingtheTDS . 84 5.3 Onlinehelp ................................ 85 5.3.1 TheFAQ............................... 85 5.3.2 TheTEXhaxmailinglist ...................... 85 5.3.3 Websites .............................. 85 5.3.4 News ................................ 86 5.3.5 Google LATEXlist .......................... 86 5.3.6 Commercialsupport. 86 ✄ iv Formatting information ✂ ✁ CONTENTS 6 Other document structures 87 6.1 Alittlethinkaboutstructure . 87 6.2 Lists .................................... 89 6.2.1 Itemizedlists............................ 89 6.2.2 Enumeratedlists.. .. .. .. .. .. .. 90 6.2.3 Descriptionlists .. .. .. .. .. .. .. 91 6.2.4 Inlinelists ............................. 91 6.2.5 Reference lists and segmented lists . 91 6.2.6 Listswithinlists .. .. .. .. .. .. .. 92 6.3 Tables.................................... 94 6.3.1 Floats................................ 95 6.3.2 Formaltables............................ 96 6.3.3 Tabularmatter........................... 96 6.3.4 Tabular techniques for alignment . 99 6.4 Figures................................... 100 6.5 Images ................................... 101 6.5.1 Makingimages........................... 103 6.5.2 Graphicsstorage. 105 6.6 Verbatimtext ............................... 106 6.6.1 Inlineverbatim. 106 6.6.2 Displayverbatim . .. .. .. .. .. .. 107 6.7 Boxes,sidebars,andpanels. 108 6.7.1 Boxesoftext ............................ 108 6.7.2 Framedboxes............................ 109 6.7.3 Sidebarsandpanels . 112 7 Textual tools 113 7.1 Quotations................................