Beginlatex A4
Beginlatex A4
Peter Flynn
Formatting information
This document is copyright 19992011 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 FrontCover 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 identied as the author of this document. If you make useful modications you are asked to inform the author so that the master copy can be updated for the benet of others.
Acknowledgments
Earlier editions of Formatting Information were prompted by the generous help I received from TEX users too numerous to mention individually. Shortly after TUGboat published the November 2003 edition, I was reminded by a spate of email of the fragility of documentation for any system A which is constantly under development. While the core of L TEX 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 nding 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 reect 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 A mathematical typesetting in TEX and L TEX in ner and better detail than I am capable of (and listed in About this book on p. xvii). As I was nishing 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 specically 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 specic 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 Floms challenge. It is very difcult 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 theyve 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
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, A and editor of The XML FAQ (all typeset with L TEX). Peter was Irelands rst webmaster, and also runs the text management consultancy Silmaril. When not TEXing or XMLing, he likes to cook, surf, read science ction, and listen to Early and Baroque music. In his increasingly fractal spare time he is nishing 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 A generate HTML (for the Web and plain-text versions) and L TEX (for PDF). The November 2003 edition was published in TUGboat.
ii
Formatting information
Contents
Foreword . . . . . . . . . . . . . Preface . . . . . . . . . . . . . . About this book . . . . . . . . . Who needs this book? . . . Skills needed . . . . . . . . Objectives of this book . . . Synopsis . . . . . . . . . . . Wheres the math? . . . . . A Availability of LTEX systems Symbols and conventions . Production note . . . . . .
A 1 Installing TEX and LTEX 1.1 Unix and GNU/Linux . . 1.2 Apple Mac OS X . . . . . 1.3 Microsoft Windows . . . 1.3.1 Beginners . . . . . 1.3.2 Experienced users 1.4 Picking an Editor . . . . 1.5 Installation problems . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
2 Using your editor to create documents 2.1 Markup . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Quick start for the impatient . . . . . . . . . . . . . . A 2.3 LTEX commands . . . . . . . . . . . . . . . . . . . . . 2.3.1 Simple commands . . . . . . . . . . . . . . . . 2.3.2 Commands with arguments . . . . . . . . . . A 2.3.3 White-space in LTEX . . . . . . . . . . . . . . . 2.4 Special characters . . . . . . . . . . . . . . . . . . . . 2.4.1 Using the special characters . . . . . . . . . . 2.5 Quotation marks . . . . . . . . . . . . . . . . . . . . 2.6 Accents . . . . . . . . . . . . . . . . . . . . . . . . . . 2.7 Dimensions, hyphenation, justication, and breaking 2.7.1 Specifying size units . . . . . . . . . . . . . . . 2.7.2 Hyphenation . . . . . . . . . . . . . . . . . . . 2.7.3 Unbreakable text . . . . . . . . . . . . . . . . . 2.7.4 Dashes . . . . . . . . . . . . . . . . . . . . . . 2.7.5 Justication . . . . . . . . . . . . . . . . . . . 2.7.6 Languages . . . . . . . . . . . . . . . . . . . . 2.8 Mathematics . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . .
Formatting information
iii
FORMATTING INFORMATION
3 Basic document structures 3.1 The Document Class Declaration 3.1.1 Document class options . . 3.2 The document environment . . . 3.3 Titling . . . . . . . . . . . . . . . 3.4 Abstracts and summaries . . . . . 3.5 Sections . . . . . . . . . . . . . . 3.5.1 Section numbering . . . . . 3.6 Ordinary paragraphs . . . . . . . 3.7 Table of contents . . . . . . . . . 4 Typesetting, viewing and printing 4.1 Typesetting . . . . . . . . . . . . A 4.1.1 Running LTEX . . . . . . . A A 4.1.2 Standard LTEX and pdfLTEX 4.2 Errors and warnings . . . . . . . 4.2.1 Error messages . . . . . . . 4.2.2 Warnings . . . . . . . . . . 4.2.3 Examples . . . . . . . . . . 4.3 Screen preview . . . . . . . . . . 4.3.1 Previewing DVI output . . 4.3.2 Previewing with PostScript 4.3.3 Previewing with PDF . . . 4.4 Printer output . . . . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
31 32 34 35 36 37 40 42 43 45 47 48 48 49 50 51 51 52 54 55 55 57 57
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
. . . . . . . . . . . .
5 CTAN, packages, and online help 5.1 Packages . . . . . . . . . . . . . . . . 5.1.1 Using an existing package . . 5.1.2 Package documentation . . . . 5.2 Downloading and installing packages 5.2.1 Downloading packages . . . . 5.2.2 Installing a package . . . . . . 5.2.3 Replicating the TDS . . . . . . 5.3 Online help . . . . . . . . . . . . . . 5.3.1 The FAQ . . . . . . . . . . . . . 5.3.2 The TEXhax mailing list . . . . 5.3.3 Web sites . . . . . . . . . . . . 5.3.4 News . . . . . . . . . . . . . . A 5.3.5 Google LTEX list . . . . . . . . 5.3.6 Commercial support . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
. . . . . . . . . . . . . .
61 62 62 63 64 64 65 68 69 69 69 69 69 70 70
iv
Formatting information
CONTENTS
6 Other document structures 6.1 A little think about structure . . . . . . 6.2 Lists . . . . . . . . . . . . . . . . . . . . 6.2.1 Itemized lists . . . . . . . . . . . . 6.2.2 Enumerated lists . . . . . . . . . . 6.2.3 Description lists . . . . . . . . . . 6.2.4 Inline lists . . . . . . . . . . . . . 6.2.5 Reference lists and segmented lists 6.2.6 Lists within lists . . . . . . . . . . 6.3 Tables . . . . . . . . . . . . . . . . . . . . 6.3.1 Floats . . . . . . . . . . . . . . . . 6.3.2 Formal tables . . . . . . . . . . . . 6.3.3 Tabular matter . . . . . . . . . . . 6.3.4 Tabular techniques for alignment 6.4 Figures . . . . . . . . . . . . . . . . . . . 6.5 Images . . . . . . . . . . . . . . . . . . . 6.5.1 Making images . . . . . . . . . . . 6.5.2 Graphics storage . . . . . . . . . . 6.6 Verbatim text . . . . . . . . . . . . . . . 6.6.1 Inline verbatim . . . . . . . . . . . 6.6.2 Display verbatim . . . . . . . . . 6.7 Boxes, sidebars, and panels . . . . . . . . 6.7.1 Boxes of text . . . . . . . . . . . . 6.7.2 Framed boxes . . . . . . . . . . . . 6.7.3 Sidebars and panels . . . . . . . . 7 Textual tools 7.1 Quotations . . . . . . . . . . . . 7.2 Footnotes and end-notes . . . . 7.3 Marginal notes . . . . . . . . . 7.4 References . . . . . . . . . . . . 7.4.1 Normal cross-references . 7.4.2 Bibliographic references . 7.5 Indexes and glossaries . . . . . 7.6 Multiple columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
71 71 73 73 74 75 75 75 76 78 79 80 80 83 84 85 87 89 90 90 91 92 92 93 96 97 97 98 100 100 101 102 108 110 111 111 112 115 116 120 121 123 124
8 Fonts and layouts 8.1 Changing layout . . . . . . . . . . . . . . . . 8.1.1 Spacing . . . . . . . . . . . . . . . . . . 8.1.2 Headers and footers . . . . . . . . . . . 8.2 Using fonts . . . . . . . . . . . . . . . . . . . 8.2.1 Changing the default font family . . . 8.2.2 Changing the font-family temporarily 8.2.3 Changing font style . . . . . . . . . . . 8.2.4 Font sizes . . . . . . . . . . . . . . . . .
Formatting information
FORMATTING INFORMATION
8.2.5 Logical markup . . . . . . 8.2.6 Colour . . . . . . . . . . . 8.3 Installing new fonts . . . . . . . . 8.3.1 Installing fonts 8.3.2 Installing PostScript fonts .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . .
126 128 129 130 131 141 141 142 144 145 146 147 149 151 152 154 159 159 160 161 161 161 161 163 167 167 168 168 169
9 Programmability (macros) 9.1 Simple replacement macros . . . . 9.2 Macros using information gathered 9.3 Macros with arguments . . . . . . 9.4 Nested macros . . . . . . . . . . . . 9.5 Macros and environments . . . . . A 9.6 Reprogramming LTEXs internals . 9.6.1 Changing list item bullets . .
. . . . . . . previously . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10 Compatibility with other systems A 10.1 Converting into LTEX . . . . . . . . . A X out of XML . . . 10.1.1 Getting LTE A 10.2 Converting out of LTEX . . . . . . . . 10.2.1 Conversion to Word . . . . . . A 10.2.2 LTEX2HTML . . . . . . . . . . . 10.2.3 TEX4ht . . . . . . . . . . . . . 10.2.4 Extraction from PostScript and 10.2.5 Last resort: strip the markup . A 10.3 Going beyond LTEX . . . . . . . . . . A Conguring TEX search paths
B TEX Users Group membership B.1 TUG membership benets . . . . . . . . . . . . . . . . . . . . . . . . B.2 Becoming a TUG member . . . . . . . . . . . . . . . . . . . . . . . . B.3 Privacy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C The ASCII character set D GNU Free Documentation License D.0 PREAMBLE . . . . . . . . . . . . . . . . . . . . D.1 APPLICABILITY AND DEFINITIONS . . . . . . D.2 VERBATIM COPYING . . . . . . . . . . . . . . D.3 COPYING IN QUANTITY . . . . . . . . . . . . D.4 MODIFICATIONS . . . . . . . . . . . . . . . . . D.5 COMBINING DOCUMENTS . . . . . . . . . . . D.6 COLLECTIONS OF DOCUMENTS . . . . . . . . D.7 AGGREGATION WITH INDEPENDENT WORKS D.8 TRANSLATION . . . . . . . . . . . . . . . . . . D.9 TERMINATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
173 173 174 175 175 176 177 178 178 178 179
vi
Formatting information
CONTENTS
FUTURE REVISIONS OF THIS LICENSE . RELICENSING . . . . . . . . . . . . . . . ADDENDUM: How to use this License for . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . your documents . . . . . . . . . . . . . . . . . . . .
. . . . .
. . . . .
List of Figures
1.1 1.2 1.3 1.4
Installing TEX Live from Synaptic, the Ubuntu package manager . . . . . . . . Running the post-installation program texcong . . . . . . . . . . . . . . . Beginners installation of proTEXt . . . . . . . . . . . . . . . . . . . . . . . proTEXt quick-start installation . . . . . . . . . . . . . . . . . . . . . . . . .
2 4 5 6 14 15 25 38 50 56 83 85 88
2.1 Quick-start example document text . . . . . . . . . . . . . . . . . . . . . . 2.2 What to click on to typeset a document . . . . . . . . . . . . . . . . . . . . 2.3 An M of type of different faces boxed at 1em . . . . . . . . . . . . . . . . . 3.1 Titling information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.1 Command-line usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 DVI preview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.1 Tables mode for Emacs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 Total variable overhead variance (after Bull) . . . . . . . . . . . . . . . . . . 6.3 The diagram from Figure 6.2 shrunk and enlarged . . . . . . . . . . . . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
Formatting information
vii
CONTENTS
23 24 66 73 82
5.1 Where to put les from packages . . . . . . . . . . . . . . . . . . . . . 6.1 Types of lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 Project expenditure to year-end 2012 . . . . . . . . . . . . . . . . . . .
8.1 Typeface styles, families, shapes, and series . . . . . . . . . . . . . . . 123 C.1 The ASCII characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
viii
Formatting information
Foreword
This document originally accompanied a two-day introductory training course. It became obvious from repeated questions in class and afterwards, as well as from general queries on comp.text.tex that many people do not read the FAQs, do not use the TUG web site or the CTAN repositories, do not buy the books and manuals, do not use the newsgroups and mailing lists, and do not download or read the free documentation. Instead, they try to get by using the time-honoured training technique known as sitting by Nellie, which involves looking over a colleagues shoulder in the ofce, lab, library, pub, or classroom, and absorbing all of Nellies bad habits along with the good ones. And they use guesswork or imagination for the rest. People do this for many reasons: shortage of time, lack of information (no-one ever told them there was free documentation), dislike of reading manuals, or even just laziness (my own excuse). But chiefest of reasons is that so much of the existing documentation is written for people who are already experts at reading documentation. Most beginners dont want extensive reasoning over the available choices: they want simple, direct, prescriptive instruction. If you want one of these, do this. In the summer of 2001 I presented a short proposal on the marketing of A L TEX to the annual TUG conference held at the University of Delaware, and I showed an example of a draft brochure1 designed to persuade newcomers A to try L TEX for their typesetting requirements. As a result of questions and suggestions, it was obvious that it needed to include a pointer to some documentation, and I agreed to make available a revised form of this document, expanded to be used outside the classroom, and to include those topics on which I have had most questions from users over the years. It turned out to mean a signicant reworking of a lot of the material. A Some of it appears in almost every other manual and book on L TEX but it is essential to the beginner and therefore bears repetition. Some of it appears in other forms elsewhere, and is included here because I felt it needed explaining. And some of it appears nowhere else but this document. I took the opportunity to revise the structure of the training course in parallel with the book, and to include a more comprehensive index. It is by no means perfect, and I would be grateful for comments and corrections to be sent to me at the address given under the credits. As I also noted earlier, it can be used as a one-day course if the users already have some experience of writing formal documents for publication or assessment (e.g. books, reports, essays, theses, articles, etc.). A I had originally hoped that the L TEX version of the document would be A processable by any freshly-installed default L TEX system, but the need to include font samples which go well beyond the default installation, and the
1
http://latex.silmaril.ie/brochure/
Formatting information
ix
FORMATTING INFORMATION
need to use some less-common packages which the new user is unlikely to have installed, meant that this document itself was not really a simple piece A of L TEX, no matter how simply it may describe the process itself. However, as the careful reader may already have seen, the master source A of the document is not maintained in L TEX but in XML. Installations of TEX are becoming more comprehensive, which means that modern systems are likely to include all the fonts and packages needed, so what I called last time a future task is now creeping up fast: to rewrite the transformation to that A it can be guaranteed to process with all the current full L TEX installations. A X, at an early opportunity you should If you are just starting with L TE A buy or borrow a copy of LTEX: A Document Preparation System which is Leslie Lamports original manual. More advanced users should get the A A A The LTEX Companion, the The LTEX Graphics Companion and the The LTEX Web Companion. Mathematical users might want to start with the Short Math A Guide for LTEX. Details are in p. 180.
Online resources
A There are hundreds if not thousands of web pages about how to use LTEX. The online version of this book is just one, but a couple of others I recommend are:
A Marc van Dongens LTEX and Friends (Authors publication, Cork, Ireland), 2011, at
http://csweb.ucc.ie/~dongen/LaTeX-and-Friends.pdf
A Peter Flynns The Very Short Guide to LTEX (Authors publication, Cork, Ireland), 2011, at http://latex.silmaril.ie/veryshortguide/veryshortguide.pdf
Formatting information
Preface
A Many people discover L TEX after years of struggling with wordprocessors and desktop publishing systems, and are amazed to nd that TEX has been around for over 30 years and they hadnt heard of it. Its not a conspiracy, just a well-kept secret known only to a few million people, as one anonymous user has put it. Perhaps a key to why it has remained so popular is that it removes the need to ddle with the formatting while you write. Playing around with fonts and formatting is highly attractive to new computer users, and great fun for a while, but it is completely counter-productive for the serious author or editor who needs to concentrate on actual writing ask any journalist or professional writer. Best-guess estimates by experts in the eld of usability engineering are that average computer users spend up to 50% of their time ddling with the formatting rather than thinking or writing and this is with the so-called ofce productivity packages that major manufacturers peddle to their clients! A A few years ago a new L TEX user expressed concern on the comp.text.tex A newsgroup about learning to write in L TEX. Some excellent advice2 was posted in response to this query, which I reproduce with permission below (the bold text is my own emphasis):
A No, the harder part might be writing, period. TEX/LTEX is actually easy, once you relax and stop worrying about appearance as a be-all-and-end-all. Many people have become Word Processing Junkies and no longer write documents, they draw them, almost at the same level as a pre-literate 3-year old child might pretend to write a story, but is just creating a sequence of pictures with a pad of paper and box of Crayola s this is perfectly normal and healthy in a 3-year old child who is being creative, but is of questionable usefulness for, say, a grad student writing a Masters or PhD thesis or a business person writing a white paper, etc. For this reason, I strongly recommend not using any sort of fancy GUI crutch. Use a plain vanilla text editor and treat it like an old-fashioned typewriter. Dont waste time playing with your mouse. Note: I am not saying that you should have no concerns about the appearance of your document, just that you should write the document (completely) first and tweak the appearance later...not [spend time on] lots of random editing in the bulk of the document itself. A [Heller, New To L TEX. . . Unlearning Bad Habits (11 March 2003)]
news:comp.text.tex/[email protected]
Formatting information
xi
FORMATTING INFORMATION
Learning to write well can be hard, but authors shouldnt have to make things even harder for themselves by using manually-driven systems which break their concentration every few seconds for some footling adjustment to the appearance, simply because the software is incapable of doing it right by itself. Donald Knuth originally wrote TEX to typeset mathematics for the second edition of his master-work The Art of Computer Programming, and it remains pretty much the only typesetting program to include fully-automated mathematical formatting done the way mathematicians do it. But he also brought out a booklet called Mathematical Writing which shows how important it is to think about what you write, and how the computer should be able to help, not hinder, the author while writing. TEX is of course much more than math: its a programmable typesetting A system which can be used for almost any formatting task, and the L TEX document preparation system which is built on it has made it usable by almost anyone. Professor Knuth generously placed the entire TEX system in the public domain, which meant it is free for anyone to use, but which also meant that for many years there was little commercial publicity which xii
Formatting information
PREFACE
would have got TEX noticed outside the technical eld, because there were few commercial versions. Nowadays, however, there are many companies selling TEX software or A services,3 dozens of publishers accepting L TEX documents for publication, A X for millions of documents.4 and hundreds of thousands of users using L TE There is occasionally some confusion among newcomers between the A two programs, TEX and L TEX, and the other versions available, so Id like to clear this up:
TEX A typesetting program, originally written by Don Knuth at Stanford
in 19789. It implements a macro-driven typesetters programming language of some 300 basic operations and it has formed the core of many other desktop publishing (DTP) systems. Although it is still possible to write in the raw TEX language, you need to study it in depth, and you need to be able to write macros (subprograms) to perform even the simplest of repetitive tasks.
A LTEX A user interface for TEX, designed by Leslie Lamport at Digital Equip-
ment Corporation (DEC) in 1985 to automate all the common tasks of document preparation. It provides a simple way for authors and typesetters to use the power of TEX without having to learn the underA lying language. L TEX is the recommended system for all users except professional typographic programmers and computer scientists who want to study the internals of TEX.
A ConTEXt (not Contest) A system similar to L TEX, but with its own set of
commands, and a much greater emphasis on producing high-function A PDF output. Documentation is less accessible than for L TEX, but the author, Hans Hagen provides excellent support at Pragma/ADE5 .
Unicode and modern font technologies. It is in common use in graphical environments such as TEXshop (Mac OS X), Kile (GNU/Linux), and WinEDT (Windows). Details are at the SIL web site6 .
A pdfTEX and pdfLTEX An extended version of the TEX program that creates PDF
directly instead of via DVI les and PostScript, written by Hn Th A Thnh. It can also enhance the result of TEX/L TEX typesetting with the help micro-typographic extensions, native font embedding, and
3 4 5 6
See, for example, the list of TEX vendors in Table 1, and the list of consultants published by TUG. A guesstimate. With free software its virtually impossible to tell how many people are using it. http://www.pragma-ade.nl/ http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=xetex
Formatting information
xiii
FORMATTING INFORMATION
More mythology
A MYTH: LTEX is a Unix system People are also heard saying its a Windows system, a Mac system, etc., etc. ad nauseam. TEX systems run on almost every computer in use, from the biggest supercomputers right down to handhelds (PDAs like the Sharp Zaurus, the Nokia N800, and most Apple and Android devices). That includes Windows and Linux PCs, Macs, and all other mini, mainframe, and Unix systems. If youre using something TEX doesnt run on, it must be either incredibly new, incredibly old, or unbelievably obscure. A MYTH: LTEX is too difcult This has been heard from physicists who can split atoms; from mathematicians who can explain why exists; from business people who can read a balance sheet; from historians who can grasp Byzantine politics; from librarians who can understand LoC and MARC; and from linguists who can decode Linear B. Its A complete nonsense: most people can grasp LTEX in 20 minutes or so its not rocket science (or if it is, I know any number of unemployed rocket scientists who will teach it to you). A MYTH: LTEX is only for scientists and mathematicians Untrue. Although it grew up in the mathematical and computer science elds, two of its biggest growth areas are in the humanities and business, especially since the rise of XML brought new demands for automated web-based typesetting.
PDF support for hyperlinking. It can also produce DVI les, so it is currently (2011) the default TEX engine in most distributions.
TEXinfo Texinfo is the ofcial documentation format of the GNU project.7 It
was invented by Richard Stallman and Bob Chassell. It uses a single source le to produce output in a number of formats, both online and printed (DVI, HTML, INFO, PDF, XML, etc.). TeXinfo documents can be processed with any TEX engine.
A Both TEX and L TEX have been constantly updated since their inception. Knuth has now frozen changes to the TEX engine so that users and developers can have a virtually bug-free, rock-stable platform to work with.8 Typographic programming development continues with the New A Typesetting System (NTS), planned as a successor to TEX. The L TEX3 project A A has taken over development of L TEX, and the current version is L TEX 2 , which is what we are concentrating on here. Details of all developments can be had from the TUG web site at http://www.tug.org
7 8
GNUs Not Unix (GNU) is a project to create a completely free computing system free meaning both free from encumbrances and restrictions as well as free of charge. Knuth still xes bugs, although the chances of nding a bug in TEX these days approaches zero.
xiv
Formatting information
Skills needed
A L TEX is a very easy system to learn, and requires no specialist knowledge to get started, although its useful if you understand something about formatting and readability. However, you do need to be completely familiar with using your own computer, which means knowing the following topics thoroughly. Note that none of these is specialist; theyre fundamental, standard computer skills that everyone should know:
how to point and click with your mouse to select text and pick from a menu (or to use keyboard shortcuts to do the same)
Formatting information
xv
FORMATTING INFORMATION
how to create, open, save, close, rename, move, and delete les and folders (directories) where to nd all 95 of the printable ASCII characters on your keyboard and what they mean, and how to type accents and symbols, if you need them how to use a good plain-text editor9 how to use your Web browser and/or le transfer program to download and save les from the Internet how to uncompress and unwrap (unzip or detar) compressed les how to install software, both manually and using automated installers
1.7
2.3
3.2.1.2
2.1.3
7.3.1.6
2.3.7
how to read and follow instructions If you dont know how to do these things yet, its important to go and learn them rst. Trying to become familiar with basic computer skills at A the same time as learning L TEX is not going to be as effective as doing them in the right order. It is important to understand that these are not specialist skills they are standard for anyone who uses a computer, and they form a fundamental part of the basic knowledge of computers. They are included in the European Computer Driving Licence (ECDL) course: the relevant sections of the ECDL syllabus are noted in the margin above.
recognise the limitations of procedural markup systems and choose appropriate generic markup methods where appropriate
9
Not a wordprocessor like OpenOfce, Lotus Notes, Corel WordPerfect, or Microsoft Word, and not a dumb editor like Apple TextEdit or Microsoft Notepad.
xvi
Formatting information
Synopsis
The original course covered the following topics as separate sessions, and I have kept to this structure in the book as chapters:
A 1. Where to get and how to install L TEX (using the TEX Users Groups TEX A Collection DVD): you can skip this chapter if L TEX is already correctly installed on your computer and you are already familiar with using a A plaintext editor suitable for L TEX work; A 2. How to create L TEX documents (with a Quick-Start Guide for the impatient);
3. Basic document structures (the Document Class Declaration and its layout options; the document environment with sections and paragraphs); 4. Typesetting, viewing, and printing; 5. Using packages and CTAN to adapt formatting to your needs; 6. Other document structures (lists, tables, gures, images, and verbatim text); 7. Textual tools (footnotes, marginal notes, cross-references, indexes and glossaries, and bibliographic citations); 8. Typographic considerations (white-space and typefaces; inline markup and font changes; extra font installation and automation);
A 9. Programmability and automation (macros and modifying L TEXs behaviour);
10. Conversion and compatibility with other systems (XML, Word, etc.). I have made a few changes in the transition to printed and online form, but the basic structure is the same, and the document functions as a workbook for the course as well as a standalone self-teaching guide.
xvii
FORMATTING INFORMATION
A Getting Started with TEX, LTEX, and friends, where all beginners should start; A A The (Not So) Short Guide to LTEX 2 : LTEX 2 in 131 Minutes is a good beginners tutorial;
A Gentle Introduction to TEX: A Manual for Self-Study is a classic tutorial A on Plain TEX (not L TEX);
A Using imported graphics in LTEX 2 shows you how to do (almost) anything with graphics: side-by-side, rotated, etc.; A Short Math Guide for LTEX gets you started with the American Math Societys extensions;
A comprehensive list of symbols in TEX shows over 2,500 symbols available. This list was taken from the CTAN search page. There are also lots of A books published about TEX and L TEX: the most important of these for users of this document are listed in the last paragraph of the Foreword on p. x.
A Availability of LTEX systems
The standard implementations of TEX and related systems are in the TEX Collection, published annually on DVD by the TUG. These are all derived from Knuths master versions, and adapted for all major platforms (Unix and Unix-like systems such as GNU/Linux and Apple Mac OS X; and Microsoft Windows). The DVD is sent free to all TUG members and can be obtained from your local user group. You can also download the ISO image le from CTAN to burn your own copy. Commercial implementations are listed in About this book on p. xx.
Systems included on the TEX Collection DVD ProTEXt (Windows) This is the popular MiKT X implementation plus the E
MacTEX (OS X) This is TEX Live plus the T Xshop editor (the Macs built-in E
TEX Live (Unix and GNU/Linux) Generic TEX Live for systems without a built-in
package distribution. Users of Red Hat and Debian/Ubuntu systems should use their package manager instead (yum and RPM, or apt and Synaptic) to install the complete RPM or DEB package versions provided by their suppliers repository.
xviii
Formatting information
Because the TEX program (the internal engine which does the actual typesetting) is independent of other software, it doesnt have its own editor like a wordprocessor does. Instead, you get to choose whichever editor you prefer: there are lots available, and you can switch between them to nd one you like.
Graphical interfaces
A Most users run L TEX with a graphical editor which has a toolbar and menus like other windowing applications. All the common formatting features A of L TEX plus writing tools like spellchecking, indexing, and bibliographic citation are run the same way. Text-only interfaces are available for use on servers and automated production systems (see About this book on p. xix). The Windows and Mac systems described in About this book on p. xviii come with a recommended editor (TEXnicCenter and TEXshop respectively), but you can install any other suitable editor you prefer. The Unix and GNU/Linux distribution does not install any editor because these systems usually have their own software repositories with suitable editors already available, such as Emacs, vi, and Kile.
Command-line interfaces
While you would use a graphical interface to set up an automated system A like a web server or e-commerce environment, it is useless where L TEX is running in the background, unattended, where there is no human to click on buttons. In fact, the TEX typesetting engine is a Command-Line Interface (CLI) program, which can be used from a console or Command window. You can type the command latex followed by the name of your document le (see Figure 4.1 in 4.1.1 for an example). A Commands like these let you run L TEX in an automated environment like a Common Gateway Interface (CGI) script on a web server or a batch le on a document system. All the popular distributions for all systems, both free and commercial, include this CLI interface as standard.
WYSIWYG displays
A L TEX usually displays your typeset results in a separate window, updated automatically every time the document is refreshed, because the typesetting is kept separate from the editing. This is called asynchronous display. Some systems, however, can format the typesetting while you type each character, like a wordprocessor, although at the expense of some exibility. These are called synchronous displays.
the document is reprocessed, rather than while you are still typing, as it would with a wordprocessor. To update the display, just click on
Formatting information
xix
FORMATTING INFORMATION
the button which reformats the document. You are probably already familiar with this idea if you have used a spreadsheet, where the ReCalc button (F9) does the same thing. TEX systems typeset the whole document at one go, including all indexing, cross-references, tables of contents, bibliographic citations, and the placement of gures and tables. TEX also formats whole paragraphs at a time, rather than line-by-line as wordprocessors do, in order to get the quality of spacing, hyphenation, and justication right. This approach makes it much faster than a wordprocessor in dealing with typical complex documents, as it can be done without holding the whole document in memory.
Synchronous typographic displays The WYSIWYG display is the editing win-
dow, and it updates while you type, like a wordprocessor. Some popular examples are LYX (all platforms), Textures (Mac), BaKoMa TEX (Windows), and Scientic Word (Windows) (see Table 1). With a synchronous display you get Instant Textual Gratication, but like a wordprocessor, your level of control is restricted to that of the system you use, which cannot provide access to everything that A L TEX can do. For complete control of complex material you may still need to use separate editing and display windows as for asynchronous implementations.
Near-synchronous displays There are a few systems for very-close-to-synchro-
nous WYSIWYG display. These include Jonathan Fines Instant Preview and the TEX daemon, and David Kastrups preview-latex package for embedding typographic fragments from the typeset display back into the editor window. What You See Is What You Get (WYSIWYG) refers to the accuracy of the typographical display. Most modern ones are pretty good, given the fact that your screen is probably only a fraction of the accuracy of your printer (96 dots to the inch on your screen as opposed to 600 to the inch on your printer, or 1200 or more in photo-quality).
Commercial distributions
Although the TEX Collection is available free of charge, there are several A excellent commercial implementations of TEX and L TEX, with enhanced support and additional features. If these are of benet to you, I urge you to support them and buy their products. In most cases their companies, A founders, and staff have been good friends of the TEX and L TEX communities for many years.10
10
Y&Y, Inc, who produced a TEX distribution for many years, have ceased trading. Some of their add-on fonts are now being distributed by the TEX Users Group (see Appendix B),
xx
Formatting information
Production note
This document is written and maintained in XML, using a customized A version of the DocBook DTD. Conversions were made to HTML and L TEX using XSLT scripts and Michael Kays Saxon processor. The complete source, with all ancillary les, is available online at http: //www.ctan.org/tex-archive/info/beginlatex/src/. If you want to try processing it yourself you will need Java (from Sun, IBM, or a number of others) and Saxon (from http://saxon.sourceforge.net/), in addition to a A full installation of L TEX.
or have been replaced by Open Source implementations, and there is a mailing list at the TUG web site for the support of former Y&Y users.
Formatting information
xxi
FORMATTING INFORMATION
\command
\length counter
term
Control sequences which store a dimension (a measurement in units), like \textwidth Values used for counting (whole numbers only), like
section
The dening instance of a new term or acronym (indexed)
A A LTEX formatting or identication environment, like
environment
package product
quotation
A A LTEX add-on package (available from CTAN), like footmisc
A program or product name Literal examples Mnemonic examples of things you must type, where you have to supply real-life values of your own, like \author{your name}+\author{your name}+ means you must replace your name with your own real name. A specic key on your keyboard Two keys pressed together, not separately Two keys pressed one after another An on-screen button to click A drop-down menu with items;
x Ctrl x Esc q
Submit
Menu Submenu Item
This document is published under the terms and conditions of the GNU Free Documentation License. Details are in Appendix D.
xxii
Formatting information
1
Formatting information
TEX Live installs very easily on all modern desktop, laptop, and server platforms. You can get a copy of the DVD from your local TEX user group, or you can download the installation from CTAN in http://www.ctan.org/ tex-archive/systems/ This course is based on using one of the following distributions of TEX from the TEX Collection DVD:
TEX Live for GNU/Linux, Unix, Mac OS X, and Microsoft Windows (this
MacTEX for Apple Macs running OS X. MacT X includes the T Xshop editor. E E
Other implementations of TEX can be downloaded from CTAN, but A the above are the standard systems. L TEX is included with all distributions of TEX. The TEX Collection DVD is issued annually by TUG in conjunction with many of the local TEX user groups around the world (see http: //www.tug.org/lugs.html for addresses), and edited by Sebastian Rahtz, Karl Berry, Manfred Lotz, and the authors of the software mentioned above. 1
Figure 1.1: Installing TEX Live from Synaptic, the Ubuntu package manager
These people give an enormous amount of their personal time and energy to building and distributing these systems, and they deserve the thanks and support of the user community for all they do. There is also a selection of commercial distributions you can buy, as A described in p. i in : they all process L TEX identically, but there are some differences in size, speed, packaging, installation, support, and extra software provided. One nal thing before we start: always check to see if there is a more recent version of the installation program online. See the list on p. 8 in 1.5 for more details.
sudo yum install texlive-full ghostscript gv okular kile emacs Unfortunately, Okular is new and incomplete: it prematurely replaced two older and much better-designed viewers, kdvi and kpdf , but at the time of writing it is still possible to download those from different repositories and install them. I strongly recommend this method for all GNU/Linux users. You should only install from the TEX Collection DVD if you are using an older, hand-built, or commercial Unix system which has no package manager. Installing from the TEX Collection DVD for Unix requires root privileges and a good understanding of Unix systems management, and is beyond the scope of this book. After installation, run texcong (see Figure 1.2) in a terminal window to adjust your local settings. This is a console utility, so type texconfig to adjust your personal settings, or sudo texconfig to adjust them systemwide. In the utility, use the arrow keys to go up and down the options, and the TAB key to jump to (and switch between) the OK, Cancel, and other buttons at the foot of the screen. The spacebar or the Enter key selects a menu item or button. Most settings are correct as installed, but you might want to change one of the following: the rst option, DEST, lets you specify whether you normally want to print straight onto the printer, or print into a le (to attach to email or upload somewhere) the default paper size (the PAPER option), if the installed size is not your most common one (A4 or Letter) the printer resolution (the MODE option), where you can adjust your printer settings; this allows you to ne-tune it for, say, a typesetter that you want to send output to instead of your own printer in the DVIPS option you can adjust your printer OFFSET (left and top margins), which is useful for older, less accurate printers You may also need the REHASH option later on. It is used to update TEXs fast-nd database (see step 4 in the procedure on p. 67) after adding new or updated packages. If your printer is a conventional home or ofce ink-jet or laser printer, and is not shown, the LaserJet5 setting (600dpi) is probably a good bet. While still in the utility, you can test the margin settings by running A the testpage.tex document through L TEX by typing latex testpage and responding to the questions about paper size and double-sided printing. Print the resulting .dvi le with the command dvips -f testpage | lpr and adjust the margins in texcong if necessary.
Formatting information
1.3.1
Beginners
1. Make sure you have Adobe Acrobat Reader or a similar PDF reader installed 4
Formatting information
2. Select your language where it says Language of PDF le 3. Click on the Start ProTEXt PDF button (see Figure 1.3) 4. If your computer prohibits Acrobat Reader from opening installation links, click on the Enable Launch button and then restart the installation 5. This opens the PDF document (protext/Install/protext-install-xx.pdf, where xx is your language code) about how to install ProTEXt. There are links in large blue type that you click on to install the programs. You need to install the following four programs in order: MiKTEX (p.8) TEXnicCenter (p.10) GhostScript (p.14) GSview (p.14)
Formatting information
1.3.2
Experienced users
If you already know how and where to install Windows software, click on the proTEXt Quick Install button. Install the four packages shown (see Figure 1.4) in the order given.
Running TEXnicCenter
When you run TEXnicCenter for the rst time, it may ask you where MiKTEXs binaries are (meaning the actual latex.exe and related programs). The answer is the location you noted down from 1: something like C:\Program Files\MiKTeX 2.8\miktex\bin (or a later version number, if time has moved on since I wrote this). You need to know this, because TEXnicCenter wont guess it for you.
Formatting information
1.4
Picking an Editor
A One of the best features of TEX-based systems like L TEX is that they dont force you to use any particular editor or viewer: you can pick one that youre comfortable with. One of the worst features (for a beginner) is not understanding this: many new users have never seen exible or adaptable software before, and may be unfamiliar with the idea that you dont have to do what youre told: you can pick and choose. Nevertheless, Im solving this by edict for beginners here: unless you already have a pet editor or viewer, just use the one shown below. In the case of ProTEXt (Windows) and MacTEX (Macs) the editor is the one that comes with the distribution. Unix and GNU/Linux users always get a choice.
1.5
Installation problems
Its always annoying when a program thats supposed to install painlessly causes trouble, and none the more so when everyone else seems to have been able to install it without problems. Ive installed TEX hundreds of times and very rarely had any difculties, but these are a few of the occasions when I did.
Bad hard disks If you are using Microsoft Windows, you should run a scan
and defragmentation of your hard disk[s] before you start. It should take under an hour on a modern machine unless you have a very large disk, but it may need overnight on an older machine. Clean your DVD drive if it has been in heavy use. TEX is made up of a very large number of very small les, so there is a lot of disk activity during an installation. Microsoft Windows runs very slowly when installing a lot of small les, so be patient. On any system, if you are installing a new hard disk for your typesetting work, you have the chance to reformat it beforehand. Pick the smallest granularity (cluster size) possible, usually 1024 bytes (1Kb). This minimises the space needed for systems with a very large number of very small les like TEX has, and may help improve the speed and reliability of the system.
Formatting information
The Registry is where Microsoft wants software companies to store details of all the programs you install. Unfortunately the Registry is grossly abused by marketing departments to try and foist undesirable links on you, the user. You will see this with many commercial programs, where a particular type of le youve been able to double-click on for years suddenly runs a different program. Some programs install obsolete or broken copies of program libraries (DLL les), overwriting ones which were working perfectly. Worse, the viruses, trojans, and worms which typically infect unprotected Windows systems can leave unwanted links to web pages, or change some of the ways in which Windows operates. The overall effect can be that the whole machine slows down, or that les which are expected to do one thing do another. The best solution is a thorough Registry clean-out, using one of the many free or commercial programs available for the purpose.
Use the latest versions Before installing, check the CTAN web site (subdi-
rectories of http://tug.ctan.org/tex-archive/systems/ named after the systems protext, mactex, etc. for an updated copy of the installation program. This is called MacTeX-yyyy-DVD.mpkg for Macs, and Setup.exe for Microsoft Windows. Just occasionally a bug slips through onto the production DVD, and although its always xed and notied on comp.text.tex, thats a high-volume newsgroup and even the sharpest eyes may miss an announcement. Unix and GNU/Linux users will always get the latest repository copy from their systems package manager. If you are installing on Unix manually from the TEX Collection DVD instead, check on CTAN for an updated version of the le install-tl.sh.
Stick to the defaults Unless youre a computer scientist or a software engi-
neer, I very strongly suggest you never change or ddle with the default directories for installation. I know some of them look odd, but theyre that way for a purpose, especially when it comes to avoiding folder names with spaces in them, like the notorious C:\Program Files. Although most modern systems cope happily with spaces in lenames and directory names when using a graphical user interface, they are always A Bad Idea, especially for programs which can be run from scripts (TEX is one). Spaces and other non-alphanumeric characters should therefore be avoided like the plague (they are forbidden in web addresses [URIs] for the same very good reason: the people who designed them knew the pitfalls). It may look snazzier to put the installation in My Cute $tuff, but please dont: youll just make it 8
Formatting information
harder to nd, harder to x problems, and more embarrassing if you have to explain it to someone else trying to help you.
64-bit Windows The MiKT X distribution for Windows is a 32-bit program E
but it should install correctly on 64-bit Windows 7 systems. For safety, close down all other programs before starting the installation. group environment where the disk storage is locked down, and where the Administrator is unwilling or unavailable to install it for you, there are a couple of choices:
Install it on a USB stick that you can unplug and carry with you. A That way your L TEX installation is always with you. If you use it on another computer where the USB device mounts as a different disk letter, you will need to congure it so that it can see where it is in the directory system. If you cannot install it at all, because the Windows Registry is also locked, and the Administrator is unwilling or unable to install it for you, you may be able to install it in a virtual container (eg Windows XP as a virtual image inside Windows 7). It will be slow, and it may be missing some facilities like alternate character sets, but it will execute. Bear in mind that shared systems in large companies, universities, and similar organisations do usually prohibit software being installed by the user (you) because of security issues over viruses, support, maintenance, and other factors. If you feel your institution needs a A network installation of L TEX, ask your Administrator or IT Centre to contact the TEX Users Group or any local use group (see Appendix B), who may be able to help.
Formatting information
2
Formatting information
A L TEX documents are all plain-text les. This means printable characters only (in whatever writing system is native to your language and culture), no hidden internal binary gubbins like fonts or formatting (except for spaces and linebreaks).
The big advantage of this is that the les can be copied, downloaded, or A uploaded to any computer system running L TEX and they will format exactly the same. Because they are plain text they cannot corrupt your system, and they cannot be used for hiding or transporting virus infections in the way that binary (non-plaintext) wordprocessor les can be. Everything you can see is in the le and everything in the le is there for you to see: there is nothing hidden or secret and there are no manufacturers proprietary gotchas like suddenly going out of date with a new version, and refusing to open.
A A So, you may ask, if L TEX les are all plaintext, how does L TEX know how to format them? The answer is that it uses markup: a system of A A labels which tells L TEX whats what. L TEX and its packages recognise the labels and know how to format them, so you dont usually need to add formatting by hand unless you want to do some thing very special or out of the ordinary.
11
Markup
This is a term from printing, and originally meant the notes on how to lay the document out, or the instructions which a proofreader might add during correction. It now also means instructions or descriptions added to a computer document to act as guidelines for identication or formatting. Markup has been around for ages.
c. 1100
.h1 Interest Rates \section{Interest Rates} <sec><ttl>Interest Rates</ttl>... <H2>Interest Rates</H2> <sect1><title>Interest Rates</title>...
Runoff
A LTEX
2.1 Markup
A In a L TEX document, you type your text along with markup which identies the relevant parts of your document by name, for example title, section, A gure, etc. L TEX does all the formatting for you automatically, using the markup to guide its internal rules and external stylesheets (packages) for typesetting. A L TEX markup is all in (American) English, with a few abbreviations for long words to minimise typing, although most people use a menu or toolbar button, so actually typing it is rare except for the beginner. A You do not need to format any of your text in your editor, because L TEX does the formatting all by itself when it typesets. You can of course regularise or neaten its appearance in your editor for your own ease of
12
Formatting information
editing (for example, keeping each item in a list on a separate line), but this is not required. A You will often hear L TEX markup referred to as commands or sometimes control sequences (the proper TEXnical term for them). For all practical purposes these terms all mean the same thing. The the panel Markup on p. 12 shows some examples of markup. The similarity between the computer forms is striking, and not coincidental.
2.2
If you already know all this stuff about editors and plain-text les and running programs, and you know your system is already correctly installed (including your editor), youd probably like to type something in and see A L TEX do its job. If you dont know this stuff yet, then still do this section now, and treat it as part of the learning experience.
A 1. Install L TEX See Chapter 1.
2. Create a new, empty document Start up your editor ( 1.4) and open a New Document. Delete any template material it inserts, so that your new document is completely empty. 3. Copy the example Copy and paste the text from Figure 2.1 on p.14. Make sure you get all of it, and dont change anything. 4. Save the document Save the document as quickstart.tex 5. Typeset the document TEXnicCenter users must pick the TeX --> PDF option in the toolbar drop-down menu rst! toolbar item for your system as indicated by the Click on the Typeset black cursor in Figure 2.2 on p.15. 6. Preview the typesetting Click on the Preview toolbar item (next to the does not open automatically for you. 7. Print it Click on the
Formatting information Typeset
icon) if this
\documentclass[12pt]{article} \usepackage{palatino,url} \setcounter{secnumdepth}{0} \raggedright \begin{document} \section{My first document} This is a short example of a \LaTeX\ document I wrote on \today. It shows a few simple features of automated typesetting, including: \begin{itemize} \item setting the default font size to 12pt and specifying article type for formatting; \item using the Palatino typeface and some special formatting for web addresses (URIs); \item preventing sections being numbered; \item turning off justification for an informal document; \item formatting a section heading; \item using the \LaTeX\ logo; \item generating todays date; \item formatting this list of items; \item formatting a subsection heading; \item using opening and closing quotes; \item formatting a URI; \item arbitrary formatting: centering and italicisation; \item autonumbering the pages. \end{itemize} \subsection{More information} This example was taken from Formatting Information, which you can read at \url{http://latex.silmaril.ie/formattinginformation/} and use as a teach-yourself guide. \begin{center} \fbox{\textit{Have a nice day!}} \end{center} \end{document}
If you encounter any errors, it means you do need to read the rest of this chapter after all!
A 2.3 LTEX commands
A L TEX commands all begin with a backslash (\) and consist of lowercase letters only. Do not confuse the backslash with the forward slash (/). They are two different characters. The forward slash is used on the Web and on Unix-
14
Formatting information
b) TEXshop (Mac)
c) TEXnicCenter (Windows)
based systems (including Macs and GNU/Linux) to separate directory names and lenames. The backslash is used for the same purpose in the Microsoft Windows le system, but you must always use the forward slash in folder A and le names in L TEX, even if you use Microsoft Windows.
2.3.1
Simple commands
Simple commands are just the command name on its own, after the backslash, for example:
\tableofcontents
A This example is an instruction to L TEX to insert the Table of Contents at that point. You would usually use this in a book or report (or perhaps a very long article) somewhere close to the beginning, normally after the title page but before the Preface or Introduction. You dont have to do anything else. Provided that you have used the sectioning commands described in 3.5, all the formatting and numbering for the Table of Contents is completely automatic.
\sffamily\bfseries\Large
These are some more simple command examples: the rst switches to the current sans-serif typeface, the second invokes bold type, and the third makes the type the Large size (see 8.2 for the exact details). In this case, the
Formatting information
15
font changes affect all text after this point: to restrict it, there is a technique called grouping (see the panel Grouping on p. 122 ). Simple one-word commands like \tableofcontents must be separated from any following text with white-space. This means a normal space, or a newline (linebreak) or a TAB character. For example either of these two forms will work:
\tableofcontents Thanks to Aunt Mabel for all her help with this book.
\tableofcontents Thanks to Aunt Mabel for all her help with this book.
A LT
If you forget the white-space, as in the following example, EX will treat everything up to the next space as a command, and end up with what it thinks is a command called \tableofcontentsThanks. Theres no A such command, of course, so L TEX will complain by displaying an error message (see 4.2.3.2).
\tableofcontentsThanks to Aunt Mabel for all her help with this book.
A L TEX swallows any white-space which follows a command ending in a letter. It does this automatically, so you dont get unwanted extra space in your typeset output, but it does mean that any simple command which ends in a letter and has no arguments in curly braces (see below) must be followed by white-space before normal text starts again, to keep it separate from the text.
2.3.2
A Many L TEX commands are followed by one or more arguments, meaning information to be acted upon. Here are two examples, a chapter title (see 3.5) and a cross-reference label (see 7.4.1):
\chapter{Poetic Form} \label{pform} The shape of poetry when written or printed distinguishes it from prose.
16
Formatting information
Such arguments always go in {curly braces} like those shown above. Be careful not to confuse the curly braces on your keyboard with (round) parentheses, [square] brackets, or angle brackets. They are all different and they mean different things. With commands that take arguments you do not need to use extra whitespace after the command, because the argument in curly braces will keep it separate from any normal text which comes after it. The following example is therefore exactly equivalent to the earlier one above.
\chapter{Poetic Form}\label{pform}The shape of poetry when written or printed distinguishes it from prose.
A White-space in LTEX
2.3.3
A In L TEX documents, all multiple spaces and TAB characters are treated as if they were a single space during typesetting. All multiple newlines A (linebreaks) are treated as if they were a single newline. L TEX does its own spacing and alignment using the commands you give it and the layout in the stylesheet, so you have extremely precise control. You are therefore free to use extra white-space in your editor for optical ease and convenience when editing. The following is therefore exactly equivalent to the examples in the preceding section (although unusual!):
\chapter {Poetic Form} {pform} \label
That is, it will get typeset exactly the same. Try it. Why would you want odd spacing (or none)? The answer is usually A never, but a lot of L TEX is created by computer programs from other systems such as web scripts, XML documents, or databases, and it makes life easier if you dont have to worry about the odd space or two creeping in here and there in normal text: it simply wont have any effect. It also means that you dont have to worry about extra linebreaks between sections or paragraphs, or tabbing in lists of items if you want to use them to make your text easier to edit.
Formatting information
17
Key Meaning
If you need the actual character itself, type: \textbackslash \$ \% \^ \& \_ \~ \# $\{$ $\}$
Character \ $ % &
\ $ % & _ # { }
The command character Math typesetting delimiter The comment character Math superscript character Tabular column separator Math subscript character Non-breaking space Macro parameter symbol Argument start delimiter Argument end delimiter
_
#
{ }
2.4.1
We have already seen (the rst paragraph of 2.3) how to use the backslash to start a command, and curly braces to delimit an argument. The remaining special characters are: $ This has a special mathematical meaning in TEX, so if you want to print $35.99 you must type \$35.99 A % The comment character makes L TEX ignore the remainder of the line in your document, so you can see it in your editor, but it will never get typeset. For example:
Todays price per kilo is 22.70 % get Mike to update this daily
18
Formatting information
and must never be allowed authority to create a charge on the department again. % and fire those idiots down in Finance!
2 The caret sign in mathematics lets you type \(E=mc^2\) to get E = mc . If you need the circumex accent on a letter like , just type it normally or use the symbolic notation \^a (see 2.6). A & The ampersand is used in L TEX tables to separate the columns (see 6.3). If you want to print AT&T you must type AT\&T. _ The underscore in mathematics lets you type \(r_2\) for r2 . If you want to underline text (extremely rare in typesetting) see the last paragraph of 8.2.3. If you need an underscore character as part of a program variable name like SUB_TOTAL, use the \verb command (see 6.6). A The tilde in L TEX prints as a normal space, but prevents a linebreak ever occurring at that point. Its often used between a persons initials and their surname, e.g. Prof D.E.~Knuth where a linebreak would make it harder to read. # If you want a hash mark (the octothorpe or American pound [weight] or number sign) you must type \#. For a pound (sterling) sign (, now nearly obsolete except in the UK and some of its former dependencies), use your key or type \textsterling. While were on the subject of money, the ofcial sans-serif Euro sign needs the marvosym package and is done with the \EUR command (see 5.1 for A details of how to use L TEX packages). Not every font has a Euro character, though, and the default is based on a letter C. However, a slightly unusual but interesting serif Euro sign is in the textcomp package using the \texteuro command when using the Computer Modern typeface (see 8.2.2 for details of switching typefaces in mid-text).
2.5
Quotation marks
If you are using UTF-8 as your input encoding and le format, and the T1 font encodings, you can use your operating systems normal open-quote and close-quote characters.
Formatting information
19
He said, Im just going out.
Do not use the unidirectional typewriter keyboard (apostrophe) or " A (quotes) key for opening quotes. Correct typographic quotes in L TEX are got with the ` key (grave-accent or backtick) for the opening quote, and the (apostrophe) key for the closing quote, doubled if you want double quotes: This ensures you get real left-hand (opening) and right-hand (closing) curly quotes, usually shaped like tiny 66 and 99 characters, or as symmetrically-balanced strokes in sans-seriftypefaces. If you are using Emacs as your editor, the " key is specially programmed A in L TEX-mode to think for itself and produce correct `` and characters automatically. This is one occasion when you can use the " key for an open-quote, because it will be interpreted correctly.
Browser fonts
If you are reading this in a browser, or if you have typeset the document yourself using different fonts, it may not show you real quotes (some old browser fonts are defective) and the \thinspace below may be too wide. Download the typeset (PDF) version of this document to see the real effect, and switch to a browser with better font-handling.
When typing one quotation inside another, there is a special command \thinspace which provides just enough separation between double and single quotes (a normal space is too much and could allow an unwanted linebreak):
2.6 Accents
For accented letters in western European languages1 or other Latin-alphabet character sets just use the accented keys on your keyboard if you have A the right ones. You must also tell L TEX what character repertoire (input
1
20
Formatting information
2.6. ACCENTS
He said, Her answer was never\thinspace, and she meant it.
encoding) you are using. You specify this by using the inputenc package in A your preamble with the relevant option. For example, to tell L TEX you will be using ISO Latin1 characters, use:
\usepackage[latin1]{inputenc}
However, with most modern systems, Unicode will let you insert almost any letter or symbol from any writing system, and I recommend the following preamble for all documents:
\usepackage{ucs} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc}
For language-specic hyphenation you will need the babel package (see 2.7.6), and for non-Latin typefaces you will need whatever font packages and typefaces are required (see 8.2). If you dont have accented letter keys on your keyboard, or you cant nd the codes to type, or if you need additional accents or symbols which are not in any of the keyboard tables, you can use the symbolic notation in Table 2.2. In fact this can be used to put any accent over any letter: if you particularly want a , for example, you can have one with the command \~g g (and Welsh users can get a w with \^w). If you use this symbolic method only, you do not need to use the inputenc package described above. Before the days of keyboards and screens with their own real accented characters, the symbolic notation was the only way to get accents, so you may come across a lot of older documents (and users!) using this method all A the time: it does have the advantage in portability that the L TEX le remains
Formatting information
21
Ctrl Under Microsoft Windows the letter is got with e or by holding down the Alt key and typing 0 1 3 0 on the numeric keypad (not the top row of shifted
numerals). Refer to the charmap utility for a table of key codes and combinations (nd it in the C:\Windows folder).
plain ASCII, which will work on all machines everywhere, regardless of their internal encoding, and even with very old TEX installations.2 Irish and Turkish dotless- can be done with the special command \i, so an (which is normally typed with may requires \\i if you need to ) type it in the long format, followed by a backslash-space or dummy pair of curly braces if it comes at the end of a word and there is no punctuation, A because of the rule that L TEX control sequences which end in a letter (see 2.3.1) always absorb any following space. So what you might see as R Teamrac would have to be R\\i\ Tea\.mra\.c when typed in full (there are not usually any keyboard keys for the dotless- or the lenited characters). A similar rule applies to dotless- and to uppercase . A Note that recent versions of L TEX can compensate for this when used with the ucs, the utf8x option of the inputenc, and the T1 option of the fontenc package (as shown above). In this case you can just type f\is to get fs.
Remember not everyone is lucky enough to be able to install new software: many users on business and academic networks still use old versions of TEX because they or their system managers dont know how to update them. Local user groups may be able to provide help and support here.
22
Formatting information
Accent Acute (fada) Grave Circumex Umlaut or diresis Tilde Macron Bar-under Dot-over (sm) Dot-under Breve Hek (caron) Long umlaut Tie-after Cedilla O-E ligature A-E ligature A-ring O-slash Soft-l Ess-zet (scharfes-S)
Example o o m s . u u
Characters to type
oo
, , , , ,
\e \e \^e \"e \~n \=o \b o \.m \d s \u u \v u \H o \t oo \c c, \c C \oe, \OE \ae, \AE \aa, \AA \o, \O \l, \L \ss
1 show dimensions of less than 96 without resorting to magnication or scaling; and on printers, even at 600dpi, ne oblique lines or curves can still sometimes be seen to stagger the dots. A At the same time, many dimensions in L TEXs preprogrammed formatting are specially set up to be exible: so much space, plus or minus certain limits to allow the system to make its own adjustments to accommodate variations like overlong lines, unevenly-sized images, and non-uniform spacing around headings. TEX uses a very sophisticated justication algorithm to achieve a smooth, even texture to normal paragraph text by justifying a whole paragraph at a time, quite unlike the line-by-line approach used in wordprocessors and DTP systems. Occasionally, however, you will need to hand-correct an unusual wordbreak or line-break, and there are facilities for doing this on individual occasions as well as automating it for use throughout a document.
Formatting information
23
Unit
Size
Printers xed measures pt pc bp sp dd cc Anglo-American standard points (72.27 to the inch) pica ems (12pt) Adobe big points (72 to the inch) TEX scaled points (65,536 to the pt) Didot (European standard) points (67.54 to the inch) Ciceros (European pica ems, 12dd) Printers relative measures em ex ems of the current point size (historically the width of a letter M but see below) x-height of the current font (height of letter x) Other measures cm mm in centimeters (2.54 to the inch) millimeters (25.4 to the inch) inches
2.7.1
Most people in printing and publishing in English-speaking cultures habitually use points, picas and ems; and their designers may also use cm and mm, especially when dealing with clients. Many older English-language speakers still use inches. In other cultures, [Didot] points and [Cicero] picas are also used professionally, but cm and mm are standard: inches are used only when communicating with North American cultures. A You can specify lengths in L TEX in any of these units, plus some others (see Table 2.3). The em can cause beginners some puzzlement because its based on the point size of the type, which is itself misleading. The point size refers to the depth of the metal body on which foundry type was cast in the days of metal typesetting, not the printed height of the letters themselves. Thus the letter-size of 10pt type in one typeface can be radically different from 10pt type in another (look at Figure 2.3, where the widths are given for 10pt type). An em is the height of the type-body in a specic size, so 1em of 10pt type is 10pt and 1em of 24pt type is 24pt. A special name is given to the 12pt em, a pica em, and a pica has become a xed measure in its own right. 24
Formatting information
The red line is the common baseline. Surrounding letters in grey are for illustration of the actual extent of the height and depth of one em of the current type size.
A An old name for a 1em space is a quad, and L TEX has a command \quad for leaving exactly that much horizontal space. To highlight the differences between typefaces at the same size, Figure 2.3 shows ve capital Ms in different faces, surrounded by a box exactly 1em of those sizes wide, and showing the actual width of each M when set in 10pt type. Because of the different ways in which typefaces are designed, none of them is exactly 10pt wide. If you are working with other DTP users, watch out for those who think that Adobe points (bp) are the only ones. The difference between an Adobe big-point and the standard point is only .27pt per inch, but in 10 of text (a full page of A4) thats 2.7pt, which is nearly 1mm, enough to be clearly visible if youre trying to align one sample with another.
2.7.2
Hyphenation
A L TEX hyphenates automatically according to the language you use (see 2.7.6). To specify different breakpoints for an individual word, you can insert soft-hyphens (discretionary hyphens, done with \-) wherever you need them, for example:
When in Mexico, we visited Popoca\-tpetl by helicopter.
To specify hyphenation points for all occurrences of a word in the document, use the \hyphenation command in your preamble (see the panel The Preamble on p. 40 ) with one or more words as patterns in its argument, separated by spaces. This will even let you break helicopter correctly. In this command you use normal hyphens in the pattern, not soft-hyphens.
Formatting information
25
\hyphenation{helico-pter Popoca-tpetl im-mer-sion}
If you have frequent hyphenation problems with long, unusual, or technical words, ask an expert about changing the value of \spaceskip, which controls the exibility of the space between words. This is not something you would normally want to do without advice, as it can change the appearance of your document quite signicantly. If you are using a lot of unbreakable text (see the next section and also 6.6.1) it may also cause justication problems. One possible solution to this is shown in 9.3.
2.7.3
Unbreakable text
A This is the opposite of discretionary hyphenation. To force L TEX to treat a word as unbreakable, use the \mbox command: \mbox{pneumonoultramicroscopicsilicovolcanoconiosis}. This may have undesirable results, however, if you subsequently change margins or the width of the text: pneumonoultramicroscopicsilicovolcanoconiosis. . . To tie two words together with an unbreakable space (hard space), use a tilde (~) instead of the space (see the list on p. 19 in 2.4.1). This will print as A a normal space but L TEX will never break the line at that point. You should make this standard typing practice for things like peoples initials followed by their surname, as in Prof. D.E. Knuth: Prof.\ D.E.~Knuth.
However, after abbreviations in mid-sentence like Prof., its not the end of a sentence, so A we can use backslash-space to force LTEX to treat it as an ordinary word-space, because its OK to break the line after Prof., whereas it would look wrong to have initials separated with Prof. D. E. Knuth broken at a line-end.
2.7.4
Dashes
For a long dash what printers call an em rule like this use three hyphens typed together, like~--- this, and bind them to the preceding word with a tilde to avoid the line being broken before the dash. Its also 26
Formatting information
common to see the dash printed without spaceslike that: the difference is purely sthetic. Never use a single hyphen for this purpose. Between digits like page ranges (3547), it is normal to use the short dash (what printers call an en-rule) which you get by typing two hyphens together, as in 35--47. If you want a minus sign, use math mode ( 2.8). Never use a single hyphen for either of these purposes.
2.7.5
Justication
A The default mode for typesetting in L TEX is justied (two parallel margins, with word-spacing adjusted automatically for the best optical t). In A justifying, L TEX will never add space between letters, only between words. The soul package can be used if you need letter-spacing, but this is best left to the expert. There are two commands \raggedright and \raggedleft which typeset with only one margin aligned. Ragged-right has the text ranged (aligned) on the left, and ragged-left has it aligned on the right. They can be used inside a group ( p. 122) to conne their action to a part of your text, or put in the Preamble if you want the whole document done that way. These modes also exist as environments ( 3.2) called raggedright and raggedleft which are more convenient when applying this formatting to a whole paragraph or more, like this one.
\begin{raggedleft} These modes also exist as environments called raggedright and raggedleft which is more convenient when applying this formatting to a whole paragraph or more, like this one. \end{raggedleft}
Ragged setting turns off hyphenation. There is a package ragged2e which retains hyphenation in ragged setting, useful when you have a lot of long words. To centre text, use the \centering command in a group ( p. 122), or use the center environment. Be careful when centering headings or other display-size material, and add manual linebreaks where needed (\\) to make the breaks at sensible pauses in the meaning.
2.7.6
Languages
A L TEX can typeset in the native manner for several dozen languages. This affects hyphenation, word-spacing, indentation, and the names of the parts of documents displayed in headings (but not the commands used to produce them).
Formatting information
27
A Most distributions of L TEX come with US English and one or more other languages installed by default, but it is easy to add the babel package and specify any of the supported languages or variants, for example:
Make sure that the base language of the document comes last in the list. Changing the language with babel automatically changes the names of the structural units and identiers like Abstract, Index, etc. to their translated version. For example, using French as above, chapters will start with Chapitre. The babel package also sets the hyphenation patterns provided A your version of LTEX has them precompiled (see the start of your log les for a list). For other languages you need to set the hyphenation separately (outside the scope of this book).
2.8 Mathematics
As explained in the Preface on p. xii, TEX was originally written to automate the typesetting of books containing mathematics. The careful reader will already have noticed that mathematics is typeset differently from normal text, which is why it has to be treated specially. This document does not cover mathematical typesetting, which is explained in detail in many other books and Web pages, so all we will cover here is the existence of the math mode commands, and some characters which have special meaning, so they dont trip you up elsewhere. In addition to the 10 special characters listed in 2.4, there are three more characters which only have any meaning inside mathematics mode:
Key Meaning Vertical bar Less-than Greater-than
| < >
If you type any of these in normal text (i.e. outside math mode), you will get very weird things happening and lots of error messages. If you need to print these characters, you must type them using math mode, or use their symbolic names from the textcomp package (\textbrokenbar, \textlangle, and \textrangle). 28
Formatting information
2.8. MATHEMATICS
The hyphen also has an extra meaning in math mode: it typesets as a minus sign, so if you want to write about negative numbers you need to type the number in math mode so the minus sign and the spacing come out right. To use math mode inline (within a paragraph), enclose your math expression in \( and \) commands. You can get the much-quoted equation E = mc2 by typing \(E=mc^2\), and to get a temperature like 30 you need to type \(-30\).3 To typeset a math expression as displayed math (centered between paragraphs), enclose it in the commands \[ and \].4 Displayed equations can be auto-numbered with the equation environment instead of the \[ and \] commands.
\[\bar n^*_j(s)=\frac{\left\{s\sum_{i=1}^k n_i(0)p^*{i,k+1}(s)+M^*(s)\right\}\sum_{i=1}^k p_{0i}p^*{ij}(s)}{1-s\sum_{i=1}^kp_{0i}p^*_{i, k+1}(s)}+\sum_{i=1}^kn_i(0)p^*_{ij}(s)[j= 1,2,\dots,k].\]
n (s) = j
k i=1 s
k i=1
p( 0i)p ij(s)
p0i p
i,k+1
(s)
ni (0)p (s), ij
(j = 1, 2, . . . , k).
Bear in mind that the degree symbol is a non-ASCII character, so you must specify what input encoding you are using if you want to type it: see the example of the inputenc package in 2.6. If you dont want to use non-ASCII characters (or if you are using a system which cannot generate them), you can use the command \textdegree to get the degree sign. You will also see dollar signs used for math mode. This is quite common but deprecated: A its what plain TEX used in the days before L TEX, and the habit got ingrained in many mathematicians. It still works as a convenient shorthand like $x=y$, as do double-dollars for display-mode math like $$E=mc^2$$, but they are only mentioned here to warn readA ers seeing them in other authors work that \(. . . \) and \[. . . \] are the proper L TEX commands.
Formatting information
29
3
Whats what
Formatting information
If the quick-start exercise in 2.2 was enough to show you how a A L TEX document works, then this is where you get the rest of the basic information. If you skipped Chapter 2 then be prepared to go back to some of the sections in it, because Ill be referring to things you might not have come across yet.
A L TEXs approach to formatting is to aim for consistency. This means that as long as you identify each element of your document correctly, it will be typeset in the same way as all the other elements like it, so that you achieve a consistent nish with minimum effort.
A All you need to do in LTEX is to say whats what by labelling things as what they are. If you want a list, you say so. Its not a bunch of paragraphs prexed with bullets, its a list. A One of the small mind-shifts needed to work with a markup system like LTEX is that you need to be explicit. Unlike a wordprocessor, where the WYSIWYG display is the only way of comA municating your intentions, with LTEX you can actually tell it what to do.
31
Consistency helps make documents easier to read and understand, as well as making them more visually attractive. Consistency is also what publishers look for. They have a house style, and often a reputation to keep, so they rightly insist that if you do something a certain way once, you should do it the same way each time. Elements are the component parts of a document: all the pieces which make up the whole. Almost everyone who reads books, newspapers, magazines, reports, articles, and other classes of documents will be familiar with the common structure of parts, chapters, sections, subsections, subsubsections, titles, subtitles, paragraphs, lists, tables, gures, and so on, even if they dont consciously think about it.
\documentclass{report}
There are four built-in classes provided, and many others that you can download (some may already be installed for you):
report for business, technical, legal, academic, or scientic reports; theses2 ,
dissertations
article for white papers, magazine or journal articles, reviews, conference
Readers familiar with SGML, HTML, and XML will recognize the concept as similar to the Document Type Declaration (its still called a type there, not a class). Theses and dissertations require an Abstract, which is provided in the report class but not in the book class. The built-in letter class is rather idiosyncratic: there are much better ones you can use which you will nd in the memoir package and the komascript bundle.
32
Formatting information
These default classes are quite broad, so they are easily customised by A adding packages, which are the style and layout plug-ins that L TEX uses to let you automate formatting. The article class in particular can be used (some would say abused) for almost any short piece of typesetting by simply omitting the titling and layout (see 3.3) and adding the relevant packages. The built-in classes are intended as starting-points, especially for drafts, A and for compatibility when exchanging documents with other L TEX users, as A X and are therefore guaranteed they come built into every installation of L TE to format identically everywhere. They are not intended as nal-format publication-quality layouts and should never be used as such. For most A other purposes, especially for publication, you use L TEX packages to extend these classes to do what you need: The memoir package and the komascript bundle contain more sophisticated replacements for all the built-in classes, as well as additional ones; Many academic and scientic publishers provide their own special class les for articles and books (on their Web sites for download); Conference organisers may also provide class les for authors to write papers for presentations; Many universities provide their own thesis document class les in order to ensure exact fulllment of their formatting requirements; Businesses and other organizations can provide their users with A corporate classes on a central server and congure L TEX installations to look there rst for packages, fonts, etc.. Books and journals are not usually printed on ofce-size paper. Although A for draft purposes L TEXs layouts t on the standard A4 or Letter stationery in your printer, it makes them look odd: the margins are too wide, or the positioning is unusual, or the font size is too small, because the nished job will normally be trimmed to a completely different size entirely try trimming the margins of the PDF version of this book to make it 185mm A by 235mm (the same as The LTEX Companion series) and youll be amazed at how it changes the appearance! These document classes are therefore adequate for drafts or for sending to a colleague to edit, but they are not designed for nal-format publishing. For this you need a style le (package or class le) designed by the publisher to t their series of publications (quite often based on the default classes, but looking very different). Many publishers provide these on their web sites for authors to download. Some are also available in the CTAN repository,
Formatting information
33
along with packages and classes for other predened formats such as university theses.
3.1.1
The default layouts are designed to t as drafts on US Letter size paper.4 To create documents with the correct proportions for A4 paper, you need to specify the paper size in an optional argument in square brackets before the document class name, e.g.
\documentclass[a4paper]{report}
The two most common options are a4paper and letterpaper. However, many European distributions of TEX now come preset for A4 instead of Letter.5 The other default settings are for: a) 10pt type (all document classes); b) two-sided printing (books and reports) or one-sided (articles and letters); and c) separate title page (books and reports only). These can be modied with the following document class options which you can add in the same set of square brackets, separated by commas:
11pt to specify 11pt type (headings, footnotes, etc. get scaled up or down in
proportion);
12pt to specify 12pt type (again, headings get scaled to match); oneside to format one-sided printing for books and reports; twoside to format articles for two-sided printing; titlepage to force articles to have a separate title page;
A draft makes L TEX indicate hyphenation and justication problems with a
small square in the right-hand margin of the problem line so they can be located quickly by a human. This option also sets graphics to print as an outline rectangle containing the name of the image, so that it prints quickly.
Letter size is 8 11 , which is the trimmed size of the old Demi Quarto, still in use in North America. The other common US ofce size is Legal, which is 8 14 , a variant cutting close to the old Foolscap (8 13 ). ISO standard A, B, and C paper sizes, used everywhere else, are still virtually unknown in most parts of North America. Note that the standard built-in document classes (book, article, report, or letter) only use the paper size to adjust the margins: they do not embed the paper size name in any A PostScript or PDF output le. If you are using pdfL TEX, or intend creating PostScript output, and you want to change the default paper size, you must specify it both in the Document Class option and as an option to the geometry package (see Exercise 2), in order to ensure that the paper size name gets embedded correctly in the output, otherwise printers may select the wrong paper tray, or reject the job.
34
Formatting information
A If you were using L TEX for a report to be in 12pt type on Letter paper, but printed one-sided in draft mode, you would use:
\documentclass[12pt,letterpaper,oneside,draft]{report}
The 10pt, 11pt, and 12pt settings cover between them probably 99% of all common document typesetting. There are extra options for other body type sizes in the extsizes bundle of document classes (extarticle, extbook, extreport, etc). In addition there are the hundreds of add-in packages which can automate other layout and formatting variants without you having to program anything by hand or even change your text.
3.2
After the Document Class Declaration, the text of your document is enclosed between two commands which identify the beginning and end of the actual document (you would put your text where the dots are):
\documentclass[11pt,a4paper,oneside]{report} \begin{document} ... \end{document}
A LT
The reason for marking off the beginning of your text is that EX allows you to insert extra setup specications before it (where the blank line is in the example above: well be using this soon). The reason for marking off the A end of your text is to provide a place for L TEX to be programmed to do extra stuff automatically at the end of the document, like making an index.
Formatting information
35
A useful side-effect of marking the end of the document text is that you can store comments or temporary text underneath the \end{document} in A the knowledge that L TEX will never try to typeset them (they dont even need to be preceded by the % comment character).
... \end{document} Dont forget to get the extra chapter from Jim!
A This \begin . . . \end pair of commands is an example of a common L TEX structure called an environment. Environments enclose text which is to be handled in a particular way. All environments start with \begin{...} and end with \end{...} (putting the name of the environment in the curly braces).
3.3 Titling
The rst thing you put in the document environment is almost always the document title, the authors name, and the date (except in letters, which have a special set of commands for addressing). The title, author, and date are all examples of metadata or metainformation (information about information).
\documentclass[11pt,a4paper,oneside]{report} \begin{document} \title{Practical Typesetting} \author{Peter Flynn\\Silmaril Consultants} \date{December 2009} \maketitle \end{document}
36
Formatting information
The \title, \author, and \date commands are (I hope) self-explanatory. You put the title, author name, and date in curly braces after the relevant command. The title and author are compulsory; if you omit the \date A command, L TEX uses todays date by default. You must always nish the metadata with the \maketitle command, A which tells L TEX that its complete and it can typeset the titling information at this point. If you omit \maketitle, the titling will never be typeset. This command is reprogrammable so you can alter the appearance of titles (like I did for the printed version of this document in Figure 3.1). It also means publishers can create new commands like \datesubmitted in their own document classes, in the knowledge that anything like that done before the \maketitle command will be honoured. When this le is typeset, you get something like Figure 3.1 (Ive cheated and done it in colour ( 5.1.1) for fun yours will be in black and white for the moment):
A The double backslash (\\) is the L TEX command for a premature (forced) A X normally decides by itself where to break lines, and its linebreak. L TE usually right, but sometimes you need to cut a line short, like here, and start a new one. I could have left it out and just used a comma, so my name and my company would all appear on the one line, but I just decided that I wanted my company name on a separate line. In some publishers document classes, they provide a special \affiliation command to put your company or institution name in instead. The double backslash is also used in the \author command for separating multiple authors. The document isnt really ready for printing like this, but if youre really impatient, look at Chapter 4 to see how to typeset and display it.
3.4
In reports and articles it is normal for the author to provide an Summary or Abstract, in which you describe briey what you have written about and explain its importance. Abstracts in articles are usually only a few paragraphs long. Summaries in reports or theses can run to several
Formatting information
37
pages, depending on the length and complexity of the document or the readership its aimed at.
A In both cases the Abstract or Summary is optional (that is, L TEX doesnt force you to have one), but its rare to omit it because readers want and expect it. In practice, of course, you go back and type the Abstract or Summary after having written the rest of the document, but for the sake of the example well jump the gun and type it now.
38
Formatting information
\documentclass[11pt,a4paper,oneside]{report} \usepackage{ucs} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \renewcommand{\abstractname}{Summary} \begin{document} \title{Practical Typesetting} \author{Peter Flynn\\Silmaril Consultants} \date{December 2009} \maketitle \begin{abstract} This document presents the basic concepts of typesetting in a form usable by non-specialists. It is aimed at those who find themselves (willingly or unwillingly) asked to undertake work previously sent out to a professional printer, and who are concerned that the quality of work (and thus their corporate sthetic) does not suffer. \end{abstract} \end{document}
After the \maketitle you use the abstract environment, in which you simply type your Abstract or Summary, leaving a blank line between paragraphs if theres more than one (see 3.6 for this convention). In business and technical documents, the Abstract is often called a Management Summary, or Executive Summary, or Business Preview, or some A similar phrase. L TEX lets you change the name associated with the abstract environment to any kind of title you want, using the \renewcommand command in your Preamble to give the command \abstractname a new value:
\renewcommand{\abstractname}{Key Points}
This does not change the name of the environment, only its printed title: you still use \begin{abstract} and \end{abstract}. Notice how the name of the command you are renewing (\abstractname, in this case) goes in the rst set of curly braces, and the new value you want it to have goes in the second set of curly braces (this is an example of a command with two arguments).
Formatting information
39
The Preamble
A Modications which you want to affect a whole document go at the start of your LTEX le, immediately after the \documentclass line and before the \begin{document} line:
\documentclass[a4paper]{report} \renewcommand{\abstractname}{Preview} \begin{document} ... \end{document}
This position, between the Document Class Declaration and the beginning of the document environment, is called the preamble, and it is used for modications to the style and behaviour of this document. Major or permanent modications that you use all the time should go in a class le or package of your own making.
If you look carefully at the example document, youll see I sneakily added a few extra commands to the Preamble. Well see later what these mean (Brownie points for working it out, though, if you read 2.6).
3.5 Sections
A In the body of your document, L TEX provides seven levels of division or sectioning for you to use in structuring your text. They are all optional: it is perfectly possible to write a document consisting solely of paragraphs of unstructured text. But even novels are normally divided into chapters, although short stories are often made up solely of paragraphs.
40
Formatting information
3.5. SECTIONS
Chapters are only available in the book and report document classes, because they dont have any meaning in articles and letters. Parts are also undened in letters.6
Depth Division Part Chapter Section Subsection Subsubsection Titled paragraph Titled subparagraph Command Notes Not in letters Books and reports Not in letters Not in letters Not in letters Not in letters Not in letters
1
0 1 2 3 4 5
In each case the title of the part, chapter, section, etc. goes in curly braces A after the command. L TEX automatically calculates the correct numbering and prints the title in bold. You can turn section numbering off at a specic depth: details in 3.5.1.
\section{New recruitment policies} ... \subsection{Effect on staff turnover} ... \chapter{Business plan 2010--2020}
There are packages to let you control the typeface, style, spacing, and appearance of section headings: its much easier to use them than to try and reprogram the headings manually. Two of the most popular are section and sectsty. Headings also get put automatically into the Table of Contents, if you specify one (its optional). But if you make manual styling changes to your heading, for example a very long title, or some special line-breaks or unusual font-play, this would appear in the Table of Contents as A well, which you almost certainly dont want. L TEX allows you to give an optional extra version of the heading text which only gets used in the Table of Contents and any running heads, if they are in effect (see 8.1.2). This optional alternative heading goes in [square brackets] before the curly braces:
6
It is arguable that chapters also have no place in reports, either, as these are conventionally A divided into sections as the top-level division. L TEX, however, assumes your reports have chapters, but this is only the default, and can be changed very simply (see 9.6).
Formatting information
41
\section[Effect on staff turnover]{An analysis of the effects of the revised corporate recruitment policies on staff turnover at divisional headquarters}
3.5.1
Section numbering
All document divisions get numbered automatically. Parts get Roman numerals (Part I, Part II, etc.); chapters and sections get decimal numbering like this document, and Appendixes (which are just a special case of chapters, and share the same structure) are lettered (A, B, C, etc.). You can easily change this default if you want some special scheme. You can change the depth to which section numbering occurs, so you can turn it off selectively. In this document it is set to 3. If you only want parts, chapters, and sections numbered, not subsections or subsubsections etc., you can change the value of the secnumdepth counter using the the \setcounter command, giving the depth value from the table on p. 41:
\setcounter{secnumdepth}{1}
A related counter is tocdepth, which species what depth to take the Table of Contents to. It can be reset in exactly the same way as secnumdepth. The current setting for this document is 2.
\setcounter{tocdepth}{3}
To get an one-time (special case) unnumbered section heading which does not go into the Table of Contents, follow the command name with an asterisk before the opening curly brace: 42
Formatting information
\subsection*{Shopping List}
All the divisional commands from \part* to \subparagraph* have this starred version which can be used in isolated circumstances for an unnumbered heading when the setting of secnumdepth would normally mean it would be numbered.
3.6
Ordinary paragraphs
After section headings comes your text. Just type it and leave a blank line A between paragraphs. Thats all L TEX needs. The blank line means start a new paragraph here: it does not (repeat: not) necessarily mean you get a blank line in the typeset output. Now read this paragraph again and again until that sinks in. The spacing between paragraphs is an independently denable quantity, a dimension or length called \parskip. This is normally zero (no space between paragraphs, because thats how books are normally typeset), but you can easily set it to any size you want with the \setlength command in the Preamble:
\setlength{\parskip}{1cm}
This will set the space between paragraphs to 1cm. See 2.7.1 for details A of the various size units L TEX can use. Leaving multiple blank lines between paragraphs in your source document achieves nothing: all extra blank lines get A ignored by L TEX because the space between paragraphs is controlled only by the value of \parskip. A White-space in L TEX can also be made exible (what Leslie Lamport calls rubber lengths). This means that values such as \parskip can have a default dimension plus an amount of expansion minus an amount of contraction. This is useful on pages in complex documents where not every page may be an exact number of xed-height lines long, so some give-and-take in vertical space is useful. You specify this in a \setlength command like this:
\setlength{\parskip}{1cm plus4mm minus3mm}
Paragraph indentation can also be set with the \setlength command, although you would always make it a xed size, never a exible one, otherwise you would have very ragged-looking paragraphs.
Formatting information
43
\setlength{\parindent}{6mm}
By default, the rst paragraph after a heading follows the standard AngloAmerican publishers practice of no indentation. Subsequent paragraphs are indented by the value of \parindent (default 18pt).7 You can change this in the same way as any other length. In the printed copy of this document, the paragraph indentation is set to 9.99756pt and the space between paragraphs is set to 0.0pt plus 1.0pt. These values do not apply in the Web (HTML) version because not all browsers are capable of that ne a level of control, and because users can apply their own stylesheets regardless of what this document proposes.
To turn off indentation completely, set it to zero (but you still have to provide units: its still a measure!).
\setlength{\parindent}{0in}
If you do this, though, and leave \parskip set to zero, your readers wont be able to tell easily where each paragraph begins! If you want to use the style of having no indentation with a space between paragraphs, use the parskip package, which does it for you (and makes adjustments to the spacing of lists and other structures which use paragraph spacing, so they dont get too far apart).
Paragraph spacing and indentation are cultural settings. If you are typesetting in a language other than English, you should use the babel package, which alters many things, including the spacing and the naming of sections, to conform with the standards of different countries and languages.
44
Formatting information
3.7
Table of contents
All auto-numbered headings get entered in the Table of Contents (ToC) automatically. You dont have to print a ToC, but if you want to, just add the command \tableofcontents at the point where you want it printed (usually after the Abstract or Summary). Entries for the ToC are recorded each time you process your document, and reproduced the next time you process it, so you need to re-run A L TEX one extra time to ensure that all ToC page-number references are correctly resolved. The commands \listoffigures and \listoftables work in exactly the same way as \tableofcontents to automatically list all your tables and gures. If you use them, they normally go after the \tableofcontents command. Weve already seen in 3.5 how to use the optional argument to the sectioning commands to add text to the ToC which is slightly different from the one printed in the body of the document. It is also possible to add extra lines to the ToC, to force extra or unnumbered section headings to be included.
The \tableofcontents command normally shows only numbered section headings, and only down to the level dened by the tocdepth counter (see 3.5.1), but you can add extra entries with the \addcontentsline command. For example if you use an unnumbered section heading command to start a preliminary piece of text like a Foreword or Preface, you can write:
\subsection*{Preface} \addcontentsline{toc}{subsection}{Preface}
This will format an unnumbered ToC entry for Preface in the subsection style. You can use the same mechanism to add lines to the List of Figures or List of Tables by substituting lof or lot for toc. A There is also a command \addtocontents which lets you add any L TEX commands to the ToC le. For example, to add a horizontal rule and a
Formatting information
45
6pt gap, you could say \addtocontents{toc}{\par\hrule\vspace{6pt}} at the place where you want it to occur. You should probably only use this command once you know what you are doing.
46
Formatting information
4
Formatting information
Weve now got far enough to typeset what youve entered. Im assuming at this stage that you have typed some sample text in the format specied in the previous chapter, and youve saved it in a plain-text le with a letype of .tex and a name of your own choosing.
47
4.1 Typesetting
Typesetting your document is usually done by clicking on a button in a toolbar or an entry in a menu. Which one you click on depends on what output you want there are two formats available:
A The standard (default) L TEX program produces a device-independent (DVI) le which can be used with any TEX previewer or printer driver on any make or model of computer. There are dozens of these available: at least one of each (previewer and printer driver) should have been installed with your distribution of TEX. A The pdfLTEX program produces an Adobe Acrobat PDF le which can be used with any suitable previewer, such as Okular, Foxit, GSview, xpdf , kpdf , or Adobes own Acrobat Reader.
Depending on which one you choose, you may have to [re]congure your editor so that it runs the right program. They can all do all of them, but they dont always come pre-set with buttons or menus for every possible option, because they cant guess which one you want.
4.1.1
A Running LTEX
A There are two ways of running L TEX: from the toolbar or menu, or from the command line. Toolbars and menus are most common in graphical A systems, and are the normal way to run L TEX. Command lines are used A in non-graphical systems and in automated processes where L TEX is run unattended (batch or scripted processing). A Whichever way you run L TEX, it will process your le and display a log or record of what its doing (see Exercise 3: it looks the same no matter what system you use). This is to let you see where (if!) there are any errors or problems. The log may appear in a subwindow or a new window, depending on your editor.1
1
Some recent versions of Emacs hide the log if there were no errors, and display it only if something went wrong.
48
Formatting information
4.1. TYPESETTING
Your editor may suggest you save your le if you havent already done so. Do it.
A If L TEX reports any errors easily identiable as lines in the log beginning with an exclamation mark (!) dont panic! Turn to 4.2, identify what A went wrong, and x it in your input le. Then re-run L TEX. If there were no errors, your le is ready for displaying or printing. A It is worth practising running L TEX from a command window even if you normally use a Graphical User Interface (GUI) (one with windows and a mouse), so that you understand what it does. See Figure 4.1 for an example.
Under graphical Unix-based systems (Linux and Mac) you open a command (shell) window by clicking on the shell or screen icon in the control panel at the bottom of your screen. Under Microsoft Windows you open a command window by clicking on the Start Programs MS-DOS or Start Command Prompt menu item. When the command window appears, type cd followed by the name of the folder where you saved your sample document, then press the Enter or Return key:
cd Documents latex quickstart
Then type latex or pdflatex followed by the name you gave the sample document, and press the Enter or Return key.
4.1.2
A Your editor can be set up to run the original (standard) L TEX and generate A X and generate PDF les. Both produce identical DVI les, or to run pdfL TE output, and differ only in the graphics le formats they can handle (see 6.5), and in some typographic advances like microjustication.
Formatting information
49
A Apple Mac versions of L TEX come preset to produce PDF les. Emacs does A not have a default menu congured for pdfLTEX but if you have already A X on the le, you can type the pdflatex command in the run standard L TE *TeX-Shell* pane.
50
Formatting information
4.2.1
Error messages
The format of an error message is always the same. Error messages begin with an exclamation mark at the start of the line, and give a description of the error, followed by another line starting with the number, which refers to A the line-number in your document le which L TEX was processing when the error was spotted. Heres an example, showing that the user mistyped the \tableofcontents command:
! Undefined control sequence. l.6 \tableofcotnetns
A LT
When EX nds an error like this, it displays the error message and pauses. You must type one of the following letters to continue:
Key Meaning Stop immediately and exit the program. Carry on quietly as best you can and dont bother me with any more error messages. Stop the program but re-position the text in my editor at the point where you found the error. a Try to give me more help. (followed by a correction) means input the correction in place of the error and carry on. b
x q e h i
A a. This only works if youre using an editor which LTEX can communicate with. b. This is only a temporary x to get the le processed. You still have to make that correction in the editor.
A Some systems (Emacs is one example) run L TEX with a non-stop switch turned on, so it will always process through to the end of the le, regardless of errors, or until a limit is reached.
4.2.2
Warnings
Warnings dont begin with an exclamation mark: they are just comments A by L TEX about things you might want to look into, such as overlong or underrun lines (often caused by unusual hyphenations, for example), pages running short or long, and other typographical niceties (most of which you can ignore until later). Unlike other systems, which try to hide unevennesses in the text A usually unsuccessfully by interfering with the letter-spacing, L TEX takes the view that the author or editor should be able to contribute. While it is A certainly possible to set L TEXs parameters so that the spacing is sufciently
Formatting information
51
sloppy that you will almost never get a warning about badly-tting lines or pages, you will almost certainly just be delaying matters until you start to get complaints from your readers or publishers.
4.2.3
Examples
Only a few common error messages are given here: those most likely to be encountered by beginners. If you nd another error message not shown here, and its not clear what you should do, ask for help. Most error messages are self-explanatory, but be aware that the place A where L TEX spots and reports an error may be later in the le than the place where it actually occurred. For example if you forget to close a curly A brace which encloses, say, italics, L TEX wont report this until something else occurs which cant happen until the curly brace is encountered (eg the end of the document!) Some errors can only be righted by humans who can read and understand what the document is supposed to mean or look like. Newcomers remember to check the list of special characters ( 2.4): A many errors when you are learning L TEX are due to accidentally typing a special character when you didnt mean to. This disappears after a few hours as you get used to them.
4.2.3.1
Too many }s
! Too many }s. l.6 \date December 2004}
A The reason L TEX thinks there are too many }s here is that the opening curly brace is missing after the \date control sequence and before the word December, so the closing curly brace is seen as one too many (which it is!). In fact, there are other things which can follow the \date command A apart from a date in curly braces, so L TEX cannot possibly guess that youve missed out the opening curly brace until it nds a closing one!
4.2.3.2 Undened control sequence
! Undefined control sequence. l.6 \dtae {December 2004}
A X is complaining that it has no such command In this example, L TE (control sequence) as \dtae. Obviously its been mistyped, but only a A human can detect that fact: all L TEX knows is that \dtae is not a command it knows about its undened. 52
Formatting information
Mistypings are the commonest source of error. If your editor has dropdown menus to insert common commands and environments, use them!
4.2.3.3 Runaway argument
Runaway argument? {December 2004 \maketitle ! Paragraph ended before \date was complete. <to be read again> \par l.8
In this error, the closing curly brace has been omitted from the date. Its the opposite of the error in 4.2.3.1, and it results in \maketitle trying to A format the title page while L TEX is still expecting more text for the date! As \maketitle creates new paragraphs on the title page, this is detected A and L TEX complains that the previous paragraph has ended but \date is not yet nished.
4.2.3.4 Capacity exceeded
! TeX capacity exceeded, sorry [parameter stack size=5000].
This is rather more serious: it means TEX has completely run out of memory. This will happen if you try to push the system too far, like getting it to read lines which are quite excessively long, or macros which are too complex to t in memory (or possibly just badly-written). I had it happen once with an author who had written a single paragraph over 37 pages long. I suggested this was perhaps a style that was unfair on his readers. . .
4.2.3.5 Underfull hbox
Underfull \hbox (badness 1394) in paragraph at lines 28--30 [][]\LY1/brm/b/n/10 Bull, RJ: \LY1/brm/m/n/10 Ac-count-ing in Busi[94]
A LT
This is a warning that EX cannot stretch the line wide enough to t, without making the spacing bigger than its currently permitted maximum.
Formatting information
53
The badness (010,000) indicates how severe this is (here you can probably ignore a badness of 1394). It says what lines of your le it was typesetting when it found this, and the number in square brackets is the number of the page onto which the offending line was printed. The codes separated by slashes are the typeface and font style and size used in the line. Ignore them for the moment: details are in step 11 in the procedure on p. 137 if youre curious.
4.2.3.6 Overfull hbox
[101] Overfull \hbox (9.11617pt too wide) in paragraph at lines 860--861 []\LY1/brm/m/n/10 Windows, \LY1/brm/m/it/10 see \LY1/brm/m/n/10 X Win-
And the opposite warning: this line is too long by a shade over 9pt. The chosen hyphenation point which minimises the error is shown at the end of the line (Win-). Line numbers and page numbers are given as before. In this case, 9pt is too much to ignore (over 3mm or more than 1 ), and a 8 manual correction needs making (such as a change to the hyphenation), or the exibility settings need changing (outside the scope of this book).
4.2.3.7 Missing package
! LaTeX Error: File paralisy.sty not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: sty) Enter file name:
A When you use the \usepackage command to request L TEX to use a certain package, it will look for a le with the specied name and the letype .sty. In this case the user has mistyped the name of the paralist package, so its easy to x. However, if you get the name right, but the package is not installed on your machine, you will need to download and install it before continuing (see Chapter 5).
will have created a DVI le with the same name as your document but the A letype .dvi. If youre using pdfLTEX, a PDF le will have been created, and you can skip to 4.3.3.
4.3.1
To see the typeset output, click on the dvi Preview toolbar icon or use the TeX menu item. A WYSIWYG preview window will appear with TeX View your typeset display (see Figure 4.2).
Most previewers have a wide range of scaling, zooming, and measuring functions, but remember this is a picture of your output: you cannot edit the image. To change it, you always edit your source text and reprocess the le. With xdvi and its derivatives like dviview, you can leave the display A window open, and after youve reprocessed your document through L TEX, moving your mouse back into the window will make the display update automatically (click your mouse if your windowing system needs a click to focus). Figure 4.2 shows xdvi displaying a page. With a standard three-button mouse you get three levels of micro-zoom to let you inspect ne details.
4.3.2
PostScript is a page description language invented by Adobe and used in laser printers and high-end typesetters. Its been the universal standard for electronically-formatted print les for nearly two decades, and all printers and publishers are accustomed to using it. PDF is a descendant of PostScript, and is rapidly taking over, but PostScript itself is still extremely common, largely because it is very robust, and is usually an ASCII le, which makes it very portable and easy to generate (it is actually a programming language in
Formatting information
55
its own right). The drawback is the large size of PostScript les, especially if they contain bitmapped graphics. The dvips program which comes with all TEX distributions is used to generate PostScript les directly from your DVI output. These .ps les can be viewed, printed, sent to a platemaker or lmsetter, put online for downloading, or converted to PDF or other formats. DVI viewers cannot render some PostScript graphical manipulations like rotating and deforming, so an alternative to viewing the DVI le direct is to generate a PostScript le and use a PostScript viewer. You may have to to do this for your publisher anyway, and many editors can be congured to do this by default. Look for a dvips toolbar icon or menu entry and click on it.
A Its also very simple to do manually: lets assume your L TEX le was called mydoc.tex, so processing it has created mydoc.dvi. Just type:
56
Formatting information
dvips -o quickstart.ps quickstart
in a command window (see Exercise 3 for how to use one) and dvips will create quickstart.ps which can be used both for previewing and printing. To view a PostScript le, you need a PostScript previewer like GSview, which works with the PostScript interpreter Ghostscript, which should have been installed automatically along with your TEX system (if not, install both now: GSview is separately licensed and cannot legally be included in some older TEX distributions, so you may have to download it yourself). GSview can be set to watch the PostScript le and automatically update the display any time the le is changed, without you even having to click on the window.
4.3.3
The Portable Document Format (PDF) is a derivative of PostScript. Whereas PostScript is a programming language in itself, PDF is in effect the result of processing a document through PostScript: its a binary le format, extremely compact, and well-supported on all platforms. If your system is congured to generate PDF les direct instead of DVI les, just open the .pdf le using any PDF previewer or browser. Most editors are congured to display a toolbar icon which will pop up Acrobat Reader or some other viewer with the current PDF output le. Adobes Acrobat Reader cannot automatically update the view if you reprocess your document,inthe way that xdvi and GSviewcan. You have to Ctrl Alt . close the display with W and reload the le with F 1
4.4
Printer output
TEX systems print on almost anything from portable and domestic dotmatrix printers through normal ofce ink-jet and laser printers up to
Formatting information
57
the biggest commercial phototypesetters, including a host of other devices in between (numerically-controlled stencil-cutters, knitting machines, and ink-jet cake-decorators, to name but a few). On most modern systems, printing happens in the normal manner through your systems printer drivers: you just click on the Print icon in your preview. However, TEXs ancillary programs are capable of creating highly-optimised printles for almost any printer or typesetter, allowing you to send printout to printers that are not connected to your computer. The rest of this section deals with how to print on older systems without a print management converter, where the procedure may vary slightly according to how you do your typesetting and previewing.
If you are using DVI and you have a previewer which has a print function
congured for your printer, you can use that. If not, create a PostScript le and use GSview instead.
If you are using PDF you can print directly from your PDF viewer. Be careful
about using Adobe Acrobat Readers Shrink to t option, as it will change the size of your document so all your measurements will be different. Turn it off.
Non-PostScript printers You can create a PostScript le with dvips (see 4.3.2)
and use GSview to print it (GSview can print PostScript les to almost any make or model of non-PostScript printer).
If you have a real PostScript printer or you are using a system with built-in
PostScript printing support (such as Linux or Mac), you can create and send PostScript output directly from your editor to the printer without the need to open it in a previewer rst. In Emacs, for example, this is what happens when you use the TEX TEX Print menu item. Both the dvips program and all the previewers that print tend to have facilities for printing selected pages, printing in reverse, scaling the page size, and printing only odd or even pages for two-sided work. If you are using PostScript there are programs for manipulating the output (pstops), for example to perform page imposition to get 4, 8, or 16 pages to a sheet for making booklets (psnup).
58
Formatting information
If you need a non-PostScript/Ghostscript solution, install a separate TEX print driver for your printer. Some may be supplied with your TEX installation, and there are dozens more on CTAN. Their names all start with dvi and are followed by an abbreviation for the printer make or model like dvieps for Epson, dvihp for Hewlett-Packard, dvialw for Apple LaserWriters, etc.. Congure the driver to print directly to the print queue, or pipe it to the print queue manually. On Linux with an HP printer, for example, this would be
dvihp quickstart | lpr
Microsoft Windows has no easy way to bypass the print spool, but you can do it from an MS-DOS command window with (using a HP printer as an example):
dvihp quickstart -o quickstart.hp copy /b quickstart.hp LPT1:
Read the documentation for the driver, as the options and defaults vary.
Formatting information
59
5
Formatting information
The Comprehensive TEX Archive Network (CTAN) is a repository of Web documents and les from HyperText Transfer Protocol (HTTP) and File Transfer Protocol (FTP) servers worldwide which contain copies of almost A every piece of free software related to TEX and L TEX. CTAN is based on three main servers, and there are several online indexes A available. There are complete TEX and L TEX systems for all platforms, utilities for text and graphics processing, conversion programs into and out A of L TEX, printer drivers, extra typefaces, and (possibly the most important) A the L TEX packages. The three main servers are: TEX Users Group: http://www.ctan.org/ UK TEX Users Group: http://www.tex.ac.uk/
61
Deutschsprachige Anwendervereinigung TEX e.V. (DANTE, the Germanspeaking TEX Users Group); http://dante.ctan.org/
5.1 Packages
A Add-on features for L TEX are known as packages. Dozens of these are A X and can be used in your documents immediately. pre-installed with L TE They are all be stored in subdirectories of texmf/tex/latex (or its equivalent) named after each package. To nd out what other packages are available and what they do, you should use the CTAN search page1 which includes a link to Graham Williams comprehensive package catalogue. A A package is a le or collection of les containing extra L TEX commands and programming which add new styling features or modify those already existing. Installed package les all end with .sty (they used to be called style les) and there may be ancillary les as well. When you try to typeset a document which requires a package which is A not installed on your system, L TEX will warn you with an error message that it is missing (see 4.2.3.7), and you can then download the package and install it using the instructions in 5.2. Auto-install of missing packages MIKTEX has a feature that spots if you try to use a package that isnt installed, and offers to download and install it for you there and then. This is now being ported to other distributions of A L TEX, so check the documentation on the DVD to see if it is working in your installation. This avoids you having to do manual installation except for a few packages that are very old or do not conform to the TDS standard. You can also download updates to packages you already have, both the A ones that were installed along with your version of L TEX as well as ones you have added. There is no limit to the number of packages you can have installed on your computer (apart from disk space!), but there is probably a physical limit A to the number that can be used inside any one L TEX document at the same time, although it depends on how big each package is. In practice there is no problem in having even a couple of dozen packages active (the style le for this document uses over 30).
5.1.1
To use a package already installed on your system, insert a \usepackage command in your document preamble with the package name in curly braces, as we have already seen in earlier chapters. For example, to use the xcolor package, which lets you typeset in colours (I warned you this was coming!), you would type:
1
http://www.ctan.org/search
62
Formatting information
5.1. PACKAGES
\documentclass[11pt,a4paper,oneside]{report} \usepackage{xcolor} \begin{document} ... \end{document}
You can include several package names in one \usepackage command by separating the names with commas, and you can have more than one \usepackage command. Some packages allow optional settings in square brackets. If you use these, you must give the package its own separate \usepackage command, like geometry and xcolor shown below:
\documentclass[11pt,a4paper,oneside]{report} \usepackage{pslatex,palatino,avant,graphicx} \usepackage[margin=2cm]{geometry} \usepackage[svgnames]{xcolor} \begin{document} \title{\color{Crimson}Practical Typesetting} \author{\color{DarkSlateBlue}Peter Flynn\\Silmaril Consultants} \date{\color{ForestGreen}January 2011} \maketitle \end{document}
(Incidentally, this is a very crude and cumbersome way to do colours in titling. Its ne for a one-time document, but it will interfere with running heads if you use them; and if its for a repeatable style well see in Chapter 9 how it can be automated as part of the \maketitle command and kept out of the authors way.) Many packages can have additional formatting specications in optional arguments in square brackets, in the same way as geometry and xcolor do. Read the documentation for the package concerned to nd out what can be done.
5.1.2
Package documentation
To nd out what commands a package provides (and thus how to use it), you need to read the documentation. The simplest way is to use your command window and type texdoc followed by the package name. This will bring up the documentation in your PDF or DVI viewer.
Formatting information
63
If that doesnt nd it, in the texmf/doc subdirectory of your installation there should be directories full of .dvi and .pdf les, one for every package installed. These can be previewed or printed like any other DVI or PDF le (see 4.3.1). If your installation procedure has not installed the documentation, the les can all be downloaded from CTAN. Before using a package, you should read the documentation carefully, especially the subsection usually called User Interface, which describes the commands the package makes available. You cannot just guess and hope it will work: you have to read it and nd out. See the next section for details of how to generate the documentation for additional packages you install yourself.
5.2.1
Downloading packages
What you need to look for is always two les, one ending in .dtx and the other in .ins. The rst is a DOCTEX le, which combines the package 64
Formatting information
program and its documentation in a single le. The second is the installation routine (much smaller). You must always download both les. If the two les are not there, it means one of two things: Either the package is part of a much larger bundle which you shouldnt A normally update unless you change version of L TEX;2 or its one of a few rare or unusual packages still supplied as a single A .sty le originally intended for the now obsolete L TEX 2.09.3 Download both les to a temporary directory. If you use Windows, keep a folder like C:\tmp or C:\temp for this; Mac and Linux systems already have a /tmp directory.
5.2.2
Installing a package
1. Extract the les A Run L TEX on the .ins le. That is, open the le in your editor and A process it as if it were a L TEX document (which is it), or if you prefer, type latex followed by the .ins lename in a command window in your temporary directory. This will extract all the les needed from the .dtx le (which is why you must have both of them present in the temporary directory). Note down or print the names of the les created if there are a lot of them (read the log le if you want to see their names again). 2. Create the documentation A Run L TEX on the .dtx le twice. This will create a .dvi le of documentation explaining what the package is for and how to use it. A Two passes through L TEX are needed in order to resolve any internal crossreferences in the text (a feature well come onto later). If you A prefer to create PDF then run pdfLTEX instead. View or print this le in the usual manner (see 4.3). 3. Install the les While the documentation is printing, move or copy the les created in step 1 from your temporary directory to the right place[s] in your
2
For example, there is no xcolor.dtx and xcolor.ins for the xcolor package because it forms A part of the graphics bundle, which is installed on all L TEX systems anyway. Such packages A change very rarely, as they form part of the core of L TEX and are very stable. In general you should never try to update these packages in isolation. You can try to use these if you wish but they are not guaranteed to work, and have now A almost all been replaced by L TEX 2 versions. Always look for the .dtx and .ins pair of les rst.
Formatting information
65
.cls .sty .bst .mf .fd .fd .pfb .afm .tfm .vf .dvi .pdf
others
tex/latex/base tex/latex/packagename bibtex/bst/packagename fonts/source/public/typeface tex/latex/mfnfss tex/latex/psnfss /fonts/type1/foundry /typeface /fonts/afm/foundry /typeface /fonts/tfm/foundry /typeface /fonts/vf/foundry /typeface /doc /doc tex/latex/packagename
Document class le Style le: the normal package content BIBTEX style outline Font Denition les for fonts Font Denition les for PostScript Type 1 fonts PostScript Type 1 outline Adobe Font Metrics for Type 1 fonts TEX Font Metrics for and Type 1 fonts TEX virtual fonts package documentation package documentation other types of le unless instructed otherwise
TEXs local installation directory tree always your local directory tree, a) to prevent your new package accidentally overwriting les in the main TEX directories; and b) to avoid your newly-installed les being overwritten when you next update your version of TEX. The right place sometimes causes confusion, especially if your TEX installation is old or does not conform to the TEX Directory Structure. A For a TDS-conformant system, this is either a) for L TEX packages, a suitably-named subdirectory of your localtexmf/tex/latex/ directory4 ; or b) a suitably-named subdirectory of your localtexmf/ directory for les like BIBTEX styles or font les which are not just for A L TEX but can be used in other TEX systems.
See 5.2.3 for how to create a parallel structure in your local TEX directory if your installation didnt create one for you.
66
Formatting information
Note
If you really dont know where your local TEX directory tree starts, see the panel Finding out where looks for stuff on p. 164 .
Unix and GNU/Linux systems should have a /usr/local/share/ texmf/ directory Apple Mac systems should have a ~/Library/texmf folder MIKTEX systems appear to use the installation directory at C: \ProgramFiles\MikTeX2.8\tex (but with auto-install you dont need to know this). Suitably-named means sensible and meaningful (and probably short). For a package like paralist, for example, Id call the directory paralist. Often there is just a .sty le to move but in the case of complex packages there may be more, and they may belong in different locations. For example, new BIBTEX packages or font packages will typically have several les to install. This is why it is a good idea to create a subdirectory for the package rather than dump the les into misc along with other unrelated stuff. If there are conguration or other les, read the documentation to nd out if there is a special or preferred location to move them to. 4. Update your index Finally, run your TEX indexer program to update the package database. This program comes with every modern version of TEX and is variously called texhash, mktexlsr, or even congure, or it might just be a mouse click on a button or menu in your editor. Read the documentation that came with your installation to nd out which it is.
The reason this process has not been automated widely is that there are still thousands of installations which do not conform to the TDS, such as old shared Unix systems and some Microsoft Windows systems, so there is no way for an installation program to guess where to put the les: you have to
Formatting information
67
know this. There are also systems where the owner, user, or installer has chosen not to follow the recommended TDS directory structure, or is unable to do so for political or security reasons (such as a shared system where she cannot write to a protected directory). The reason for having the local texmf directory (called texmf-local or texmf.local on some systems) is to provide a place for local modications or personal updates, especially if you are a user on a shared or managed system (Unix, Linux, VMS, Windows NT/2000/XP etc.) where you may , not have write-access to the main TEX installation directory tree. You can also have a personal texmf subdirectory in your own login directory. Your installation should already be congured to look in these directories rst, so that any updates to standard packages will be found there before the [superseded] copies in the main texmf tree. All modern TEX installations do this, but if not, you can edit texmf/web2c/texmf.cnf (or on a shared system, ask your systems manager or support person to do so). There is an example in Appendix A.
5.2.3
The TEX Directory Structure (TDS) is documented at http://www.tug.org/ tds/. I nd it useful to make the subdirectory structure of your local texmf directory the same as that of the main installation texmf directory. Examine the subdirectories of texmf/tex/latex/ for examples. For updates A of packages which came with your L TEX distribution (as distinct from new ones you are adding yourself), you can then use the same subdirectory name and position in your local texmf/... as the original used in the main A texmf/..., and L TEX will then always use the updated version. If you want to create the entire subdirectory structure ready for use, you can do it under Unix with the following commands (this example uses the Ubuntu/Debian directory /usr/local/share/texmf rather than the Red Hat /usr/share/texmf-local):
cd /usr/share/texmf find . -type d -exec mkdir -p /usr/local/share/texmf/{} \;
If you are using Microsoft Windows, you can download Cygwin, which provides you with the standard Unix tools in a shell window. 68
Formatting information
The above command also works on a Mac running OS X if you use /usr/local/texlive/yyyy/texmf-dist in the rst command (replacing yyyy with the year of the distribution) and ~/Library/texmf/{} in the second. In other cases, if your directories are not as given in the example, you need to substitute the actual paths to your main texmf and local texmf directories.
5.3
Online help
The indexes and documentation les on CTAN are the primary online resource for self-help on specic packages, and you should read these carefully before asking questions about packages.
5.3.1
The FAQ
For general queries you should read the Frequently-Asked Questions (FAQ) document so that you avoid wasting online time asking about things for which there is already an easily-accessible answer. The FAQ is managed by the UK TEX Users Group and can be found at http://www.tex.ac.uk/faq/ .
5.3.2
Another support resource is the mailing list [email protected]. Again, feel free to ask questions, but again, try to answer the question yourself rst (and say what youve tried in your message).
5.3.3
Web sites
The TEX Users Group, as well as most local user groups, maintains a web site (http://www.tug.org) with lots of information about various aspects of the TEX system. See Appendix B for information on joining TUG.
5.3.4
News
The Usenet newsgroup comp.text.tex is the principal forum for other A questions and answers about L TEX. Feel free to ask questions, but please do not ask frequently-asked questions: read the FAQ instead. The people who answer the questions do so voluntarily, unpaid, and in their own time, so please dont treat this as a commercial support service. To access Usenet news, type the following URI into your browsers Location or Address window: news:comp.text.tex (if your browser
Formatting information
69
doesnt support Usenet news properly, change it for one that does, like Mozilla5 ), or download one of the many free newsreaders.6
5.3.5
A There is a Google Groups mailing list for L TEX users at http://groups. google.com/group/latexusersgroup?hl=en
5.3.6
Commercial support
If you need commercial levels of support, such as 24-hour phone contact, or macro-writing services, you can buy one of the several excellent commercial versions of TEX, or contact a consultancy which deals with TEX (details on the TUG Web site).
5 6
http://www.mozilla.org/ Note that this means newsreaders for the Usenet News (NNTP) service. It does not mean syndication readers for RSS, which are a different thing entirely these are unfortunately also sometimes referred to as newsreaders.
70
Formatting information
6
6.1
Formatting information
It is perfectly possible to write whole documents using nothing but section headings and paragraphs. As mentioned in 3.5, novels, for example, usually consist just of chapters divided into paragraphs. However, its more common to need other features as well, especially if the document is technical in nature or complex in structure. Its worth pointing out that technical doesnt necessarily mean computer technical or engineering technical: it just means it contains a lot of (tekne), the specialist material or artistry of its eld. A literary analysis such as La Textualisation de Madame Bovary (on the marginal notes in the manuscripts of Gustave Flauberts novel) is every bit as technical in the literary or linguistic eld as the maintenance manual for the Airbus 380 is in the aircraft engineering eld. This chapter covers the most common features needed in writing structured documents: lists, tables, gures (including images), sidebars like boxes and panels, and verbatim text (computer program listings). In Chapter 7 we will cover footnotes, cross-references, citations, and other textual tools.
Its very easy to sit down at a keyboard with a traditional wordprocessor and just start typing. If its a very short document, or something transient 71
or relatively unimportant, then you just want to type it in and make it look right by highlighting with the mouse and clicking on font styles and sizes. In doing so, you may achieve the effect you wanted, but your actions have left no trace behind of why you made these changes. This is usually unimportant for trivial or short-term documents, but if you write longer or more complex documents, or if you often write documents to a regular pattern, then making them consistent by manual methods becomes a A nightmare. L TEXs facilities for automation are based on you providing this why information. If your documents have any of the features below, then you have probably already started thinking about structure. The document naturally divides into sections (parts, chapters, etc.). The document is long. There is lots of repetitive formatting in the document. The document is complex (intellectually or visually). There are lots of gures or tables (or examples, exercises, panels, sidebars, etc.). Accuracy is important in formatting the document. A master copy is needed for future reference or reprinting. This is a formal or ofcial document needing special care and attention. Its my thesis, book, leaet, pamphlet, paper, article, etc. Thats why I care. The document (or part of it) may need ongoing or occasional re-editing and republishing. If youve got that far, youre over half-way done. Using a structural editor even a simple outliner can make a huge difference to the quality of your thinking because you are consciously organising your thoughts before setting them down. And it can make just as big a difference to your formatting as well: more consistent, better presented, easier for the reader to navigate through, and more likely to be read and understood which is presumably why you are writing the document in the rst place. 72
Formatting information
6.2. LISTS
Random or arbitrary lists (sometimes called itemized or bulleted lists) where the order of items is unimportant. The items are often prexed with a bullet or other symbol for clarity or decoration, but are sometimes simply left blank, looking like miniature paragraphs (when they are known as simple or trivial lists).
Descriptive or labelled lists (sometimes called discussion lists), which are composed of subheadings or topic labels (usually unnumbered but typographically distinct), each followed by one or more indented paragraphs of discussion or explanation.
Inline lists which are sequential in nature, just like enumerated lists, but are a) formatted within their paragraph; and b) usually labelled with letters, like this example. The items are often mutually inclusive or exclusive, with the nal item prexed by and or or respectively.
6.2
Lists
Lists are useful tools for arranging thoughts in a digestible format, usually a small piece of information at a time. There are four basic types of list, shown in Table 6.1. There are actually two other types, segmented lists and reference lists, but these are much rarer, and outside the scope of this document. A The structure of lists in L TEX is identical for each type, but with a different A environment name. Lists are another example of this L TEX technique (environments), where a pair of matched commands surrounds some text which needs special treatment. Within a list environment, list items are always identied by the command \item (followed by an item label in [square brackets] in the case of labelled lists). You dont type the bullet or the number or the formatting, its all automated.
6.2.1
Itemized lists
73
\begin{itemize} \item Itemized lists usually have a bullet; \item Long items use hanging indentation, whereby the text is wrapped with a margin which brings it clear of the bullet used in the first line of each item; \item The bullet can be changed for any other symbol, for example from the \textsf{bbding} or \textsf{pifont} package. \end{itemize}
Itemized lists usually have a bullet; Long items use hanging indentation, whereby the text is wrapped with a margin which brings it clear of the bullet used in the rst line of each item; The bullet can be changed for any other symbol, for example from the bbding or pifont package.
The default list bullet is round and solid1 () which is also available with the command \textbullet if you load the textcomp package. See 9.6.1 for details of how to change the settings for list item bullets.
6.2.2
Enumerated lists
To create an enumerated list, use the enumerate environment: See 6.2.6 for details of how to change the numbering schemes for each level. A In standard L TEX document classes, the vertical spacing between items, and above and below the lists as a whole, is more than between paragraphs. If you want tightly-packed lists, use the mdwlist package, which provides starred versions (itemize*, enumerate*, etc.).
A If your browser font doesnt show it, dont worry: some dont. L TEX will.
74
Formatting information
6.2. LISTS
\begin{enumerate} \item Enumerated lists use numbering on each item (can also be letters or roman numerals); \item Long items use hanging indentation just the same as for itemized lists; \item The numbering system can be changed for any level. \end{enumerate}
1. Enumerated lists use numbering on each item (can also be letters or roman numerals); 2. Long items use hanging indentation, just the same as for itemized lists; 3. The numbering system can be changed for any level.
6.2.3
Description lists
To create a description list, use the description environment: All three of these types of lists can have multiple paragraphs per item: just type the additional paragraphs in the normal way, with a blank line between each. So long as they are still contained within the enclosing environment, they will automatically be indented to follow underneath their item.
6.2.4
Inline lists
Inline lists are a special case as they require the use of the paralist package which provides the inparaenum environment (with an optional formatting specication in square brackets). See Chapter 8 for details of the font-changing commands used in the optional argument to inparaenum.
6.2.5
Reference lists are visually indistinguishable from numbered or lettered lists, but the numbering or lettering does not imply a sequence. The numbers or letters are just used as labels so that the items can be referred to from
Formatting information
75
\begin{description} \item[Identification:] description lists require a topic for each item given in square brackets; \item[Hanging indentation:] Long items use this in the same way as all other lists; \item[Reformatting:] Long topics can be reprogrammed to fold onto multiple lines. \end{description}
Identication: description lists require a topic for each item given in square brackets; Hanging indentation: Long items use this in the same way as all other lists; Reformatting: Long topics can be reprogrammed to fold onto multiple lines.
elsewhere in the text (as in see item 501(c)3). In this sense they are really A a kind of sub-sectional division, and L TEXs \paragraph or \subparagraph commands (with appropriate renumbering) would probably be a far better solution than using a list. Label them and refer to them with \label and \ref as for any other cross-reference (see 7.4). Segmented lists are a highly specialised structure and outside the scope of this document. For details of their usage, see the chapter Segmentation and Alignment (17) in Lou Burnard and Michael Sperberg-McQueens TEI Guidelines.
6.2.6
You can start a new list environment within the item of an existing list, so you can embed one list inside another up to four deep. The lists can be of any type, so you can have a description list containing an item in which there is a numbered sub-list, within which there is an item containing a bulleted sub-sub-list. 76
Formatting information
6.2. LISTS
\usepackage{paralist} ... \textbf{\itshape Inline lists}, which are sequential in nature, just like enumerated lists, but are \begin{inparaenum}[\itshape a\upshape)] \item formatted within their paragraph; \item usually labelled with letters; and \item usually have the final item prefixed with and or or \end{inparaenum}, like this example.
Inline lists, which are sequential in nature, just like enumerated lists, but are a) formatted within their paragraph; b) usually labelled with letters; and c) usually have the nal item prexed with and or or , like this example.
1. by default an outer enumerated list is numbered in Arabic numerals; (a) an embedded enumerated list is lettered in lowercase; i. a third level is numbered in lowercase Roman numerals; A. the fourth level uses uppercase alphabetic letters. Multiple embedded lists automatically change the bullet or numbering scheme so that the levels dont get confused, and the spacing between levels is adjusted to become fractionally tighter for more deeply nested levels. These are only defaults and can easily be changed by redening the relevant set of values. You could also add a fth and further levels, although I suspect that would mean your document structure needed some careful analysis, as lists embedded ve deep will probably confuse your readers.
Formatting information
77
The values for lists come in pairs: for each level there is a counter to count the items and a command to produce the label:2
Level 1 2 3 4 Default digit. (letter) roman. LETTER. Counter Label command
Note that each counter and command ends with the Roman numeral value A of its level (this is to overcome the rule that L TEX commands can only be made of letters digits wouldnt work here). To change the format of a numbered list item counter, just renew the meaning of its label:
\renewcommand{\theenumi}{\Alph{enumi}} \renewcommand{\theenumii}{\roman{enumii}} \renewcommand{\theenumiii}{\arabic{enumiii}}
This would make the outermost list use uppercase letters, the second level use lowercase roman, and the third level use ordinary Arabic numerals. The fourth level would remain unaffected.
6.3 Tables
Tabular typesetting is the most complex and time-consuming of all textual features to get right. This holds true whether you are typing in plain-text A form, using a wordprocessor, using L TEX, using HTML or XML, using a DTP A system, or some other text-handling package. Fortunately, L TEX provides a table model with a mixture of defaults and congurability to let it produce very high quality tables with a minimum of effort.
2 A In fact, any time you dene a counter in L TEX, you automatically get a command to reproduce its value. So if you dened a new counter example to use in a teaching book, by saying \newcounter{example}, that automatically makes available the command \theexample for use when you want to display the current value of example .
78
Formatting information
6.3. TABLES
6.3.1
Floats
Tables and Figures are what printers and publishers refer to as oats. This means they are not part of the normal stream of text, but separate entities, positioned in a part of the page to themselves (top, middle, bottom, left, right, or wherever the designer species). They always have a caption describing them and they are always numbered so they can be referred to from elsewhere in the text. A L TEX automatically oats Tables and Figures, depending on how much space is left on the page at the point that they are processed. If there is not enough room on the current page, the oat is moved to the top of the next page. This can be changed by moving the Table or Figure denition to an earlier or later point in the text, or by adjusting some of the parameters which control automatic oating. Authors sometimes have many oats occurring in rapid succession, which raises the problem of how they are supposed to t on the page and still leave A room for text. In this case, L TEX stacks them all up and prints them together if possible, or leaves them to the end of the chapter in protest. The skill is to space them out within your text so that they intrude neither on the thread of your argument or discussion, nor on the visual balance of the typeset pages.
Terminology
A LTEX, in common with standard typesetting practice, uses the word Table to mean a formal textual feature, numbered and with a caption, referred to from the text (as in See Table 5). Sometimes you can get informal tables, which simply occur between two paragraphs, without caption or number.
The arrangement of information in rows and columns within either of these structures is called a tabulation or tabular matter. It is important to keep this distinction rmly in mind for this section.
Formatting information
79
But this is a skill few authors have, and its one point at which professional typographic advice or manual intervention may be needed. There is a oat package which lets you create new classes of oating object (perhaps Examples or Exercises), and it also implements a method of forcing a oat not to oat (that is, to appear where it occurs in the text, even if that breaks the page).
6.3.2
Formal tables
A To create a L TEX Table, use the table environment containing a \caption command where you put the caption, followed by a \label command to give the Table a label by which you can refer to it.
Numbering is automatic, but the \label command must follow the \caption command, not precede it. The numbering automatically includes the chapter number in document classes where this is appropriate (but this can of course be overridden). The \caption command has an optional argument to provide a short caption if the full caption would be too long for the List of Tables ( 3.7):
\caption[Something short]{Some very long caption that will only look reasonable in the full figure.}
6.3.3
Tabular matter
A Within a Table, you can either typeset the tabular matter using L TEX, or include a table captured as an image from elsewhere. We will see how to include images in 6.4 on Figures, where they are more common. To typeset tabular matter, use the tabular environment. You follow the \begin{tabular} command with a compulsory second argument in curly braces giving the alignment of the columns. These are specied for each column using one of single letters l, c, and r for left-aligned, centered, or right-aligned text, or the letter p followed by a width argument if you want a long entry to wrap to several lines. TEXs original tabular settings were designed for classical numerical tabulations, where each cell contains a single value. The p specication
80
Formatting information
6.3. TABLES
allows a cell to be a miniature paragraph set to a specic width. These p column specications are not multi-row (row-spanned) entries, they are single cells which contain multiple lines of typesetting: the distinction is very important. Auto-adjusting columns are possible with the tabularx and tabulary packages, offering different approaches to dynamic table formatting. The array package provides for many other typographic variations such as left-aligned, right-aligned, and centred multi-line columns, and the prexing of a column specication with formatting to be applied to all cells in that column, saving you having to enter it in every cell. The colortbl package lets you colour rows, columns, and cells; and the dcolumn package provides decimal-aligned columns. Multi-column (column-spanning) is A built into L TEX tables; for multi-row (row-spanning) cells you need the multirow package. Multi-page and rotated (landscape format) tables can be done with the longtable, rotating, and landscape packages. As an example, the tabular setting illustrated has three columns, the rst one centered, the second left-aligned, and the third one right-aligned, and would therefore be specied as {clr}. Note the use of indentation to make the elements of the table clearer for editing, and note also how the typeset formatting is unaffected by this (see Table 6.2).
\begin{table} \caption{Project expenditure to year-end 2012} \label{ye2012exp} \begin{center} \begin{tabular}{clr} &Item&\EUR\ Amount\\ \hline a)&Salaries (2 research assistants)&28,000\\ &Conference fees and travel expenses&14,228\\ &Computer equipment (5 workstations)&17,493\\ &Software&3,562\\ b)&Rent, light, heat, etc.&1,500\\\cline{3-3} &Total&64,783 \end{tabular} \par\medskip\footnotesize The Institute also contributes to (a) and (b). \end{center} \end{table}
If you copy and paste this into your example document, you will need to add the marvosym package which enables the CEC-conformant symbol \EUR. A You do not need to format the tabular data in your editor: L TEX does this for you when it typesets the table, using the column specications you
Formatting information
81
Amount
28,000 14,228 17,493 3,562
1,5000
64,783
provided. Takaaki Ota provides an excellent Tables mode for Emacs which A provides a spreadsheet-like interface and can generate L TEX table source code (see Figure 6.1). Winedt and TEXnicCenter both have a similar graphical A table-editing mode. If your tabular data comes from outside L TEX, Nicola Talbots excellent datatool package allows the import of data from (e.g.) spreadsheet .csv les. Extra space is automatically added on both sides of all columns, and can be adjusted by changing the value of the \tabcolsep dimension before you begin the tabular environment. To change the line-spacing in a tabular setting, you can redene the \arraystretch command with \renewcommand. \arraystretch is a multiplier, preset to 1, so setting it to 1.5 would make the lines of your tabular settings one and a half times more than normal. You can increase the linespacing after an individual row by following the double backslash with a dimension in square brackets, for example \\[6pt] (negative values decrease the line-spacing). It is conventional to centre the tabular setting within the Table, using the center environment (note US spelling) or the \centering command. The entries for each cell are separated by an ampersand character (&) and the end of a row is marked by the double-backslash (\\). The \hline command draws a rule across all columns and the \cline command draws a rule across a range of columns (here, under column three only the argument needs a range). If used, these commands follow the \\ of the row they apply to. There are some extra formatting commands after the tabular material in the example. These are explained in Chapter 8. If there is no data for a cell, just dont type anything but you still need the & separating it from the next columns data. The astute reader will already have deduced that for a table of n columns, there must always be n 1 ampersands in each row. The exception to this is when the 82
Formatting information
6.3. TABLES
\multicolumn command is used to create cells which span multiple columns. There is also a package (multirow) to enable cells to span multiple rows, but both of these techniques are outside the scope of this document.
6.3.4
As mentioned earlier, its also perfectly possible to typeset tabular matter outside a formal Table, where you want to lay out an informal tabulation between paragraphs where a fully oating formal Table would be unnecessary (these are usually quite short: there are several of them in this document). Tabular mode can also be used wherever you need to align material side by side, such as in designing letterheads, where you may want your company logo and address on one side and some other information on the other. A By default, L TEX typesets tabular environments inline to the surrounding text (i.e. within the paragraph), so if you want your alignment displayed by itself, put it inside a positioning environment like center, flushright, or flushleft, or leave a blank line or \par before and after so it gets typeset separately.
Formatting information
83
There is much more to tabular setting: full details are in the manuals mentioned in the the last paragraph of the Foreword on p. x. One nal note to remind you of the automated crossreferencing features: because the example table is labelled, it can be referenced from anywhere in this document as Table 6.2 just by using \ref{ye2012exp}, regardless of how much the surrounding document or structure is moved or edited.
6.4 Figures
As explained in 6.3.1, Figures and Tables oat to a vacant part of the page, as they are not part of the sequence of sentences making up your text, but illustrative objects that you refer to. Figures can contain text, diagrams, pictures, or any other kind of illustration. To create a gure, use the figure environment: like Tables, they automatically get numbered, and must include a caption (with a label after the caption, if needed, exactly the same as for Tables)
\begin{figure} \caption{Total variable overhead variance (after \citeauthor[p.191]{bull}} \label{workeff} \begin{center} \includegraphics[width=.75\columnwidth]{diagram} \end{center} \end{figure}
You can see that the structure is very similar to the table environment, but in this case we have a graphic included. Details of this command (\includegraphics) are in the next section. Details of the bibliographic citation mechanism are in 7.4.2 84
Formatting information
6.5. IMAGES
X
120
100
(thousands)
80
Spending Variance D
C Efficiency Variance B
60
40
20
F
0 10 20 30
A
40 50
The content of the Figure could of course also be textual, in the form of A a list or a text diagram. L TEX has a simple drawing environment called picture, which lets you create a limited set of lines and curves, but for a diagram of any complexity, you should use a standard vector drawing program (see 6.5.1).
6.5
Images
A Images (graphics) can be included anywhere in a L TEX document, although in most cases of formal documents they will occur in Figures (see preceding section). To use graphics, you need to use the graphicx package in your preamble: \usepackage{graphicx}3 This enables the command \includegraphics which is used to insert an image in the document. The command is followed by the name of your graphics le without the letype, for example: \includegraphics{myhouse} (well see in a minute why you dont include the letype). In most cases you should just make sure the image le is in the same folder (directory) as the document you use it in. This avoids a lot of messing
3
You may nd a lot of old les which use a package called epsf. Dont use it: its obsolete.
Formatting information
85
around remembering where you put the les. If you have images you want to use in several different documents in different places on your disk, there is A a way to tell L TEX where to look (see 6.5.2).
A For standard L TEX with dvips, graphics les must be in Encapsulated PostScript (EPS) format: this was the publishing industry standard for portable graphics for many years, and no other format will work A portably in standard L TEX.4
All good graphics packages can save images as EPS, but be very careful with other software such as statistics, engineering, mathematical, and numerical analysis packages, because some of them, especially on Microsoft Windows platforms, use a very poor quality driver, which in turn creates very poor quality EPS les. If in doubt, check with an expert. If you nd an EPS graphic doesnt print, the chances are its been badly made by the creating software. Downloading Adobes own PostScript driver from their Web site and using that instead may improve things, but the only real solution is to use software that creates decent output.
A For pdfLTEX, graphics les can be in Portable Network Graphic (PNG), Joint Photographic Experts Group (JPG), or PDF format, and not EPS. A A This means if you want to use both standard L TEX as well as pdfLTEX, you need to keep your graphics in two formats, EPS and one of the others. This is why you should avoid including the letype in the A lename you give with \includegraphics: standard L TEX will assume A X will look for PNG, PDF, or JPG automatically, in that EPS, and pdfLTE order.5
For these reasons, if you create vector EPS graphics, and convert them to PDF format, do not keep additional JPG or PNG copies of the same image in A the same directory, because they risk being used by pdfLTEX instead of the PDF le, resulting in a lower-quality image. The \includegraphics command can take optional arguments within square brackets before the lename to specify either the height or width, and the other dimension will automatically change to scale. If you specify both, the image will be distorted to t. You can scale an image by a factor instead
4
Some commercial distributions of TEX systems allow other formats to be used, such as GIF, Microsoft Bitmap (BMP), or Hewlett-Packards Printer Control Language (PCL) les, and others, by using additional conversion software provided by the supplier; but you A cannot send such documents to other L TEX users and expect them to work if they dont A have the same distribution installed as you have. If you use standard L TEX, stick to EPS. Strictly speaking the exact order (from the newest denition in pdftex.def) is .png, .pdf, .jpg, .mps, .jpeg, .jbig2, .jb2, .PNG, .PDF, .JPG, .JPEG, .JBIG2, and .JB2. Thanks to Enrico Gregorio and Philipp Stephani on comp.text.tex for locating this.
86
Formatting information
6.5. IMAGES
\begin{center} \includegraphics[width=3cm]{twithcat} \end{center}
of specifying height or width; clip it to specied coordinates; and rotate it in either direction. Multiple optional arguments are separated with commas. For details of all the arguments, see the documentation on the graphicx A package or a copy of the The LTEX Companion. This package also includes , rorrim, and scale text. commands to A It is in fact possible to tell L TEX to generate the right le format by itself during processing, but this requires an external command-line graphics converter like ImageMagick, and as it gets done afresh each time, it slows things down rather a lot. EPS les, especially bitmaps, can be very large indeed, because they are stored in ASCII format. Staszek Wawrykiewicz has drawn my attention to a useful MS-DOS program to overcome this, called cep (Compressed Encapsulated Postscript) available from CTAN in the support/pstools directory, which can compress EPS les to a fraction of their original size. The original le can be replaced by the new smaller version and still used directly with \includegraphics. One nal warning about using EPS les with \includegraphics: never try to specify an absolute path (one beginning with a slash, or one starting with ../). The dvips driver will not accept these because they pose a security risk to PostScript documents. Unlike PDF, PostScript is a programming language, capable of opening les, and the last thing you want is to create a document able to mess with your lesystem (or someone elses).
6.5.1
Making images
rotate
87
100
80
Spending Variance
CHAPTER 6. OTHER DOCUMENT STRUCTURES
C
X
Figure 6.3: The diagram from Figure 6.2 shrunk and enlarged
120
) 60
100
(thousands)
80
Spending Variance D
C Efficiency Variance B
60
40
20
Eff B
F
0 10 20 30
A
40 50
Bitmaps Bitmap images are made of coloured dots, so if you enlarge them,
40
they go jagged at the edges, and if you shrink them, they go blurry. Bitmaps are ne for photographs, where every dot is a different colour, and no-one will notice if you dont shrink or enlarge too much. Bitmaps for diagrams and drawings, however, are almost always the wrong choice, and often disastrously bad.
Vectors Vector drawings are made from instructions (eg draw this from
here to here, using a line this thick). They can be enlarged or shrunk as much as you like, and never lose accuracy, because they get redrawn automatically at any size. You cant do photographs as vectors, but its the only acceptable method for drawings or diagrams. Vector graphic packages are also better suited for saving your image directly in EPS or PDF format (both of which use vectors internally). All the major graphics-generating packages in all disciplines output vector formats: AutoCAD, ChemDraw, MathCAD, Maple, Mathematica, ArcInfo, and so on. EPS is the universally-accepted format for creating vector graphics for publication, with PDF a close second. Most of the major graphics (drawing) packages can also save as EPS, such as PhotoShop, PaintShop Pro, Adobe Illustrator, Corel Draw, and GIMP. There are also some free vector plotting and diagramming packages available like InkScape, tkPaint, and GNUplot which do the same. Never, ever (except in the direst necessity) create any diagram as a bitmap. Bitmap formats like JPG and PNG are ideal for photographs, as they are also able to compress the data substantially without too much loss of quality. However, compressed formats are bad for screenshots, if you are documenting computer tasks, because too much compression makes them blurry. The popular Graphics Interchange Format (GIF) is good for screenshots, but is not supported by TEX: use PNG instead, with the compression turned down to minimum. Avoid uncompressible formats
20
10
88
20
30
40
Formatting information
6.5. IMAGES
like BMP as they produce enormous and unmanageable les. The Tagged Image File Format (TIFF), popular with graphic designers, should also be avoided because far too many companies have designed and implemented non-standard, conicting, proprietary extensions to the format, making it virtually useless for transfer between different types of computers (except in faxes, where its still used in a much stricter version).
6.5.2
Graphics storage
A I mentioned earlier that there was a way to tell L TEX where to look if you had stored images centrally for use in many different documents. The answer is in a command \graphicspath which you supply with an argument giving one or more names of additional directories you want searched when a le uses the \includegraphics command, for example:
\graphicspath{{c:/mypict~1/camera}} \graphicspath{{/var/lib/images}{/home/peter/Pictures}}
Put the path in an additional set of curly braces (this lets you add more paths later: each in their own subset of curly braces). Ive used the safe (MS-DOS) form of the Windows MyPictures folder in the example because its A Bad Idea to use directory names containing spaces (see the panel Picking suitable lenames on p. 47 ). Using \graphicspath does make your le less portable, though, because le paths tend to be specic both to an operating system and to your computer, like the examples above. If you use dvips to print with or to generate PostScript les, be aware that some versions will not by default handle EPS les which are outside the current directory, and issue the error message that it is unable to nd the
Formatting information
89
image. This is because PostScript is a programming language, and it would theoretically be possible for a maliciously-made image to contain code which might compromise your system. The decision to restrict operation in this way has been widely criticised, but it seems unlikely to be changed. If you are certain that your EPS les are kosher, use the R0 option in your command, e.g. \dvips -R0 dvifile
6.6.1
Inline verbatim
To specify a word or phrase as verbatim text in typewriter type within a sentence, use the special command \verb, followed by your piece of text surrounded by any suitable character which does not occur in the text itself. This is a very rare exception to the rule that arguments go in curly A braces. I often use the plus sign for this, for example to show a L TEX command, I type \verb+\includegraphics[width=3in]{myhouse}+ in order to display \includegraphics[width=3in]{myhouse}, but sometimes I use the grave accent (backtick or open-quote) or the vertical bar when the phrase already has a plus sign in it, like \verb|\(y=a+2x^2\)| when illustrating the A L TEX equation \(y=a+x^2\). This command has the advantage that it turns off all special characters (see 2.4) except the one you use as the delimiter, so you can easily quote sequences of characters in any computer syntax including TEX A without problems. However, L TEX will never break the argument of \verb
6
The original term Uniform Resource Locator (URL) is now deprecated in favour of the more accurate Uniform Resource Indicator (URI). For details see http://www.w3.org/ A Addressing/. Unfortunately the older term still persists, especially in L TEX and XML markup.
90
Formatting information
at a line-end when formatting a paragraph, even if it contains spaces, so if it happens to be long, and falls towards the end of a line, it will stick out into the margin. See 2.7.2 for more information on line-ends and hyphenation. The url package avoids this by providing the command \url which works in the same way as \verb, but uses the standard curly braces to enclose the string of characters. The big difference between \verb and \url is that the latter performs a hyphenless break at punctuation characters, as in http:// latex.silmaril.ie/formattinginformation/index.html#microformats. It was designed for Web URIs, so it understands their syntax and will never break mid-way through an unpunctuated word, only at slashes and full points (and never at embedded hyphens). Bear in mind, however, that spaces and non-ASCII characters are forbidden in URIs, so using spaces in a \url argument will fail, as will using other non-URI-valid characters.
6.6.2
Display verbatim
For longer (multiline) chunks of xed-format text, use the verbatim environment:
\begin{verbatim} \documentclass[11pt,a4paper,oneside]{report} \begin{document} \title{Practical Typesetting} \author{Peter Flynn\\Silmaril Consultants} \date{December 2004} \maketitle \end{document} \end{verbatim}
Like \verb, this turns off all special characters, so you can include anything at all in the verbatim text except the exact line \end{verbatim} For more control over formatting, however, I recommend the use of the fancyvrb package, which provides a Verbatim environment (note the capital letter) which lets you draw a rule round the verbatim text, change the font size, and even have typographic effects inside the Verbatim environment. It can also be used in conjunction with the fancybox package (see 6.7.3), and it can add reference line numbers (useful for chunks of data or programming), and it can even include entire external les.
Formatting information
91
6.7.1
Boxes of text
A Because of this box model, L TEX can typeset any text into a box of any width. The simplest command for small amounts of text is \parbox. This command needs two arguments in curly braces: the rst is the width you want the text set to, and the second is the text itself, as in the example shown. The text is typeset to the required width, and the box is extended downwards for as long as is required to t the text. Note that the baseline of a \parbox is set to the midpoint of the box; that is, if you include a \parbox in mid-sentence, the centre of the box will be lined up with the line
should align with any surrounding text by adding an optional t or b in square brackets before the width. For example, \parbox[t]{1in}{...} will produce a box with the baseline aligned with the top line of the text in the box. Notice that when setting very narrow measures with type that is too large, the words may not t nicely and the spacing may become uneven or there may be too much hyphenation. Either use \raggedright or reduce the type size, or (in extreme cases) reword the text or break each line by hand. It 92
Formatting information
\parbox{1in}{Please make sure you send in your completed forms by January 1st next year, or the penalty clause 2(a) will apply}
Please make sure you send in your completed forms by January 1st next year, or the penalty clause 2(a) will apply
A is rare for L TEX to need this: the example above was deliberately chosen to be obtuse as an illustration of excessive spacing. Where the contents is more extensive or more complicated, you can use the minipage environment. Within a minipage you can use virtually everything that occurs in normal text (e.g. lists, paragraphs, tabulations, etc.) with the exception of oats like tables and gures. The minipage environment has an argument just like \parbox does, and it means the same: the width you want the text set to. Note that in both minipages and \parboxes, the paragraph indentation (\parindent) is reset to zero. If you need to change it, set it inside the minipage or \parbox using the \setlength command (see 3.6). There are two other ways of typesetting text to widths other than the normal text width: you can use a one-row, one-cell tabular environment with the p column type specication, or you can use the \vbox command, which is Plain TEX, and outside the scope of this document.
6.7.2
Framed boxes
To put a frame round some text , use the \fbox command: \fbox{some text}. This works for a few words in mid-line, but the framed box and its contents wont break over the end of a line. To typeset multiline text in a box, put it in a \parbox, or use a minipage or tabular environment as described above, and enclose the whole thing in a \fbox.
Formatting information
93
\begin{minipage}{3in} Please make sure you send in your completed forms by January 1st next year, or the penalty clause 2(a) will apply. \begin{itemize} \item Incomplete forms will be returned to you unprocessed. \item Forms must be accompanied by the correct fee. \item There is no appeal. The adjudicators decision is final. \end{itemize} \end{minipage}
Please make sure you send in your completed forms by January 1st next year, or the penalty clause 2(a) will apply. Incomplete forms will be returned to you unprocessed. Forms must be accompanied by the correct fee. There is no appeal. The adjudicators decision is nal.
The spacing between text and box is controlled by the value of \fboxsep, and the thickness of the line by \fboxrule. The following values were used above:
\setlength{\fboxsep}{1ex} \setlength{\fboxrule}{1pt}
As we saw before, setting justied text in narrow measures will produce poor spacing: either use the \raggedright command, or change the font size, or add explicit extra hyphenation points. Note the \begin{tabular} and \begin{minipage} commands still need the width specifying: in the case of the \begin{tabular} by the use 94
Formatting information
\fbox{\begin{minipage}{3in} This multiline text is more flexible than a tabular setting: \begin{itemize} \item it can contain any type of normal \LaTeX{} typesetting; \item it can be any specified width; \item it can even have its own footnotes\footnote{Like this}. \end{itemize} \end{minipage}}
This multiline text is more exible than a tabular setting:
A it can contain any type of normal L TEX typesetting;
it can be any specied width; it can even have its own footnotes.a
a
Like this.
\fbox{\begin{tabular}{p{1.5in}} Multiline text in a box typeset using \textsf{tabular} \end{tabular}}
Multiline text in a box typeset using tabular
of the p column type with its width specication, and in the case of \begin{minipage} by the second argument.
Formatting information
95
6.7.3
The fancybox package lets you extend the principle of \fbox with commands to surround text in square, oval (round-cornered), and drop-shadow boxes (e.g. \ovalbox, \shadowbox, etc.: see the documentation for details). You can create panels of any size with these borders by using the minipage environment to typeset the text inside a special Sbox environment which fancybox denes. The minipage formats the text but the Sbox captures it, allowing you to delay putting the frame around until it is complete. The printed version of this document uses this extensively and there is a worked example shown in 9.5.
96
Formatting information
7
marginal notes;
Textual tools
Every text-handling system needs to support a repertoire of tools for doing A things with text. L TEX implements many dozens, of which a small selection of the most frequently used is given here: offset quotations (sometimes called block quotes); footnotes and end-notes;
cross-references, both normal ones and bibliographic citations; indexes and glossaries; typesetting in multiple columns.
7.1
Quotations
Direct speech and short quotes within a sentence like this are done with simple quotation marks as described in 2.5. Sometimes, however, you may want longer quotations set as a separate paragraph. Typically these A are indented from the surrounding text. L TEX has two environments for doing this. Such quotations are often set in a smaller size of type, although this is not the default, but you can use one of the size commands like \small (see
Formatting information
97
\begin{quote} Do, Ronny, Do. \textit{Nancy Reagan} Da Do Ron Ron. \textit{The Crystals} \end{quote}
Do, Ronny, Do. Nancy Reagan Da Do Ron Ron. The Crystals
8.2.4) as shown in the second example on p. 99. The inclusion of the bibliographic citation at the end is optional: here it is done with a nonstandard command \citequote which I invented for this example (there is more about how to do things like this in Chapter 9).
The quote environment is for up to a line of text each per (short) quotation,
with the whole thing indented from the previous paragraph but with no additional indentation on each quote;
The quotation environment is for longer passages (a paragraph or more) of
a single quotation, where the whole block of text indented, and each paragraph of it also has its own indentation on the rst line.
Like this.
98
Formatting information
\begin{quotation}\small\noindent At the turn of the century William Davy, a Devonshire parson, finding errors in the first edition of his \titleof{davy}, asked for a new edition to be printed. His publisher refused and Davy purchased a press, type, and paper. He harnessed his gardener to the press and apprenticed his housemaid to the typesetting. After twelve years work, a new edition of fourteen sets of twenty-six volumes was issued---which surely indicates that, when typomania is coupled with religious fervour, anything up to a miracle may be achieved.\citequote[p.76]{ryder} \end{quotation}
At the turn of the century William Davy, a Devonshire parson, nding errors in the rst edition of his A System of Divinity, asked for a new edition to be printed. His publisher refused and Davy purchased a press, type, and paper. He harnessed his gardener to the press and apprenticed his housemaid to the typesetting. After twelve years work, a new edition of fourteen sets of twenty-six volumes was issuedwhich surely indicates that, when typomania is coupled with religious fervour, anything up to a miracle may be achieved.
[Ryder, Printing for Pleasure (1976), p.76]
\footnote with \protect, or use (abuse?) the \url command instead (which you should be using for Web and email addresses in any case). Footnotes in titling commands (\title, \author, etc) produce the symbols *, , , , , ||, **, , and for the values 19 (and an error message for the tenth such footnote). Footnotes inside a minipage environment (see 6.7) produce lettered notes instead of numbered ones, and they get printed at the bottom of the minipage, not the bottom of the physical page (but this too can be changed). There is a package to hold over your footnotes and make them print at the end of the chapter instead (endnote) or at the end of the whole document, and there is a package to print many short footnotes in a single footnoted paragraph so they take up less space (fnpara). It is also possible to have several separate series of footnotes active simultaneously, which is useful in critical editions or commentaries: a numbered series may be used to refer to an original authors notes; a lettered series can be used for notes by
Formatting information
99
a commentator or authority; and a third series is available for your own notes. It is also possible to format footnotes within footnotes. If your footnotes are few and far between, you may want to use the sequence of footnote symbols above instead of numbers. You can do this by redening the output of the footnote counter to be the \fnsymbol command:
\renewcommand{\thefootnote{\fnsymbol{footnote}}
There are also ways to refer more than once to the same footnote, and to defer the positioning of the footnote if it occurs in a oat like a Table or Figure, where it might otherwise need to move to a different page.
You can add marginal notes to your text instead of (or as well as) footnotes. You need to make sure that you have a wide-enough margin, of course: use the geometry package (see 5.1.1) to allocate enough space, otherwise the notes will be too cramped. There are several packages to help with formatting marginal notes, but the simplest way is to dene it yourself. Add this new command to your preamble:
\newcommand{\marginal}[1]{% \leavevmode\marginpar{\tiny\raggedright#1\par}}
Some text where you need it.
Then you can use \marginal{Some text} Be careful, however, because marginal notes are aligned with the line where the command starts, so a A very long one followed too closely by another will cause L TEX to try and adjust the position so they dont overlap. Were jumping ahead a bit here, as we havent covered how to dene your own commands yet. I wont even try to explain it here, although the attentive reader can probably deduce some of it by inspection. See Chapter 9 for more information about making up your own commands.
7.4 References
A This is one of the most powerful features of L TEX. You can label any point in a document with a name you make up, and then refer to it by that name A from anywhere else in the document, and L TEX will always work out the cross-reference number for you, no matter how much you edit the text or move it around.
100
Formatting information
7.4. REFERENCES
In \S~\ref{newstuff} there is a list of recent projects.
In 7.4.1 there is a list of recent projects.
A similar method is used to cite documents in a bibliography or list of references, and there are packages to sort and format these in the correct manner for different journals.
7.4.1
Normal cross-references
You label a place in your document by using the command \label followed by a short name you make up, in curly braces:2 weve already seen this done for labelling Figures and Tables.
\section{New Research} \label{newstuff}
You can then refer to this point from anywhere in the same document with the command \ref followed by the name you used, e.g. (The \S command produces a section sign () and the \P command produces a paragraph sign ().) If the label is in normal text, the reference will provide the current chapter or section number or both (depending on the current document class).3 If the label was inside a Table or Figure, the reference provides the Table number or Figure number prexed by the chapter number (in Tables and Figures the \label command must come after the \caption command). A label in an enumerated list will provide a reference to the item number. If there is no apparent structure to this part of the document, the reference will be null. Labels must be unique (that is, each value must occur only once as a label within a single document), but you can have as many references to them as you like. Note the use of the unbreakable space (~) between the \ref and the word before it. This prints a space but prevents the line ever breaking at that point, should it fall close to the end of a line.
2 3
This section is labelled normalxref, for example. Thus I can refer here to \ref{normalxref} and get the value 7.4.1.
Formatting information
101
The command \pageref followed by any of your label values will provide the page number where the label occurred, regardless of the document structure. This makes it possible to refer to something by page number as well as its \ref number, which is useful to readers in very long documents.
Note
A LTEX records the label values each time the document is processed, but updated values only get used the next time the document is processed. You always need to process the document an extra time before printing or viewing, if you have changed or added references, to make sure the values are correctly resolved.
Unresolved references are printed as two question marks, and also cause a warning message at the end of the log le. Theres never any harm in having \labels you dont refer to, but using \ref when you dont have a matching \label is an error.
7.4.2
Bibliographic references
The mechanism used for references to reading lists and bibliographies is almost identical to that used for normal cross-references. Although it is possible to type the details of each citation manually, there is a companion A program to L TEX called BIBTEX, which manages bibliographic references automatically. This reduces the time needed to maintain and format them, and dramatically improves accuracy. Using BIBTEX means you only ever have to type the bibliographic details of a work once. You can then cite it in any document you write, and it will get formatted automatically to the style you specify.
A BibLTEX
A There is a new bibliographic referencing system for LTEX called biblatex, which is being developed to overcome some of the complexities of BIBTEXs programming language ad provide a wide range of formatting styles. Keep an eye on the newsgroups and mailing lists.
7.4.2.1
Citing references
BIBTEX works exactly the same way as other bibliographic databases: you keep details of every document you want to refer to in a separate le, using BIBTEXs own format (see example below). Many writers make a habit of 102
Formatting information
7.4. REFERENCES
adding the details of every book and article they read, so that when they write a document, these entries are always available for reference. You give each entry a short label or ID, just like you do with normal cross-references (see 7.4.1), and you use this label in your documents when you cite the work, using the \cite command:
...as has clearly been shown by Fothergill~\cite{fg}.
By default, this creates a cross-reference number in square brackets [1] which is a common style in the natural sciences (see 7.4.2.5 for details of how to change this). There are dozens of alternative citation formats in extra packages, including the common author (year) and (author, year) formats. Note that you never have to type the authors name or the year, just the label, because the correct author and year are automatically extracted by BIBTEX. There are lots of variants on the standard \cite command in the larger packages such as apacite and natbib, allowing you to phrase your sentences with references in as natural a way as possible, and rely on BIBTEX to insert the right data. The natbib package is particularly useful as it implements several forms of citation and referencing; originally intended for the natural sciences (whence its name), it is now used in many elds (see 9). If you need to include internal location information in a citation, such as a chapter or section number, or a page number or range, put this in an optional argument before the label, like this: \cite[pp.4752]fg. To print the bibliographic listing (usually called References in articles and Bibliography in books and reports), add these two lines at the end of your document, or wherever you want it printed, substituting the name of your own BIBTEX le and the name of your chosen bibliography style:
\bibliographystyle{ieeetr} \bibliography{mybib}
The \bibliography command is followed by the lename of your BIBTEX le without the .bib extension. The \bibliographystyle command is followed by the name of any of A L TEXs supported bibliography styles, of which there are many dozens available from CTAN.
The styles plain and alpha are two common generic styles used for drafts, A and are built into L TEX, so they dont need any package adding. The
Formatting information
103
example above uses Transactions of the Institute of Electrical and Electronics Engineers (IEEETR). The larger bibliographic style packages (e.g. harvard) have one package name but many different \bibliographystyle formats, such as kluwer, agsm, apsr, dcu, etc.. Details are in the package documentation.
Harvard style
The Harvard style, which is very popular, is broken when used with pdatex if you also have A LTEX2HTML installed (it turns on PDF hyperlinking and then fails on an undened starred command). I strongly recommend using the implementation of Harvard done with the packages natbib and har2nat instead.
If you need to produce multiple bibliographies, perhaps on a per-chapter basis, or grouped separately for some reason, the bibunits or chapterbib packages are very useful.
7.4.2.2 Running bibtex
A After running L TEX, you run the bibtex program, either from the command line or via a toolbar button or menu option in your editor. Most integrated editors (e.g. Kile, TEXnicCenter) will notice when you use BIBTEX, and automatically run bibtex for you. The bibtex program extracts the details of every reference you have cited in A your L TEX document from your .bib database, formats them according to the style you have specied, and stores them in a bibliographic listing (.bbl) A le. The next time you run L TEX, it uses that le with the labels you used in your citations to add the references to your document. The sequence (done automatically by editors) is therefore:
Because of this three-stage process, you will get a warning message about an unresolved reference the rst time you add a new reference to a previously uncited work. This will disappear in subsequent runs of A bibtex and L TEX. A In practice, authors tend to run L TEX from time to time during writing anyway, so they can preview the document. Just run BIBTEX after adding A a new \cite command, and subsequent runs of L TEX will incrementally 104
Formatting information
7.4. REFERENCES
incorporate all references without you having to worry about it. You only A A A need to follow the full formal sequence (L TEX, BIBTEX, L TEX, and L TEX one more time) when you have nished writing and want to ensure that all references have been resolved and any other crossreferences that may have got moved by the addition of newly cited material.
7.4.2.3 BibTEX format
The format for the BIBTEX le is specied in the BIBTEX documentation (see 5.1.2 for how to nd and print it). You create a le with a name ending in .bib, and add your entries, for example:
@book{fg, title author edition publisher year address } = = = = = = {{An Innkeepers Diary}}, {John Fothergill}, {3rd}, {Penguin}, 1929, {London}
There is a prescribed set of elds for each of a dozen or so types of document: book, article (in a journal), article (in a collection), chapter (in a book), thesis, report, paper (in a Proceedings), etc. Each entry identies the document type after the @ sign, followed by the entry label that you make up, and then each eld (in any order), using the format:
keyword = {value},
Most TEX-sensitive editors have a BIBTEX mode which understands these entries. Emacs automatically uses its bibtex-mode whenever you open a lename ending in .bib. When editing BIBTEX databases, the rules are simple: Omit the comma after the last eld in the entry (only eg after {London} in the example). Titles may have their case changed in some styles: to prevent this, enclose the title in double curly braces as in the example. Values which are purely numeric (e.g. years) may omit the curly braces. Fields can occur in any order but the format must otherwise be strictly observed.
Formatting information
105
Fields which are not used do not have to be included (so if your editor automatically inserts them as blank or prexed by OPT [optional], you can safely delete them as unused lines). To help with this, there are several graphical interfaces to creating and maintaining BIBTEX les, such as JabRef (see Figure 7.1), tkbibtex, or pybliographic. These interfaces work like those used with wordprocessors, such as ProCite, Reference Manager, and EndNote, and the Reference Information System (RIS) le format can be used to exchange bibliographic data between many of them. More importantly, there are several online systems such as Mendeley and Zotero which can capture bibliographic data directly from the web sites of libraries, publishers pages, and online databases, and save it in BIBTEX or RIS format.
7.4.2.4 Changing the layout
To change the title printed at the start of your reference listing, just change the value of \refname (articles) or \bibname (books and reports) by adding a line like this in your preamble:
\renewcommand{\bibname}{Reading List}
106
Formatting information
7.4. REFERENCES
The formatting specications (BIBTEX styles) are based on standard settings for journals and books from dozens of publishers: you just pick the one you want by name. The main texmf/bibtex/bst subdirectory of your installation contains the ones installed by default, and you can search on CTAN for others (look for .bst les). Many of them are named after university press or institutional styles (e.g. harvard, ieeetr, oxford) or the publisher or journal which specied them (e.g. elsevier, kluwer, etc.). Some of them have an accompanying package (.sty) le which you need to include with the normal \usepackage command in your preamble. In this case the format may be distributed as .dtx and .ins les and will need installing in the same way as any other package (see 5.2). Always read the documentation, because most of the formats are very specic to the journal they were designed for, and may have fairly absolute requirements.
It is also possible to write your own BIBTEX (.bst) style les, although it uses a language of its own which really needs a computer science A background to understand (one of the reasons that BibL TEX was started). However, this is rendered unnecessary in most cases: there is an extensive A program (actually written in L TEX) called makebst, which makes .bst les by asking you a (long) series of questions about exactly how you want your citations formatted. Just type latex makebst in a command window, but give it a dummy run rst, because some of the questions are very detailed, so you need to have thought through how you want your citations to appear before you start.
7.4.2.5 Other modes of citation
The method of citing a work by numeric reference is common in the natural sciences, but is not used in Law or the Humanities. In these elds, citations are usually done with author-year in parentheses, or short references (author/short-title/year) in a numbered footnote. In some disciplines the references themselves are actually called footnotes, to the exclusion of ordinary footnotes, although they are really references which happen by convention to be displayed as footnotes: an important distinction rarely appreciated by authors in these elds until they come to need a normal footnote.
Formatting information
107
For these disciplines, the bibliography at the back of the document is printed unnumbered in alphabetic order of author, or perhaps chronologically if the time-frame is very large. This unnumbered format is why it is conventionally called References rather than Bibliography: a sufcient working (short) reference has already been provided in the citation or footnote; whereas in the natural sciences, the citation is just a number, or possibly an author and year only, so the full listing is called a Bibliography. Jens Bergers jurabib package (originally intended for German law articles but now extended to other elds in the Humanities, and to other languages) has extensive features for doing this style of citation and is strongly recommended, but the author has now stepped down from maintaining it, although there is a large and active body of people using it who can help with support.
\usepackage{makeidx} \makeindex
When you want to index something, using the command \index followed by the entry in curly braces, as you want it to appear in the index, in one of the following formats:
Plain entry Typing \index{beer} will create an entry for beer with the
separate them: \index{beer!lite}. Subsubentries like \index{beer!lite!American} work to another level deep.
Cross-references See entries are done with the vertical bar (one of the rare
Formatting information
108
This example indexes Chocolate Stout and italicises it at the same time. Any of the standard \text... font-change commands work here: see the table on p. 124 for details. You can also change the font of the index number on its own, as for rst-usage references, by using the vertical bar in a similar way to the see entries above, but substituting a font-change command name alone (without a backslash or curly braces) such as textbf for bold-face text (see the index):
\index{beer!Rogue!Chocolate Stout|textbf}
Out of sequence The same method can be used as for font changes, but using
the alternate index word instead of the font command name, so \index{Oregon Brewing Company@Rogue} will add an entry for Rogue in the O section of the index, as if it was spelled Oregon Brewing Company.
A When the document has been processed through L TEX it will have created a .idx le, which you run through the makeindex program by typing (for example):
makeindex mythesis
Editors usually have a button or menu entry for this, or may automate in the same way as they do BIBTEX, as part of the build procedure. Whichever way you run it, the program will look for a .idx le with the same name as your document, and output a .ind le with the sorted index in it. This gets used by the command \printindex which you put at the end of your document, where you want the index printed. The default index format is two columns with a space between letters of the alphabet. The Unix manual page4 for the makeindex program has details of how to add letter headings to each alphabet group. Glossaries are done in a similar manner using the command \makeglossary in the preamble and the command \glossary in the same way as \index. There are some subtle differences in the way glossaries are handled: both the books by Lamport and by Mittelbach et al. duck the issue, but there is some documentation on glotex on CTAN.
4
On GNU/Linux and Mac systems, just type the command man makeindex; the page is also available in many reference sites on the web: search for that command.
Formatting information
109
typeset full-width gures and tables across a double-column setting. The more extensive solution is the multicol package, which will set up to 10 columns, and allows the number of columns to be changed or reset to one in mid-page, so that full-width graphics can still be used. It also balances the height of the nal page so that all columns are the same height if pos-
sible: its not always achievable and you can control the width of the gutter by setting the \columnsep length to a new dimension. Multi-column work needs some skill in typographic layout, though: the narrowness of the columns makes typesetting less likely to t smoothly because its hard to hyphenate and justify well when there is little space to manuvre in.
110
Formatting information
8
8.1
Formatting information
This is the chapter that most users want rst, because they come to structured documents from a wordprocessing environment where the only way to convey different types of information is to ddle with the font and size drop-down menus. A As I hope you have seen, this is normally completely unnecessary in L TEX, which does most of the hard work for you automatically. However, there are occasions when you need to make manual typographic changes, and this chapter is about how to do them.
Changing layout
The design of the page can be a very subjective matter, and also rather a subtle one. Many organisations large and small pay considerable sums to designers to come up with page layouts to suit their purposes. Styles in page layouts change with the years, as do fashions in everything else, so what may have looked attractive in 1991 may look rather dated in 2011. As with most aspects of typography, making the document readable involves making it consistent, so the reader is not interrupted or distracted too much by apparently random changes in margins, widths, or placement of objects. However, there are a number of different occasions where the layout usually does change, related to the frequency with which the format appears. 111
The title page, the half-title, copyright page, dedication, and other onepage preliminaries (if you use them) are usually designed individually, as the information on them only occurs once in that format anywhere in the document. The table of contents and other related lists like gures and tables all need to share one design. Longer prelims like Foreword, Introduction, and Preface should likewise follow the same format between them. Chapter and Appendix start pages usually share a layout. Other (normal) pages have a single layout, but within the page there will be individual variations to handle tables, lists, gures, sidebars, exercises, footnotes, etc. If you are going to design a whole document, its probably a good idea to read a couple of books on layout design rst, to get a feel for the conventions which contribute to making the reader comfortable reading. While unusual or radical layouts have an important role in attentiongrabbing, or in making a socio-political statement (WIRED magazine is an obvious recent example), they are usually out of place in business reports, white papers, books, theses, and journals. In ephemera, on the other hand, as in advertising, they are probably critical.
8.1.1
Spacing
We mentioned in 7.3 and elsewhere the existence of the geometry package which lets you change margins. It also lets you set the text-area height and width and a lot of other layout settings: read the documentation for details (see 5.1.2 for how to read package documentation).
\usepackage[left=2cm,top=1cm,bottom=2cm,right=3cm, nohead,nofoot]{geometry}
Bear in mind when using the geometry package that you only need to specify some of either the margins or the text height/width. Because it knows the paper size already, if you give it the text width and the left-hand margin, for example, it can work out the right-hand margin. A new feature introduced in 2010 is the \newgeometry command, which lets you reset the margin settings in mid-document. This isnt something you want to do very often, but until now it had been very difcult to do. The spacing around the individual textual components (headings, paragraphs, lists, footnotes, etc.) can also be changed on a document-wide basis, 112
Formatting information
as we saw with paragraph spacing and indentation in 3.6. There are a lot of packages available to do various aspects of this, far too many to list here: search CTAN1 to nd what you need. Changing the spacing of section headings for the whole document can be done with the sectsty or section packages, designed to let you adjust sectionA head spacing without having to know about the internal L TEX coding, which is quite complex. The spacing for lists can be adjusted with the mdwlist package. In both cases the user with highly specic requirements such as a publishers A Compositors Specication should read the relevant sections in the The LTEX Companion or ask for expert help, as there are many internal settings which can also be changed to ne-tune your design, but which need some A knowledge of L TEXs internals. All the above are for automating changes so that they occur every time in a consistent manner. You can also make manual changes whenever you need:
Flexible vertical space There are three commands \smallskip, \medskip, and
\bigskip. These output exible (dynamic, or rubber) space, approximately 3pt, 6pt, and 12pt high respectively, and they will automatically compress or expand a little, depending on the demands of the rest of the page (for example to allow one extra line to t, or a heading to be moved to the next page without anyone except a typographer noticing the change). These commands can only be used after a paragraph break (a blank line or the command \par).
Fixed vertical space For a xed-height space which will not stretch or shrink,
use the command \vspace followed by a length in curly braces, e.g. \vspace{18pt} (again, this has to be after a paragraph break). Bear in mind that extra space which ends up at a page-break when the document is formatted will get discarded entirely to make the bottom and top lines fall in the correct places. To force a vertical space to remain and be taken into account even after a page break (very rare), use the starred variant \vspace*, e.g. \vspace*{19pt}.
Double spacing Double-spacing normal lines of text is usually A Bad Idea,
as it looks very ugly. It is still unfortunately a requirement in some universities for thesis submission, a historical relic from the days of typewriters. Nowadays, 11/3 or 1 line spacing is considered acceptable, according to your font size. If your institution still thinks they should have double line spacing, they are probably wrong, and just dont understand that the world has moved on since the
1
http://ctan.org/search.html
Formatting information
113
typewriter. Show them this paragraph and explain that they need to enter the 21st century and adapt to the features of computer typesetting. If they still insist, use the setspace package,which has commands for double line-spacing and one-and-a-half line spacing, but be aware that it will not look pretty. The space between lines is dened by the value of the length variable \baselineskip multiplied by the value of the \baselinestretch command. In general, dont meddle with \baselineskip at all, and with \baselinestretch only if you know what you are doing. (Both can, however, safely be used as reference values in commands like \vspace{\baselineskip} to leave a whole line space.) The value of \baselineskip changes with the font size (see 8.2.4) but is conventionally set to 1.2 times the current nominal font size. This is a value derived from long experience: only change it if you understand what it means and what effect it will have. Quite separately, there are some perfectly genuine and normal reasons for wanting wide line spacing, for example when typesetting a proof of a critical or variorum edition, where editors and contributors are going to want to add notes manually by writing between the lines, or where the text is going to be overprinted by something else like Braille, or in advertising or display text for special effects.
Horizontal space There is a horizontal equivalent to the \vspace command:
\hspace, which works in the same way, so \hspace{1in} will insert a 1 space like this in mid-paragraph. There are also some predened (shorter) spaces available: \thinspace (1/6 em), which we saw between single and double quotes in the last paragraph of 2.5. Its also sometimes used between the full point after abbreviations and a following number, as in page references like p. 199, where a word space would look too big, and setting it solid would look too tight.
A \enspace (em). There is no direct equivalent predened in L TEX for mid and thick spaces as used by metal typesetters, although it would be possible to dene them. The en as a unit is used as the width of a single digit in many fonts, as a convenience so that tables of gures are easy to line up.
\quad (1em). \qquad (2em). Beyond this, all horizontal space within paragraphs is automatically A exible, as this is what L TEX uses to achieve justication. Never be 114
Formatting information
tempted to try and change the spacing between letters unless you have some professional training in typography. Some systems use interletter spacing (incorrectly called tracking) as an aid to justication and it is almost always wrong to do so (and looks it). While it is of A course possible to change letterspacing in L TEX (with the soul package), it should only be done by a typographer, and then only very rarely, as the settings are very subtle and beyond the scope of this book.2
8.1.2
A L TEX has built-in settings to control the page style of its default page layouts. These are implemented with the \pagestyle command, which can take one of the following arguments.
plain for a page number centered at the bottom this is the default; empty for nothing at all, not even a page number use this when you
are doing one-page documents like posters or handouts, where a page number is not meaningful;
headings for running heads based on the current chapter and section
this is common for articles, books, and reports, so that every page is identiable even if printed or copied separately;
myheadings which lets you use your own [re]programmed denitions of how
to use the \markright and \markboth commands, which control how chapter and section titles get into page headers. The command \thispagestyle (taking the same arguments) can be used to force a specic style for the current page only. However, the easiest way to get specialist running heads is to use the fancyhdr package, which lets you redene the left-hand, centre, and righthand page headers and footers for both odd-numbered and even-numbered pages (twelve objects in all). These areas can contain a page number, xed text, variable text (like the current chapter or section title, or the catch-words of a dictionary), or even a small image. They can also be used to do page backgrounds and frames, by making one of them the top corner of an invisible box which hangs text or images down over the whole page. The settings for the typeset version of this document can be used as an example: for the whole story you have to read the documentation.
2
This does not apply for the German technique in blackletter type of using letter-spacing instead of (non-existent) italics. The defaults in the soul package were designed to cater for this.
Formatting information
115
\pagestyle{fancy}\fancyhead{} \renewcommand\headrulewidth{.1pt} \fancyhead[LO,RE]{\footnotesize\sffamily\lite\leftmark} \fancyhead[LE,RO]{\footnotesize\sffamily\lite\itshape \rightmark} \fancyfoot[C]{} \fancyfoot[LE,RO]{\setlength{\fboxsep}{2pt}\ovalbox% {\footnotesize\sffamily\thepage}} \fancyfoot[LO,RE]{\footnotesize\sffamily\lite\@title} \fancypagestyle{plain}{\fancyhf{} \fancyfoot[R]{\setlength{\fboxsep}{2pt}\ovalbox{% \footnotesize\sffamily\thepage}} \fancyfoot[L]{\footnotesize\sffamily\lite\@title} \renewcommand{\headrulewidth}{0pt}}
This is probably more complex than most documents, but it illustrates some common requirements: 1. Settings are prexed by making the \pagestyle fancy and setting the \fancyhead to null to zap any predened values. 2. The thickness of the rule at the top of the page can be changed (or set to 0pt to make it disappear). 3. The header and footer settings are specied with L, C, and R for left, centre, and right; and with O and E for Odd and Even numbered pages. In each setting, the typeface style, size, and font can be specied along with macros which implement various dynamic texts (here, the A current chapter and section titles, which L TEX stores in \rightmark and \leftmark). 4. The plain variant is used for chapter starts, and resets some of the parameters accordingly.
116
Formatting information
Computer Modern is based on a 19th-century book typeface from Monotype, which is why it looks a little like an old-fashioned school book. This paragraph is set in Computer Modern so you can see what it looks like. The typeface was designed using , the font-drawing program made by Knuth to accompany TEX systems, but it is now also available in Type 1 and TrueType formats.
In addition to CM, there are many other fonts which can be downloaded from CTAN, including a large collection of historical, symbol, A initial, and non-Latin fonts. L TEX also comes with the Adobe 35 typefaces which are built into laser printers and other DTP systems, and some more A fonts donated by the X Consortium. Plus, of course, standard L TEX can use A X can use any of any of the thousands of Type 1 fonts available, and pdfLTE the thousands of TrueType fonts as well.
XETEX Jonathan Kews XETEX (see the Preface on p. xiii) attempts to provide transparent access to any font of any format on your computer, making conversion and separate font installation unnecessary.
In the following lists, if there is a package available, its name is given in parentheses after the name of the typeface. The font-family name is shown on the right-hand side. If a non-standard font-encoding is needed, its name is shown before the font-family name.
Latin-alphabet typefaces (
Computer Modern Roman
)
cmr
cmss
cmtt panr
pss
pntt
Formatting information
117
rust
Uncial
Fu, Du ha die Gan geohlen, gib sie wieder her!
If it plese any man spirituel or temrel
Schwbische
U yswab
pag
(bookman)
pbk
pcr
phv
(newcent)
pnc ppl
(times)
ptm
pzc
U pzd
3 4 5 6
Uses Avant Garde as the sans-serif and Courier for monospace. Uses Helvetica as the sans-serif font and Courier for monospace. Uses Avant Garde as the sans-serif and Courier for monospace. Uses Helvetica as the sans-serif font and Courier for monospace. Mathematical symbols for Times are available both free and commercially.
118
Formatting information
As mentioned in 4.4, the Adobe 35 fonts can be used with any printer, not just a laser printer or typesetter. The Ghostscript interpreter and the GSview viewer come with a large set of printer drivers, so you just create PostScript output and print from GSview. Incidentally, the 35 refers to the total number of fonts for the 10 typefaces, including their bold, italic, and bold-italic variants. Postscript Type 1 fonts have been the mainstay of the graphic arts industries for many years, as they allow much better denition of variance (hinting) than most other formats. However, the font format remains proprietary to Adobe, even though they have released it for public use, which means they could change it without warning. A new format called OpenType is designed to overcome this, and some versions of TEX are already able to use OpenType fonts.
Latin-alphabet fonts (PostScript Type 1) from the X Consortium
Charter (charter)
bch
unm
unms
uaq
ugq
(utopia)
put
Non-Latin-alphabet typefaces (
Cypriot Etruscan
)
cypr etr
T h e q ik b ro n f o x m ps o v e r t h e la zy d o g
Linear B Phoenician
T1 linb phnc
The quick brown fox jumps over the azy dog The qk brown fox mps oer the lazy dog
Runic
fut
U zba
You should note that these are just the defaults installed with all versions A of L TEX. There are hundreds more listed in Palle Jrgensens comprehensive
7
Formatting information
119
A L TEX Font Catalog published by the Danish TEX Users Group at http: //www.tug.dk/FontCatalogue/.
8.2.1
Font family Roman (serif, with tails on the uprights), the default Sans-serif, with no tails on the uprights
Code
rm sf tt
A The start-up default for L TEX equates the rm default with the cmr fontfamily (Computer Modern Roman), sf with cmss, and tt with cmtt. If you use one of the packages listed in the tables on pp. 117119, it will replace the defaults of the same type: for example, the bookman package makes the default rm font-family Bookman (pbk), but leaves the sans-serif (sf) and monospace (tt) families untouched. Equally, the package helvet changes the default sans-serif family to Helvetica8 but leaves the serif (Roman) and monospace families untouched. Using both commands will change both defaults because they operate independently. However. . . as it is common to want to change all three defaults at the same time, some of the most common suites of typefaces are provided as packages, but they are for text work only, as they leave mathematics in Computer Modern:
The Helvetica typeface family has a notoriously large x-height, making it hard to match with other typefaces at the same nominal size. The helvet package therefore has a scaled option that lets you reduce the optical size slightly so that the font sits more easily with others: \usepackage[scaled=0.86]helvet, for example.
120
Formatting information
pslatex same as times but uses a specially narrowed Courier to save space
If you use mathematics, there are two fairly complete implementations of non-CM typefaces in the mathptmx (Times) and mathpazo (Palatino) packages. The whole business of math fonts is perpetually under revision in any case, as mathematicians are perpetually inventing new symbols, which take a while to appear in typefaces. The American Mathematical Society (AMS) and other organisations are involved with a project called Styx, which is expected eventually to dene the complete suite of mathematical characters in a rational and extensible manner but dont hold your breath. Where no package name is given in the tables on pp. 117119, it means the font is rarely used as a default by itself except in special cases like users own homebrew packages. To use such a font you have to specify it manually, or make a little macro for yourself if you use it more than once.
8.2.2
To shift to another font family on a temporary basis, use the commands \fontencoding (if needed), \fontfamily, and \selectfont, and enclose the commands and the text in curly braces.
Grouping
This is a different way of using curly braces to how we have used them before: see the panel Grouping on p. 122 It limits the effect of a simple command (see 2.3.1) to the material inside the braces.
In this example, the \fontencoding command has been used to ensure that the typeface will work even if the sentence is used in the middle of something typeset in a different encoding (like this document).10 In a normal document, of course, random typeface changes like this are rather rare. You select your typeface[s] once at the start of the document, and stick with them.
9
10
The pslatex package is also said to be outdated by some experts because it implements rather long-windedly what can now be done in three commands. However, until these replace the current version, I recommend continuing to use pslatex when you want Times with Helvetica and narrow Courier. Test for the observant reader: in what typeface will the colon (:) in the example be set?
Formatting information
121
{\fontfamily{phv}\selectfont Helvetica looks like this}: {\fontencoding{OT1}\fontfamily{bch}\selectfont Charter looks like this}.
Helvetica looks like this: Charter looks like this.
Grouping
Note carefully this use of curly braces to restrict the scope of a change rather than delimit the argument to a command. This is called a group, and it makes the effect any changes made inside the braces local, so that they do not interfere with the text following. Any changes to fonts or other values made within the curly braces cease when the closing curly brace is processed. If you use a paragraphic formatting command like \centering, \flushleft, or \flushright in a group, you must end the text with a \par to nish the paragraph, otherwise the formatting will not take effect. If you use an environment like center, flushleft, or flushright, you do not need the \par because environments are inherently paragraphic and will do it for you.
Most cases where people want to do unusual typeface changes involve A things like special symbols on a repetitive basis, and L TEX provides much easier programmable ways to make these changes into shorthand commands (called macros: see Chapter 9). You could, for example, make a macro called \product which would let you typeset product names in a distinct typeface:
Andlinger, Inc., has replaced \product{Splosh} with \product{SuperSplosh}.
A This is one of L TEXs most powerful features. It means that if you needed to change your \product command at some later stage to use a different font, you only have to change three characters in the macro (the font-family name), and you dont need to edit your document text at all! Whats more, a macro could do other things at the same time, like add an entry to an index of products.
122
Formatting information
* Not all typefaces have all variants! Some only have bold and italics.
A Some typefaces do not have both bold and bold extended: by default LTEX uses \bfseries for
bold extended.
However, vastly more common are changes to type style, while staying with the same font-family.
8.2.3
Within each typeface or font family there are usually several different A looks to the type design. L TEX distinguishes between font family, font shape, and font series (see Table 8.1).
Commands without arguments
Remember back in 2.3.1 seeing simple commands with no arguments? The commands above affect all following text, so to restrict their effect, group them in curly braces along with the text you want affected.
These shape, series, and family commands are commutative, so you can combine a shape with a series and/or a family, without the need to use \selectfont:
This gives you {\bfseries\itshape\sffamily bold italic sans-serif type}, but beware
This gives you bold italic sans-serif type, but beware of pushing your fonts beyond their limits unless you are a typographer. It is not normally meaningful to combine one shape or series class with another of the same
Formatting information
123
class, such as trying to get slanted-italics. Its an impossibility to combine one family with another (such as a seriffed sans-serif typeface!). Slanted plus italics, for example, doesnt make sense, as italics are already slanted (although it is technically possible); and while some typefaces may well possess italic small caps, they are not in common use. Sans-serif and monospace (typewriter) are different fonts, and often different typeface families entirely.11 There is an alternative syntax for the most common type shape and series commands which uses curly braces in the normal argument manner:
Type style Italic Slanted Small Capitals Bold Sans-serif Monospace Command Example puts text into italics puts text into slanted type* puts
TEXT
puts text into bold type puts text into sans-serif type puts text into typewriter type
Underlining isnt a font, and it is extremely rare in typography except for special purposes. If you think you need it, use the ulem package with the normalem option, and the \uline command.
8.2.4
Font sizes
A L TEX has built into its defaults a set of predened font size steps corresponding more or less to the traditional sizes available to metal typesetters. This is deliberate, as these sizes have grown up over 500 years of printing as those which go best together for book-work, which is where TEX originated. These sizes are also reected in the size steps at which Computer Modern was designed. It often comes as a surprise to new users that many typefaces are not designed as a single font and just scaled up or down, but specially drawn at different sizes to make them more legible.
11
Although if youre a typographer wanting to experiment with typewriter typefaces with and without serifs, you can use to do exactly this kind of thing. But thats way outside the scope of this document.
124
Formatting information
As an example, heres 12pt Computer Modern, and heres 5pt Computer Modern scaled up to 12pt, and heres 17pt Computer Modern scaled down to 12pt so you can see there really is a signicant difference. In general, you probably dont want to go scaling fonts too much beyond their design size because they will start to look very odd. The default sizes (and the commands that operate them) are based on the use of a 10pt font, which is the normal size for most texts. Using the larger defaults (11pt and 12pt) for the body font will use 11pt and 12pt designs, with other sizes (eg headings) resized to match. The exact sizes used are listed in the macros in the Class Option les size10.clo, size11.clo and size12.clo. TEXs default fonts above 10pt are in fact scaled by a factor of 1.2, as shown in the fourth column of the table below.
Nominal point size
5 7 8 9 10 12 14 18 20 24
Command
Example
\tiny \scriptsize \footnotesize \small \normalsize \large \Large \LARGE \huge \Huge
While these shorthand commands relieve the beginner of having to worry about the right size for a given task, when you need a specic size you can use the x-cm package to override the step sizes, and use the \fontsize command:
Formatting information
125
\fontsize{22}{28}\selectfont This is 22pt type 6pt leaded
Leading comes from the old metal-type practice of adding a lead strip between lines to increase the spacing.
Ordinal superscripts
Dont use them in normal text. Superscripted ordinals (like 21 ) are a historical relic of Victorian typography. They are unnecessary and are never used in modern professional typesetting. They were re-introduced by Microsoft Word apparently because some Americans like their wordprocessing to look old-fashioned. If you want to try and mimic low-quality wordprocessing, or if you are trying to make a typographic fac-simile of Victorian typsetting, use the \textsuperscript command from the textcomp package. Do not use math mode for text superscripts.
st
The \fontsize command takes two arguments: the point size and the baseline distance. The above example gives you 22pt type on a 28pt baseline (i.e. with 6pt extra space or leading between the lines).
Step-sized fonts
Computer Modern fonts (the default) come xed at the named size steps shown in the taA ble, and if you try to use an odd size in between, LTEX will pick the closest step instead. Many other fonts follow this pattern: if you need to use fonts at arbitrary other sizes there is a package x-cm which lets you override the default steps.
8.2.5
Logical markup
All this playing around with fonts is very pretty but you normally only do it for a reason, even if that reason is just to be decorative. Italics, for example, are used for many things: 126
Formatting information
Cause Foreign words Scientic names Emphasis Titles of documents Product names Variables in maths Subtitles or headings Decoration
Corels WordPerfect
E = mc2
How to get started FREE UPGRADE!!!
Humans usually have no problem telling the difference between these reasons, because they can read and understand the meaning and context. Computers cannot (yet), so it has become conventional to use descriptive names which make the distinction explicit, even though the appearance may be the same. A L TEX has some of these built in, like \emph, which provides emphasis. This has a special feature because when the surrounding text is already italic, emphasis automatically reverts to upright type, which is the normal practice for typesetting.
This has a special feature because {\itshape when the surrounding text is already italic, \emph{emphasis} automatically reverts to upright type, which is the
This sensitivity to logic is programmed into the denition of \emph and its not hard to make up other commands of your own which could do the same, such as \foreign or \product. But why would you bother? In a short document its probably not important, but if youre writing a long report, or a formal document like an article, a book, or a thesis, it makes writing and editing hugely easier if you can control whole groups of special effects with a single command, such as italicising, indexing, or cross-referencing to a glossary. If a format needs changing, you only have to change the denition, and every occurrence automatically follows suit. It also makes it possible to nd and act on groups of meanings such as making an index of scientic names or product names (as in this document) if they are identied with a special command. Otherwise youd spend weeks hunting manually through every \textit command to nd the ones you wanted. This is the importance of automation: it can save you time and money. In Chapter 9 we will see how to make your own simple commands like this.
Formatting information
127
8.2.6
Colour
A You can typeset anything in L TEX in any colour you want using the xcolor package. First, you need to add the command \usepackage{xcolor} to your preamble (note the US spelling of color!). This makes available a default palette of primary colours: red, green, and blue for the RGB colour model used for emitted light (computer and television screens), and cyan, magenta, yellow, and black for the CMYK colour model used for reected light (printing). For the occasional word or phrase in colour, use the command \textcolor with two arguments, the colour name and the text: \textcolor{red}{like this}. There is a \color command as well, for use within groups:
If you have the PostScript printer driver dvips installed, xcolor provides a 64-colour palette of predened color names. These represent approximately the colours in the big box of 64 Crayola colouring pencils much favoured by artists and designers. To get this palette, use \usepackage[dvipsnames]xcolor. Now if you want the Crayola colour Crimson, you can use it as a colour name:
\color{Crimson} \textcolor{Crimson}{some red text}
The biggest selection of predened colours is available with the svgnames option: this denes all the colours dened by the Scalable Vector Graphics (SVG) standard for web graphics (so its good for compatibility). As some of the predened colour names are quite long, you can create a short name of your own for colours you use frequently, using the \definecolor command: 128
Formatting information
\definecolor{mb}{named}{MidnightBlue}
The \definecolor command needs three arguments: your shorthand name, the name of the colour model, and the colour specication. In the case of the named model, the last argument is one of the colour names specied by A the option you loaded the package with. To use these names with pdfLTEX, you may need to use the pdftex option to the xcolor package, depending on the version of TEX you have installed. Using the \definecolor command, you can dene any colour you want by giving it a name, specifying which colour model, and providing the Red-Green-Blue (RGB) or Cyan-Magenta-Yellow-Black (CMYK) colour values expressed as decimal fractions, separated by commas. For example, an RGB shade given as (37,125,224) in decimal (#250FE0 in hexadecimal as used on the Web) can be given as:
\definecolor{midblue}{rgb}{0.145,0.490,0.882}
(To get the fractional value, divide the integer decimal value by 255, the maximum for each of the hues in the Red-Green-Blue colour model.) You can then use \textcolor with your new colour name: midblue looks like this if youre reading in colour. The xcolor package also provides a colour version of \fbox (see 6.7.2) called \colorbox:
\colorbox{midblue}{\color{magenta}Magenta on midblue}
However, combining colours is an art and a skill: using conicting colours like Magenta on midblue is as good a warning as any to learn about colour models and palettes before trying to use them!
8.3
Different fonts come in a variety of packagings: the three most common used with TEX systems are PostScript fonts, TrueType fonts, and fonts. How you install them and where they go depends on A how you installed L TEX: all I can deal with here are the standard locations within the TDS. Typefaces come supplied as one or more font outline les and a number of ancillary les:
Formatting information
129
Directories (Folders)
In the examples below, all the folders (directories) are assumed to be in your Local TEX Directory unless otherwise explicitly given. See Chapter 1 for how to nd this out.
typefaces have a number of .mf source (outline) les, possibly also some .fd (font denition) les and a .sty (style) le. The .tfm (TEX font metric) les are not needed, as they can be generated from the outlines. PostScript typefaces come as a pair of les: a .pfb (PostScript font binary) or
.pfa (PostScript font ASCII) outline, and an .afm (Adobe font metric) le. There may also be .inf and other les but these are not needed for use with TEX systems.
TrueType typefaces are a single .ttf le, which combines outline and metrics
in one. The instructions here assume the use of the New Font Selection Scheme A A (NFSS) used in L TEX 2 . If you are running the obsolete L TEX 2.09, upgrade it now.
8.3.1
Installing
fonts
This is the simplest installation. When you download fonts from CTAN, youll usually nd a number of outline les (.mf les) and maybe some other types as well (see below). 1. Create a new subdirectory named after the typeface youre installing in fonts/source/public/: 2. Copy all the .mf les to this directory. 3. Copy the .fd (Font Denition) le[s] to your tex/latex/mfnfss directory. 4. Copy the .sty (style) le to a subdirectory (create it) of tex/latex named after the typeface. 5. Run your TEX indexer program (see step 4 in the procedure on p. 67). Thats it. Unlike PostScript fonts, fonts can be used to generate the font metric le (.tfm les) automatically on-the-y the rst time the typeface is used, so there should be nothing else to install. 130
Formatting information
Now you can put a \usepackage command in your preamble with whatever name the .sty le was called, and read the documentation to see what commands it gives to use the font (refer to the last paragraph of 5.2.1 and step 2 in the procedure on p. 65). If the font came without.fd or .sty les, youll need to nd someone who can make them for you (or follow the outline in 8.3.2, step 11 in the procedure on p. 137).
8.3.2
Lots of people will tell you that PostScript fonts and PostScript output are dead and that TrueType or OpenType fonts and PDF output are the way to A go. While this may be true for some cases, standard L TEX does not work A with TrueType fonts and does not produce PDF directly. Only pdfLTEX does that, and there are still many printers whose typesetters and platemakers use PostScript equipment rather than PDF. In addition, operating system support for scalable fonts is still very poor on Unix systems (including GNU/Linux), despite the advances in recent years, and many rebranded (knock-off or pirated) TrueType fonts supplied with other systems are of very poor quality, so in many cases it still makes sense to use TEXs built-in support for PostScript. When XETEX becomes the default processor, it will no longer be necessary to install different types of font les separately, as XETEX is able to use all fonts natively from your systems font folder. Two les are needed for each font: the .afm Adobe Font Metric (AFM) and the .pfb PostScript Font Binary (PFB) les. You must have both for each font before you start. If you only have the near-obsolete .pfa PostScript Font ASCII (PFA) les, it may be possible to generate the .pfb les using the t1binary program from the t1utils suite (see http://gnuwin32.sourceforge. net/packages/t1utils.htm) or the excellent FontForge font editor (from http://fontforge.sourceforge.net). There are unfortunately still some companies distributing Type 1 fonts in .pfa format (Mathematica is one reported recently). Ill repeat this: before you start, make sure you have all the .afm and .pfb les for the typeface you want. In the example below, Im going to use a single font from an imaginary typeface called Foo, so I have foo.afm and foo.pfb les. 1. Put the les in your temporary directory This is /tmp on Macs and GNU/Linux, and should be C:\tmp or C:\temp or even C:\Windows\temp on Microsoft Windows.
A 2. Decide on the short font name to use inside L TEX. This is not the full descriptive name (e.g. Baskerville Italic Bold Extended) but an encoded font name in the format fnnsseec, devised
Formatting information
131
by Karl Berry, which stores the same information in no more than eight characters for compatibility with systems which cannot handle long lenames. The letters in the format above have the following meanings (see the fontname documentation on your computer for more details lists of the codes used are in the les supplier.map, weight.map, width.map, variant.map, and the various .map les for each foundry):
Letter Meaning foundry typeface series/shape encoding variant Examples
f nn ss ee v
b=Bitstream, m=Monotype, p=Adobe ba=Baskerville, tm=Times, pl=Palatino r=roman, b=bold, i=italic, etc. 8r=revised TEXBase1, ly=Y&Ys TEXnANSI
smallcaps, outline, script, etc.
The fonts/fontname directory in your main (not local) installation directory of TEX has les for several foundries giving fully-formed names like these for common fonts (e.g. ptmr8r is [Adobe] PostScript Times Roman in an 8bit revised TEX encoding; bgslly is Bitstream Gill Sans Light in Y&Ys TEXnANSI encoding [LY1]).12 Read the documentation in Fontname: Filenames for TEX fonts to nd out how to make up your own short names if the foundry and font you want is not shown in the lists in the fonts/map/fontname directory. In this example well call our mythical example typeface zork (standing for Zfonts Ordinary Bookface, because k is the letter used for Book fonts, b being already the code for bold) and well assume the font comes in the two les foo.afm and foo.pfb that I mentioned above. While the font/map/fontname directories have ready-made maps of these names for popular collections of typefaces, making them up requires some knowledge of typographic terms and a careful reading of the fontname documentation. 3. Decide on your encoding Encoding is needed because Adobe fonts store their characters in different places to the TEX standard. This is what tripped me up the rst few times until someone pointed me at Y&Ys13 TEXnANSI
12
13
Confusingly, Bitstream fonts (and others from similar sources) mostly have different names from the original fonts, to avoid copyright issues, so what they call Humanist 521 is actually Gill Sans. Until recently, US law only allowed the names of typefaces to be copyrighted, not the font designs themselves, leading to widespread piracy. Y&Y, Inc has ceased trading and their TEX distribution is not longer available, although there is email support at http://lists.ucc.ie/lists/archives/yandytex.html, and their encoding les continue to be used.
132
Formatting information
encoding which at the time was the only one that included the glyphs I want where I expected them to be.14 Now, however, I recommend using the 8r encoding for all PostScript fonts. The encoding vector le 8r.enc should be in your main (not local) TEX installation directory in fonts/enc/dvips/base. To avoid having to type the long path each time below, just copy this le to the temporary directory where youre doing all this stuff. 4. Convert .afm les to .tfm The afm2tfm and vptovf programs are standard TEX utilities in the bin directory of your mainTEX installation. In a command window, type:
afm2tfm foo.afm -v zorkly.vpl -p texnansi.enc rzorkly.tfm >zork.id
This creates a special rawTEX Font Metric le (hence the special r A prex) that L TEX can use, with a list of all its properties encoded with 8r (the .vpl or Virtual Property List le). Many people will tell you that virtual fonts are dead and that this is the wrong way to do it, but no-one has ever shown me an alternative that works, so I stick with it. 5. Small caps (optional) If you want a small caps variant faked up (perhaps because the typeface family doesnt have a special small-caps font), repeat the medicine like this:
afm2tfm foo.afm -V zorklyc.vpl -p texnansi.enc rzorkly.tfm >>zork.id
Note the capitalV option here. Yes, it does overwrite the rzorkly.tfm created in the rst command. Let it. And those are two of the greater-than signs before the zork.id lename because we want to append to it, not overwrite it. 6. Create the virtual font A Turn the .vpl les into .vf and .tfm pairs. L TEX needs these to convert from Adobes encoding to its own.
14
The only one I had problems with is , which for some weird reason isnt catered for in this encoding.
Formatting information
133
vptovf zorkly.vpl zorkly.vf zorkly.tfm vptovf zorklyc.vpl zorklyc.vf zorklyc.tfm
7. Make directories to hold the les Under your local directory there should be a fonts directory, and in it there should be afm, tfm, type1, and vf subdirectories. Create them if they do not already exist. In each of these four, create a directory for the foundry, and within them create a directory for the typeface (using a human-readable typeface name, not the short Karl Berry fontname). On my computer, this means:
cd /usr/local/share/texmf/fonts mkdir -p afm/zfonts/zork mkdir -p tfm/zfonts/zork mkdir -p type1/zfonts/zork mkdir -p vf/zfonts/zork cd /tmp
Or if youre lazy:
(cd /usr/local/share/texmf/fonts;for d in afm tfm type1 vf; do mkdir -p $d/zfonts/zork;done)
For Microsoft Windows users, you may have to do this in the MikTEX directories. The mkdir command exists in Windows as well, but the -p is a Unix feature: it automatically creates any missing intervening subdirectories. If your directory-making command doesnt do this, youll have to make the intervening directories by hand rst. 8. Copy the les to their rightful places Copy the four groups of les to the four new directories:
cp cp cp cp *.afm \textsl{\uline{localdir}}/fonts/afm/zfonts/zork/ *.tfm \textsl{\uline{localdir}}/fonts/tfm/zfonts/zork/ *.pfb \textsl{\uline{localdir}}/fonts/type1/zfonts/zork/ *.vf \textsl{\uline{localdir}}/fonts/vf/zfonts/zork/
where localdir is the prex of your local TEX installation directory. You can of course do all this with a directory window and mouse if you nd it easier. 134
Formatting information
9. Create a font map The font map is what tells dvips which PFB le to use for which font.15 There should be a personal conguration le for your use A of L TEX called 10local.cfg, in your login folder in a subfolder called .texmf-config/updmap.d. All it needs is an entry for our new font, using the three-letter font family abbreviation (the rst three letters of the Karl Berry fontname (here zor):
Map zor.map
We also have to create this map le (zor.map) in a subdirectory of dvips/config/ named after the foundry, so we need to create dvips/config/zfonts as well. (a) Open 10local.cfg in your editor. (b) At the bottom, add the line: Map zor.map (c) Save and close the le. The font entries in our zor.map will be on a single line each, with no line-wrapping. Each entry gives the short name of the font, the long (Adobe) name, the PostScript encoding parameters (in quotes), and then two lenames prexed by input redirects (less-than signs): the encoding le and the PostScript outline le. (a) First create the directory if it doesnt already exist:
mkdir -p \textsl{\uline{localdir}}/dvips/config/zfonts
(b) Use your editor to open (create) the le dvips/config/zfonts/ zor.map. (c) Insert the line:
rzorkly Zork-Blackface "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <foo.pfb
15
Formatting information
135
You get the full font name (here, Zork-Blackface) from the zork.id which was created back in step 4 in the procedure on p. 133 when we ran afm2tfm. You must get this exactly right, because its the ofcial full name of the font, and PostScript les using this font need to match it. 10. Create a style le A L TEX needs a style le to implement the interface to the font. Call it after the typeface or something related; in this example well call it foozork.sty. In it go some details of the name and date we did this, A what version of L TEX it needs, and any other command necessary to operate the font, like the font encoding and whether it is to supersede the current default Roman font. (a) Use your editor to open (create) foozork.sty in your local tex/ latex/psnfss directory. (b) Insert the following lines:
% foozork - created from foo for Zork \def\fileversion{1.0} \def\filedate{2010/12/03} \def\docdate{2010/12/03} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{foozork}[\filedate\space\fileversion\space Zfonts Ordinary PSNFSS2e package] \RequirePackage[T1]{fontenc} \renewcommand{\rmdefault}{zor} \endinput
Note the following: The rst argument to \ProvidesPackage must be the same as this style le name; and that the font family is referred to as zor, being the foundry letter plus the fontname abbreviation. This acts as a prex for any/all font variants (bold, italic, etc.). The T1 option to the fontenc package is the name used for the interface to the 8r encoding. If this is a typewriter font, make the renewed command \rmdefault into \ttdefault. If its a sans-serif font, make it \sfdefault instead. Omit that command completely if you dont want the style le to supersede the current defaults but simply to make the font available. If you do this, you probably want to write a 136
Formatting information
new command or two to use it, typically one for grouped use and one for argument use:
\newcommand{\zorkfamily}{\fontencoding{T1}\fontfamily{zor}\selectfont} \newcommand{\textzork}[1]{{\zorkfamily#1}}
(c) Save and close the le. 11. Create the Font Denition le The last le to create is the font denition (.fd) le. This is named following the pattern eefnn.fd, using the same conventions as before, by prepending the (lowercase) encoding abbreviation to the foundry letter and fontname abbreviation, so our example would be t1zor.fd for the T1 (8r) encoding and the zor short font name. (a) Use your editor to open (create) tex/latex/psnfss/t1zor.fd (b) Enter the following lines:
\ProvidesFile{t1zor.fd}[2010/03/03 v0.1 manual font definitions for LY1/zor.] \DeclareFontFamily{T1}{zor}{} \DeclareFontShape{T1}{zor}{k}{n}{<-> zorkly}{} \DeclareFontShape{T1}{zor}{k}{sc}{<-> zorklyc}{}
(c) Save and close the le. FD les typically use one \DeclareFontFamily command which species the encoding and the short font name. Then as many pairs of \DeclareFontShape commands as you converted fonts (assuming you did both normal and small caps for each font: see step 5 in the procedure on p. 133; if you didnt, then only one such command per font is needed here). The arguments to the \DeclareFontShape command to watch are the 3rd (weight/width), 4th (shape), and 5th (font outline name): the rest are static for each .fd le and simply identify the encoding and the font family.
A The codes to use are given on pages 41415 of the The LTEX Companion and should also be in your copies of fonts/map/fontname/weight.map and fonts/map/fontname/width.map. The rules for combining weight and width need care: read the documentation for the fontname package.
Formatting information
137
There is no shape.map in fontname because its not part of font le A names, its purely a L TEX creation, so heres what the same book says:
Character Meaning normal (upright) italic slanted small caps upright italic outline
n it sl sc ui ol
Add your own for other oddities, but be consistent: I use cu for cursive (scripts), for example, and k for blackletter faces (not to be confused with k as a width for book). The default fontspec <-> in the 5th argument in the \DeclareFontShape command means that all sizes are to come from the same font outline (remember if this was a font with different design sizes like CM it would be much more complex). If the face has only a few variants, you can create any other entries for bold, italic, slanted, etc. with the relevant weight and width and shape values pointing at the relevant outline le. If you want one font to substitute for a missing one (for example italics to substitute for slanted in a typeface which has no slanted variant of its own) give the ssub (silent substitution) command in the fontspec: for example to make all references to sl (slanted) type use an existing italic font, make the 5th argument like this:
{<-> ssub * zor/m/it}
If you nd the x-height of a font too big or too small to sort well with another font you are using, you can specify an s (scale) factor in this argument instead: this example will shrink the result to 80% of normal:
{<-> s * [0.8] zorkly}
12. Update the index and the map les Run your TEX indexer program (see step 4 in the procedure on p. 67) so that updmap can nd the les it needs. 138
Formatting information
texhash
(or whatever your installation calls it). Then run updmap to add the map le:
updmap --enable Map=zor.map
A This updates the maps for dvips, pdfLTEX, and others. Finally, run the TEX indexer program again so that it can nd the map in its new location.
texhash
A Now you can \usepackage{foozork} in your L TEX le to make it the default font. To use the font incidentally instead of as the default, you can use the commands you added at the end of step 10 in the procedure on p. 136:
Formatting information
139
9
9.1
Formatting information
Programmability (macros)
A Weve touched several times on the ability of L TEX to be reprogrammed. This is one of its central features, and one that still, after nearly a quarter of a century, puts it well above many other typesetting systems, even those with macro systems of their own. Its also the one that needs most foreknowledge, which is why this chapter is in this position. A L TEX is in fact itself just a collection of macros rather a big collection written in TEXs internal typesetting language. These macros are little program-like sets of instructions with a name which can be used as shorthand for an operation you wish to perform more than once.
Macros can be arbitrarily complex. Many of the ones used in the standard A L TEX packages are several pages long, but as we will see, even short ones can very simply automate otherwise tedious chores and allow the author to concentrate on writing.
A In its simplest form, a L TEX macro can just be a straightforward text replacement of a phrase to avoid misspelling something each time you need it, e.g.
141
\newcommand{\ef}{European Foundation for the Improvement of Living and Working Conditions}
Put this in your preamble, and you can then use \ef in your document and it will typeset it as the full text. Remember that after a command ending in a letter you need to leave a space to avoid the next word getting gobbled up as part of the command (see 2.3.1). And when you want to force a space to be printed, use a backslash followed by a space, e.g.
The \ef\ is an institution of the Commission of the European Union.
As you can see from this example, the \newcommand command takes two arguments: a) the name you want to give the new command; and b) the expansion to be performed when you use it, so there are always two sets of curly braces after \newcommand.
\makeatletter \renewcommand{\maketitle}{% \begin{flushleft}% \sffamily {\Large\bfseries\color{red}\@title\par}% \medskip {\large\color{blue}\@author\par}% \medskip {\itshape\color{green}\@date\par}% \bigskip\hrule\vspace*{2pc}% \end{flushleft}% } \makeatother
Insert this immediately before the \begin{document} in the sample le in the rst listing, and remove the \color{...} commands from the title, A author, and date. Re-run the le through L TEX, and you should get something like this:
Practical Typesetting
Peter Flynn Silmaril Consultants
December 2001
In this redenition of \maketitle, weve done the following: 1. Enclosed the changes in \makeatletter and \makeatother to allow us to use the @ sign in command names;1 2. Used \renewcommand and put \maketitle in curly braces after it; 3. Opened a pair of curly braces to hold the new denition. The closing curly brace is immediately before the \makeatother; 4. Inserted a flushleft environment so the whole title block is leftaligned; 5. Used \sffamily so the whole title block is in the dened sans-serif typeface; 6. For each of \@title, \@author, and \@date, we have used some font variation and colour, and enclosed each one in curly braces to restrict the changes just to each command. The closing \par makes sure that multiline title and authors and dates get typeset with the relevant line-spacing; 7. Added some exible space between the lines, and around the \hrule (horizontal rule) at the end;
1
If you move all this preamble into a style le of your own, you dont need these commands: the use of @ signs in command names is allowed in style and class les.
Formatting information
143
Note the % signs after any line ending in a curly brace, to make sure no intrusive white-space nd its way into the output. These arent needed after simple commands where there is no curly brace because excess white-space gets gobbled up there anyway.
If I now type \tmproduct{Velcro} then I get Velcro typeset, and if you look in the index, youll nd this page referenced under Velcro. Lets examine what this does: 1. The macro is specied as having one argument (thats the [1] in the denition). This will be the product name you type in curly braces when you use \product. Macros can have up to nine arguments. 2. The expansion of the macro is contained in the second set of curly braces, spread over several lines (see item 5 for why). 3. It prints the value of the rst argument (thats the #1) in italics, which is conventional for product names, and adds the \texttrademark command. 4. Finally, it creates an index entry using the same value (#1), making sure that its italicised in the index (see the list on p. 108 in 7.5 to remind yourself of how indexing something in a different font works). 5. Typing this macro over several lines makes it easier for humans to read. I could just as easily have typed 144
Formatting information
\newcommand{\product}[1]{\textit{#1}\index{#1@\textit{#1}}}
but it wouldnt have been as clear what I was doing. One thing to notice is that to prevent unwanted spaces creeping into A the output when L TEX reads the macro, I ended each line with a A comment character (%). L TEX normally treats newlines as spaces when formatting (remember the list on p. 18 in 2.4.1), so this stops the end of line being turned into an unwanted space when the macro is A used. L TEX usually ignores spaces at the start of macro lines anyway, so indenting lines for readability is ne.
In 2.7.2 we mentioned the problem of frequent use of unbreakable text leading to poor justication or to hyphenation problems. A solution is to make a macro which puts the argument into an \mbox with the appropriate font change, but precedes it all with a conditional \linebreak which will make it more attractive to TEX to start a new line.
\newcommand{\var}[1]{\linebreak[3]\mbox{\ttfamily#1}}
This only works effectively if you have a reasonably wide setting and paragraphs long enough for the differences in spacing elsewhere to get hidden. If you have to do this in narrow journal columns, you may have to adjust wording and spacing by hand occasionally.
9.4
Nested macros
Heres a slightly more complex example, where one macro calls another. Its common in normal text to refer to people by their forename and surname (in that order), for example Donald Knuth, but to have them indexed as surname, forename. This pair of macros, \person and \reindex, automates that process to minimize typing and indexing.
\newcommand{\person}[1]{#1\reindex #1\sentinel} \def\reindex #1 #2\sentinel{\index{#2, #1}}
1. The digit 1 in square brackets means that \person has one argument, so you put the whole name in a single set of curly braces, e.g. \person{Don Knuth}.
Formatting information
145
2. The rst thing the macro does is output #1, which is the value of what you typed, just as it stands, so the whole name gets typeset exactly as you typed it. 3. But then it uses a special feature of Plain TEX macros (which use A \def instead of L TEXs \newcommand2 ): they too can have multiple arguments but you can separate them with other characters (here a space) to form a pattern which TEX will recognise when reading the arguments. In this example (\reindex) its expecting to see a string of characters (#1) followed by a space, followed by another string of characters (#2) followed by a dummy command (\sentinel). In effect this makes it a device for splitting a name into two halves on the space between them, so the two halves can be handled separately. The \reindex command can now read the two halves of the name separately. 4. The \person command invokes \reindex and follows it with the name you typed plus the dummy command \sentinel (which is just there to signal the end of the name). Because \reindex is expecting two arguments separated by a space and terminated by a \sentinel, it sees Don and Knuth as two separate arguments. It can therefore output them using \index in reverse order, which is exactly what we want. A book or report with a large number of personal names to print and index could make signicant use of this to allow them to be typed as \person{Leslie Lamport} and printed as Leslie Lamport, but have them indexed as Lamport, Leslie with virtually no effort on the authors part at all.
Dont try this at home alone, children! This one is safe enough, but you should strictly avoid \def for a couple of years. Stick to \newcommand for now.
146
Formatting information
9.6
A L TEXs internal macros can also be reprogrammed or even rewritten entirely, although doing this can require a considerable degree of expertise. Simple changes, however, are easily done. A Recall that L TEXs default document structure for the Report document class uses Chapters as the main unit of text, whereas in reality most reports are divided into Sections, not Chapters ( 6). The result of this is that if you start off your report with \section{Introduction}, it will print as
0.1
Introduction
which is not at all what you want. The zero is caused by it not being part of any chapter. But this numbering is controlled by macros, and you can redene them. In this case its a macro called \thesection which reproduces the current section number counter (see the last paragraph of 6.2.6). Its redened afresh in each document class le, using the command \renewcommand (in this case in texmf/tex/latex/base/report.cls):
\renewcommand \thesection {\thechapter.\@arabic\c@section}
You can see it invokes \thechapter (which is dened elsewhere to reproduce the value of the chapter counter), and it then prints a dot, followed by the Arabic value of the counter called section (that \c@ notation is A L TEXs internal way of referring to counters). You can redene this in your preamble to simply leave out the reference to chapters:
Formatting information
147
\begin{Sbox} \begin{minipage}{3in} This text is formatted to the specifications of the minipage environment in which it occurs. Having been typeset, it is held in the Sbox until it is needed, which is after the end of the minipage, where you can (for example) align it and put it in a special framed box. \end{minipage} \end{Sbox} \begin{center} \shadowbox{\TheSbox} \end{center}
This text is formatted to the specications of the minipage environment in which it occurs. Having been typeset, it is held in the Sbox until it is needed, which is after the end of the minipage, where you can (for example) centre it and put it in a special framed box.
\renewcommand{\thesection}{\arabic{section}}
Ive used the more formal method of enclosing the command being redened in curly braces. For largely irrelevant historical reasons these A braces are often omitted in L TEXs internal code (as you may have noticed in the example earlier). And Ive also used the public macro \arabic A to output the value of section (L TEXs internals use a private set of control sequences containing @-signs, designed to protect them against being changed accidentally). Now the introduction to your report will start with:
Introduction
Whats important is that you dont ever need to alter the original document class le report.cls: you just copy the command you need to change 148
Formatting information
into your own document preamble, and modify that instead. It will then override the default.
9.6.1
As mentioned earlier ( 4), heres how to redene a bullet for an itemized list, with a slight tweak:
\usepackage{bbding} \renewcommand{\labelitemi}{% \raisebox{-.25ex}{\PencilRight}}
Here we use the bbding package which has a large selection of dingbats or little icons, and we make the label for top-level itemized lists print a rightpointing pencil (the names for the icons are in the package documentation: see 5.1.2 for how to get it). In this case, we are using the \raisebox command within the redenition because it turns out that the symbols in this font are positioned slightly too high for the typeface were using. The \raisebox command takes two arguments: the rst is a dimension, how much to raise the object by (and a negative value means lower: there is no need for a \lowerbox command); and the second is the text you want to affect. Here, we are shifting the A symbol down by ex (see 2.7.1 for a list of dimensions L TEX can use). There is a vast number of symbols available: see A comprehensive list of symbols in TEX for a comprehensive list.
Formatting information
149
10
Formatting information
A As we saw in Chapter 2, L TEX uses plain-text les, so they can be read and written by any standard application that can open text les. This helps preserve your information over time, as the plain-text format cannot be obsoleted or hijacked by any manufacturer or sectoral interest, and it A will always be readable on any computer, from your handheld (yes, L TEX is available for some PDAs, see Figure 10.1) to the biggest supercomputer.
A Figure 10.1: LTEX editing and processing on the Sharp Zaurus 5500 PDA
151
A However, L TEX is intended as the last stage of the editorial process: formatting for print or display. If you have a requirement to re-use the text in some other environment a database perhaps, or on the Web or a CD-ROM or DVD, or in Braille or voice output then it should probably be edited, stored, and maintained in something neutral like the A Extensible Markup Language (XML), and only converted to L TEX when a typeset copy is needed. A Although L TEX has many structured-document features in common with A A SGML and XML, it can still only be processed by the L TEX and pdfLTEX programs. Because its macro features make it almost innitely redenable, processing it requires a program which can unravel arbitrarily complex A macros, and L TEX and its siblings are the only programs which can do that effectively. Like other typesetters and formatters (Quark XPress, PageMaker, A FrameMaker, Microsoft Publisher, 3B2 etc.), L TEX is largely a one-way street leading to typeset printing or display formatting. A Converting L TEX to some other format therefore means you will unavoidA ably lose some formatting, as L TEX has features that others systems simply dont possess, so they cannot be translated although there are several A ways to minimise this loss. Similarly, converting other formats into L TEX often means editing back the stuff the other formats omit because they only store appearances, not structure. A However, there are at least two excellent systems for converting L TEX directly to HyperText Markup Language (HTML) so you can publish it on the web, as we shall see in 10.2.
152
Formatting information
Use the File Save As. . . menu item to save the wordprocessor le as HTML, rationalise the HTML using Dave Raggetts HTML Tidy 1 , and convert the resulting Extensible HyperText Markup Language A (XHTML) to L TEX with any of the standard XML tools (see below). Use a specialist conversion tool like EBTs DynaTag (supposedly available from Enigma, if you can persuade them they have a copy to sell you; or you may still be able to get it from Red Bridge Interactive2 in Providence, RI). Its expensive and they dont advertise it, but for bulk conversion of consistently-marked Word les into usable XML it beats everything else hands down. The Word les must be consistent, though, and must use named styles from a stylesheet, otherwise no system on earth is going to be able to guess what it means. There is of course a third way, suitable for large volumes only: send it A off to the Pacic Rim to be scanned or retyped into XML or L TEX. There are hundreds of companies from India to Polynesia who do this at high speed and low cost with very high accuracy. It sounds crazy when the document is already in electronic form, but its a good example of the problem of low quality of wordprocessor markup that this solution exists at all. You will have noticed that most of the solutions lead to one place: XML. As explained above and elsewhere, this format is the only one so far devised capable of storing sufcient information in machine-processable, publiclyaccessible form to enable your document to be recreated in multiple output formats. Once your document is in XML, there is a large range of software A available to turn it into other formats, including L TEX. Processors in any of the common XML processing languages like the Extensible Stylesheet Language [Transformations] (XSLT) or Omnimark can easily be written to A output L TEX, and this approach is extremely common. Much of this would be simplied if wordprocessors supported native, A arbitrary XML/XSLT as a standard feature, because L TEX output would become much simpler to produce, but this seems unlikely. However, the native format for both OpenOfce and Word is now XML. Both .docx and .odf les are actually Zip les containing the XML document together with stylesheets, images, and other ancillary les. This means A that for a robust transformation into L TEX, you just need to write an XSLT stylesheet to do the job non-trivial, as the XML formats used are extremely complex, but certainly possible. Among the conversion programs for related formats on CTAN is Ujwal Sathyam and Paul DuBoiss rtf2latex2e, which converts Rich Text Format A (RTF) les (output by many wordprocessors) to L TEX 2 . The package
1 2
http://tidy.sourceforge.net/ http://www.rbii.com/
Formatting information
153
description says it has support for gures and tables, equations are read as gures, and it can the handle the latest RTF versions from Microsoft Word 97/98/2000, StarOfce, and other wordprocessors. It runs on Macs, Linux, other Unix systems, and Windows.
10.1.1
Assuming you can get your document out of its wordprocessor format into XML by some method, here is a very brief example of how to A turn it into L TEX. You can of course buy and install a fully-edged commercial XML editor with XSLT support, and run this application within it. However, this is beyond the reach of many users, so to do this unaided you just need to install three pieces of software: Java3 , Saxon4 and the DocBook 4.2 DTD5 (URIs are correct at the time of writing). None of these has a visual interface: they are run from the command-line in the same way as is A possible with L TEX. As an example, lets take the above paragraph, as typed or imported into AbiWord (see Figure 10.2). This is stored as a single paragraph with highlighting on the product names (italics), and the names are also links to their Internet sources, just as they are in this document. This is a convenient way to store two pieces of information in the same place.
3 4 5
154
Formatting information
AbiWord can export in DocBook format, which is an XML vocabulary for describing technical (computer) documents its what I use for this A book. AbiWord can also export L TEX, but were going make our own version, working from the XML (Brownie points for the reader who can guess why A Im not just accepting the L TEX conversion output). Although AbiWords default is to output an XML book document type, A well convert it to a L TEX article document class. Notice that AbiWord has correctly output the expected section and title markup empty, even though its not used. Heres the XML output (Ive changed the linebreaks to keep it within the bounds of the page size of the printed edition):
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> <book> <!-- ================================================== --> <!-- This DocBook file was created by AbiWord. --> <!-- AbiWord is a free, Open Source word processor. --> <!-- You may obtain more information about AbiWord at www.abisource.com --> <!-- ================================================== --> <chapter> <title></title> <section role="unnumbered"> <title></title> <para>You can of course buy and install a fully-fledged commercial XML editor with XSLT support, and run this application within it. However, this is beyond the reach of many users, so to do this unaided you just need to install three pieces of software: <ulink url="http://java.com/download/"><emphasis>Java</emphasis></ulink>, <ulink url="http://saxon.sourceforge.net"><emphasis>Saxon</emphasis></ulink>, and the <ulink url="http://www.docbook.org/xml/4.2/index.html">DocBook 4.2 DTD</ulink> (URIs are correct at the time of writing). None of these has a visual interface: they are run from the command-line in the same way as is possible with L<superscript>A</superscript>T<subscript>E</subscript>X.</para> </section> </chapter> </book>
The XSLT language lets us create templates for each type of element in an XML document. In our example, there are only three which need handling, as we did not create chapter or section titles (DocBook requires them to be present, but they dont have to be used). para, for the paragraph[s]; ulink, for the URIs; emphasis, for the italicisation. Im going to cheat over the superscripting and subscripting of the letters in A the L TEX logo, and use my editor to replace the whole thing with the \LaTeX A command. In the other three cases, we already know how L TEX deals with these, so we can write our templates (see Figure 10.3).
Formatting information
155
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text"/> <xsl:template match="/"> <xsl:text>\documentclass{article}\usepackage{url}</xsl:text> <xsl:apply-templates/> </xsl:template> <xsl:template match="book"> <xsl:text>\begin{document}</xsl:text> <xsl:apply-templates/> <xsl:text>\end{document}</xsl:text> </xsl:template> <xsl:template match="para"> <xsl:apply-templates/> <xsl:text>
</xsl:text> </xsl:template> <xsl:template match="ulink"> <xsl:apply-templates/> <xsl:text>\footnote{\url{</xsl:text> <xsl:value-of select="@url"/> <xsl:text>}}</xsl:text> </xsl:template> <xsl:template match="emphasis"> <xsl:text>\emph{</xsl:text> <xsl:apply-templates/> <xsl:text>}</xsl:text> </xsl:template> </xsl:stylesheet>
If you run this through Saxon, which is an XSLT processor, you can A output a L TEX le which you can process (see Figure 10.4) and view (see Figure 10.5). Writing XSLT is not hard, but requires a little learning. The output method A here is text, which is L TEXs le format (XSLT can also output HTML and other formats of XML). 1. The rst template matches /, which is the document root (before the book start-tag). At this stage we output the text which will start 156
Formatting information
Figure 10.4: Running and XML le through the Saxon XSLT processor
$ java -jar saxon9.jar -o para.ltx para.dbk para.xsl $ pdflatex para.ltx This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian) restricted \write18 enabled. entering extended mode (./para.ltx LaTeX2e <2009/09/24> Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, nohyphenation, farsi, arabic, croatian, bulgarian, ukrainian, russian, czech, slovak, danish, dutch, finnish, french, basque, ngerman, german, german-x-2009-06-19, ngerman-x-2009-06-19, ibycus, monogreek, greek, ancientgreek, hungarian, sanskrit, italian, latin, latvian, lithuanian, mongolian2a, mongolian, bokmal, nynorsk, romanian, irish, coptic, serbian, turkish, welsh, esperanto, uppersorbian, estonian, indonesian, interlingua, icelandic, kurmanji, slovenian, polish, portuguese, spanish, galician, catalan, swedish, ukenglish, pinyin, loaded. (/usr/share/texmf-texlive/tex/latex/base/article.cls Document Class: article 2007/10/19 v1.4h Standard LaTeX document class (/usr/share/texmf-texlive/tex/latex/base/size10.clo)) (/usr/share/texmf-texlive/tex/latex/ltxmisc/url.sty) (./para.aux) [1{/home/peter/.texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./para.aux)) </usr/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmr10.pfb> </usr/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmr6.pfb> </usr/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmr7.pfb> </usr/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmti10.pfb> </usr/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmtt8.pfb> Output written on para.pdf (1 page, 54289 bytes). Transcript written on para.log. $
A the L TEX document, \documentclass{article} and \usepackage{url}. The apply-templates instructions tells the processor to carry on processing, looking for more matches. XML comments get ignored, and any elements which dont match a template simply have their contents passed through until the next match occurs, or until plain text is encountered (and output).6
2. The book template outputs the \begin{document} and the \end{document} commands, and between them the apply-templates makes it carry on processing. 3. The para template just outputs its content, but follows it with a linebreak (using the hexadecimal character code x000A (see the ASCII chart in Table C.1).
6
Strictly speaking it isnt output at this stage: XML processors build a tree (a hierarchy) of elements in memory, and they only get serialised at the end of processing, into a stream of characters written to a le.
Formatting information
157
\documentclass{article}\usepackage{url}\begin{document} You can of course buy and install a fully-fledged commercial XML editor with XSLT support, and run this application within it. However, this is beyond the reach of many users, so to do this unaided you just need to install three pieces of software: \emph{Java}\footnote{\url{http://java.sun.com/j2se/1.4.2/download.html}}, \emph{Saxon}\footnote{\url{http://saxon.sourceforge.net}}, and the DocBook 4.2 DTD\footnote{\url{http://www.docbook.org/xml/4.2/index.html}} (URIs are correct at the time of writing). None of these has a visual interface: they are run from the command-line in the same way as is possible with \LaTeX. \end{document}
158
Formatting information
4. The ulink template outputs its content but follows it with a footnote using the \url command to output the value of the url attribute. 5. The emphasis template surrounds its content with \emph{ and }. This is a relatively trivial example, but it serves to show that its not hard to A output L TEX from XML. In fact there is a set of templates already written to A produce L TEX from a DocBook le at http://www.dpawson.co.uk/docbook/ tools.html#d4e2905
A 10.2 Converting out of LTEX
A This is much harder to do comprehensively. As noted earlier, the L TEX le A format really requires the L TEX program itself in order to process all the packages and macros, because there is no telling what complexities authors have added themselves (what a lot of this book is about!). Many authors and editors rely on custom-designed or homebrew converters, often written in the standard shell scripting languages (Unix shells, Perl, Python, Tcl, etc.). Although some of the packages presented here are also written in the same languages, they have some advantages and restrictions compared with private conversions:
Conversion done with the standard utilities (eg awk, tr, sed, grep, detex, etc.) can be faster for ad hoc translations, but it is easier to obtain A consistency and a more sophisticated nal product using LTEX2HTML or TEX4ht see below or one of the other systems available.
A Embedding additional non-standard control sequences in L TEX source code may make it harder to edit and maintain, and will denitely make it harder to port to another system.
Both the above methods (and others) provide a fast and reasonable A reliable way to get documents authored in L TEX onto the Web in an acceptable if not optimal format.
A A LTEX2HTML was written to solve the problem of getting L TEX-withmathematics onto the Web, in the days before MathML and mathA capable browsers. TEX4ht was written to turn L TEX documents into Web hypertext mathematics or not.
10.2.1
Conversion to Word
A There are several programs on CTAN to do L TEX-to-Word and similar A conversions, but they do not all handle everything L TEX can throw at them, A and some only handle a subset of the built-in commands of default L TEX.
Formatting information
159
Two in particular, however, have a good reputation, although I havent used either of them (I tend to stay as far away from Word as possible): latex2rtf by Wilfried Hennings, Fernando Dorner, and Andreas A Granzer translates L TEX into RTF the opposite of the rtf2latex2e mentioned earlier. RTF can be read by most wordprocessors, and this A program preserves layout and formatting for most L TEX documents using standard built-in commands. Kirill A Chikriis TEX2Word for Microsoft Windows is a converter plugA in for Word to let it open TEX and L TEX documents. The authors A company claims that virtually any existing TEX/L TEX package can be supported by TEX2Word because it is customisable. One easy route into wordprocessing, however, is the reverse of the A procedures suggested in the preceding section: convert L TEX to HTML, which many wordprocessors read easily. The following sections cover two packages for this. Once its in HTML, you could run it through Tidy to make it XHTML, add some embedded styling using Cascading Style Sheets (CSS), and rename the le to end in .doc, which can fool Word into opening it natively.
10.2.2
A LTEX2HTML
A As its name suggests, this is a system to convert L TEX structured documents to HTML. Its main task is to reproduce the document structure as a set A of interconnected HTML les. Despite using Perl, LTEX2HTML relies very heavily on standard Unix facilities like the NetPBM graphics package and the pipe syntax. Microsoft Windows is not well suited to this kind of composite processing, although all the required facilities are available for download in various forms and should in theory allow the package to run but reports of problems are common.
The sectional structure is preserved, and navigational links are generated for the standard Next, Previous, and Up directions. Links are also used for the cross-references, citations, footnotes, ToC, and lists of gures and tables. Conversion is direct for common elements like lists, quotes, paragraphbreaks, type-styles, etc., where there is an obvious HTML equivalent. Heavily formatted objects such as math and diagrams are converted to images. There is no support for homebrew macros. 160
Formatting information
There is, however, support for arbitrary hypertext links, symbolic crossreferences between evolving remote documents, conditional text, and the A inclusion of raw HTML. These are extensions to L TEX, implemented as new commands and environments. A LTEX2HTML outputs a directory named after the input lename, and all the output les are put in that directory, so the output is self-contained and can be uploaded to a server as it stands.
10.2.3
TEX4ht
A TEX4ht operates differently from LTEX2HTML: it uses the TEX program to process the le, and handles conversion in a set of postprocessors for the A common L TEX packages. It can also output to XML, including Text Encoding Initiative (TEI) and DocBook, and the OpenOfce and WordXML formats, and it can create TEXinfo format manuals. By default, documents retain the single-le structure implied by the original, but there is again a set of additional conguration directives to make use of the features of hypertext and navigation, and to split les for ease of use. This is a most powerful system, and probably the most exible way to do the job.
10.2.4
If you have the full version of Adobe Acrobat (or one of several other A commercial PDF products), you can open a PDF le created by pdfLTEX, select and copy all the text, and paste it into Word and some other wordprocessors, and retain some common formatting of headings, paragraphs, and lists. Both solutions still require the wordprocessor text to be edited into shape, but they preserve enough of the formatting to make it worthwhile for short documents. Otherwise, use the pdftotext program to extract everything from the PDF le as plain (paragraph-formatted) text.
10.2.5
A At worst, the detex program on CTAN will strip a L TEX le of all markup and leave just the raw unformatted text, which can then be re-edited. There are also programs to extract the raw text from DVI and PostScript (PS) les.
Formatting information
161
Generalized Markup Language (SGML), but the two projects were not A connected. However, TEX and L TEX have proved such useful tools for formatting SGML and more recently XML that many users chose this route for their output, using conversions written in the languages already mentioned in 10.2. Unfortunately, when the rise of the Web in the early 1990s popularised SGML using the HTML, browser writers deliberately chose to encourage authors to ignore the rules of SGML. Robust auto-converted formatting therefore became almost impossible except via the browsers low-quality print routines. It was not until 1997, when the XML was devised, that it again became possible to provide the structural and descriptive power of SGML but without the complex and rarely-used options which had made standard SGML so difcult to program for. XML is now becoming the principal system of markup. Because it is based on the international standard (SGML), it is not proprietary, so it has been implemented on most platforms, and there is lots of free software supporting it as well as many commercial packages. Like SGML, it is actually a meta-language to let you dene your own markup, so it is much more exible than HTML. Implementations of the companion Extensible Stylesheet Language (XSL) provide a direct route to PDF but at the expense A of reinventing most of the wheels which L TEX already possesses, so the A sibling XSLT can be used instead to translate to L TEX source code, as shown in the example in 10.1.1. This is usually much faster than writing your own formatting from scratch in XSL, and it means that you can A take full advantage of the packages and sophistication of L TEX. A similar system is used for the Linux Documentation Project, which uses SGML transformed by the Document Style Semantics and Specication Language (DSSSL) to TEX The source code of this book, available online at http://www.ctan.org/ tex-archive/info/beginlatex/src/ includes XSLT which does exactly this.
162
Formatting information
A
Formatting information
TEX systems run on a huge variety of platforms, and are typically made up of a very large number of very small les in several separate trees of directories (folders). This allows users to update parts of the system without having to update all of it, and to maintain their own tree of preferred les without having to have administrative rights on the computer. To make sure TEX nds the right le, it uses a technique borrowed from the Unix world, based on a simple hash index for each directory tree they need to look in. This is known as the ls-R database, from the Unix command (ls -R) which creates it. The program which does this for TEX is actually called after this command: mktexlsr, although it may be aliased as texhash or something else on your system. This is the program referred to in step 4 in the procedure on p. 67. However, to know where to make these indexes, and thus where to search, TEX needs to be told about them. You dont normally need to change the conguration, but sometimes you might want to move directories between disks to free up space or use faster equipment, which would mean changing the conguration. In a standard TEX installation this information is in the main (not the local) installation directory, in texmf/web2c/texmf.cnf. The le is similar to a Unix shell script, but the only lines of signicance for the search paths 163
are the following (this is how they appear in the default Unix installation, omitting the comments):
TEXMFMAIN = /usr/share/texmf TEXMFLOCAL = /usr/local/share/texmf HOMETEXMF = $HOME/texmf TEXMF = {$HOMETEXMF,!!$TEXMFLOCAL,!!$TEXMFMAIN} SYSTEXMF = $TEXMF VARTEXFONTS = /var/lib/texmf TEXMFDBS = $TEXMF;$VARTEXFONTS
This denes where the main TEX/ (texmf) directory is, where the local one is, and where the users personal (home) one is. It then denes the order in which they are searched, and makes this the system-wide list. A temporary directory for bitmap fonts is set up, and added to the list, dening the places in which texhash or mktexlsr creates its databases. In some installations, the local directory may be set up in /usr/ share/texmf-local or /usr/share/texmf.local instead of /usr/local/
A There is a program distributed in all LTEX installations called kpsewhich, a TEX-specic variant of the standard Unix which command. If you type the command followed by a lename, it will tell you whereabouts in your TEX installation it is.
$ kpsewhich article.cls /usr/share/texmf-texlive/tex/latex/base/article.cls
Better, there is an option to tell you where your main and local trees (directories) are inA stalled, and even where LTEX puts its map les and format les (internal setups):
$ kpsewhich --expand-var $TEXMFMAIN $ kpsewhich --expand-var $TEXMFLOCAL $ kpsewhich --expand-var $TEXMFSYSVAR
So if you forget where to put something you are installing, $TEXMFLOCAL is where it should go.
164
Formatting information
share/texmf or similar variations, so you would see this name used instead. Under Microsoft Windows, the names will be full paths such as C:\ProgramFiles\TeXLive\texmf or C:\ProgramFiles\MikTeX2.8\tex. On an Apple Mac, it is ~/Library/texmf for each user.
Formatting information
165
B
B.1
Formatting information
The TEX Users Group (TUG) was founded in 1980 for educational and scientic purposes: to provide an organization for those who have an interest in typography and font design, and are users of the TEX typesetting system invented by Donald Knuth. TUG is run by and for its members and represents the interests of TEX users worldwide. There are many regional and sectoral user groups organised on a geographic or language basis: see the list at http://www.tug.org/usergroups.html for details.
Members of TUG help to support and promote the use of TEX, , and related systems worldwide. All members receive TUGboat, the journal of the TEX Users Group, the TEX Live software distribution (a runnable TEX system), and the CTAN software distribution (containing most of the CTAN archive). In addition, TUG members vote in TUG elections, and receive discounts on annual meeting fees, store purchases, and TUG-sponsored courses. TUG membership (less benets) is tax-deductible, at least in the USA. See the TUG Web site for details. 167
B.2
Please see the forms and information at http://www.tug.org/join.html. You can join online, or by lling out a paper form. The NTG (Dutch) and UKTUG (United Kingdom) TEX user groups have joint membership agreements with TUG whereby you can receive a discount for joining both TUG and the local user group. To do this, please join via http: //www.ntg.nl/newmember.html (the NTG membership page) or http://uk. tug.org/Membership/ (the UKTUG page), respectively, and select the option for joint membership. Each years membership entitles you to the software and TUGboat produced for that year (even if it is produced in a subsequent calendar year, as is currently the case with TUGboat). You can order older issues of TUGboat and TEX memorabilia through the TUG store (http: //www.tug.org/store). The current (2011) TUG membership fee is $85 (US) per year for individuals and $55 for students, new graduates, seniors, and citizens of countries with modest economies. Add $10 to the membership fee after March 31 to cover additional shipping and processing costs. The current rate for non-voting subscription memberships (for libraries, for example) is $100. The current institutional rate is $500, which includes up to seven individual memberships.
B.3
Privacy
TUG uses your personal information only to mail you products, publications, notices, and (for voting members) ofcial ballots. Also, if you give explicit agreement, we may incorporate it into a membership directory which will be made available only to TUG members. TUG neither sells its membership list nor provides it to anyone outside of its own membership.
168
Formatting information
C
Formatting information
The American Standard Code for Information Interchange (ASCII) was invented in 1963, and after some redevelopment settled down in 1984 as standard X3.4 of American National Standards Institute (ANSI). It represents the 95 basic codes for the unaccented printable characters and punctuation of the Latin alphabet, plus 33 internal control characters originally intended for the control of computers, programs, and external devices like printers and screens. Many other character sets (strictly speaking, character repertoires) have been standardised for accented Latin characters and for all other non-Latin writing systems, but these are intended for representing the symbols people use when writing text on computers. Most programs and computers use ASCII internally for all their coding, the exceptions being XML-based languages like XSLT, which are inherently designed to be usable with any writing system, and a few specialist systems like APL. A Although the TEX and L TEX le formats can easily be used with many other encoding systems (see the discussion of the inputenc in 2.6), they are based on ASCII. It is therefore important to know where to nd all 95 of the printable characters, as some of them are not often used in other text-formatting systems. The following table shows all 128 characters, with their decimal, octal (base-8), and hexadecimal (base-16) code numbers. Decimal number values are under each character. The index numbers in the rst and last columns are for nding the octal (base-8) and hexadecimal (base-16) values respectively. Replace the arrow with the number or letter 169
from the top of the column (if the arrow points up) or from the bottom of the column(if the arrow points down). Example: The Escape character (ESC) is octal 033 (03 for the row, 3 for the number at the top of the column because the arrow points up) or hexadecimal "1B (1 for the row, B for the letter at the bottom of the column because the arrow points down).
170
Formatting information
Hex
00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17
NUL
0
SOH
1
STX
2
ETX
3
EOT
4
ENQ
5
ACK
6
BEL
7
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7
BS
8
HT
9
LF
10
VT
11
FF
12
CR
13
SO
14
SI
15
DLE
16
DC1
17
DC2
18
DC3
19
DC4
20
NAK
21
SYN
22
ETB
23
CAN
24
EM
25
SUB
26
ESC
27
FS
28
GS
29
RS
30
US
31
Space
32
!
33
"
34
#
35
$
36
%
37
&
38
39
(
40
)
41
*
42
+
43
,
44
45
.
46
/
47
0
48
1
49
2
50
3
51
4
52
5
53
6
54
7
55
8
56
9
57
:
58
;
59
<
60
=
61
>
62
?
63
@
64
A
65
B
66
C
67
D
68
E
69
F
70
G
71
H
72
I
73
J
74
K
75
L
76
M
77
N
78
O
79
P
80
Q
81
R
82
S
83
T
84
U
85
V
86
W
87
X
88
Y
89
Z
90
[
91
\
92
]
93
^
94
_
95
`
96
a
97
b
98
c
99
d
100
e
101
f
102
g
103
h
104
i
105
j
106
k
107
l
108
m
109
n
110
o
111
p
112
q
113
r
114
s
115
t
116
u
117
v
118
w
119
x
120
y
121
z
122
{
123
124
}
125
~
126
DEL
127
Formatting information
171
D
D.0 PREAMBLE
1
Copyright 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.1 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
publisher a way to get credit for their work, while not being considered responsible for modications made by others. This License is a kind of copyleft, which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for
The purpose of this License is to make a manual, textbook, or other functional and useful document free in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and
http://www.fsf.org/
Formatting information
173
D.1
This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The Document, below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as you. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A Modied Version of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modications and/or translated into another language. A Secondary Section is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Documents overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The Invariant Sections are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License.
If a section does not t the above denition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The Cover Texts are certain short passages of text that are listed, as FrontCover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a BackCover Text may be at most 25 words. A Transparent copy of the Document means a machine-readable copy, represented in a format whose specication is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent le format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modication by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not Transparent is called Opaque. Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, A LTEX input format, SGML or XML using a publicly available DTD, and standardconforming simple HTML, PostScript or PDF designed for human modication. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML
174
Formatting information
for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. The Title Page means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, Title Page means the text near the most prominent appearance of the works title, preceding the beginning of the body of the text. The publisher means any person or entity that distributes copies of the Document to the public. A section Entitled XYZ means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specic section name mentioned below, such as Acknowledgements, Dedications, Endorsements, or History.) To Preserve the Title of such a section when you modify the Document means that it remains a section Entitled XYZ according to this denition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License.
this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies.
D.2
VERBATIM COPYING
You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that
Formatting information
175
a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computernetwork location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.
nal publisher of that version gives permission. B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modications in the Modied Version, together with at least ve of the principal authors of the Document (all of its principal authors, if it has fewer than ve), unless they release you from this requirement. C. State on the Title page the name of the publisher of the Modied Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modications adjacent to the other copyright notices. F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modied Version under the terms of this License, in the form shown in the Addendum below. G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Documents license notice. H. Include an unaltered copy of this License. I. Preserve the section Entitled History, Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modied Version as given on the Title Page. If there is no section Entitled History in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modied Version as stated in the previous sentence.
D.4
MODIFICATIONS
You may copy and distribute a Modied Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modied Version under precisely this License, with the Modied Version lling the role of the Document, thus licensing distribution and modication of the Modied Version to whoever possesses a copy of it. In addition, you must do these things in the Modied Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the origi-
176
Formatting information
J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the History section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. K. For any section Entitled Acknowledgements or Dedications, Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. M. Delete any section Entitled Endorsements. Such a section may not be included in the Modied Version. N. Do not retitle any existing section to be Entitled Endorsements or to conict in title with any Invariant Section. O. Preserve claimers. any Warranty Dis-
sions license notice. These titles must be distinct from any other section titles. You may add a section Entitled Endorsements, provided it contains nothing but endorsements of your Modied Version by various parties for example, statements of peer review or that the text has been approved by an organization as the authoritative denition of a standard. You may add a passage of up to ve words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modied Version. Only one passage of Front-Cover Text and one of BackCover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modied Version.
If the Modied Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modied Ver-
Formatting information
177
tiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled History in the various original documents, forming one section Entitled History; likewise combine any sections Entitled Acknowledgements, and any sections Entitled Dedications. You must delete all sections Entitled Endorsements.
D.6
COLLECTIONS OF DOCUMENTS
on a volume of a storage or distribution medium, is called an aggregate if the copyright resulting from the compilation is not used to limit the legal rights of the compilations users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Documents Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate.
You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.
D.8
TRANSLATION
D.7
A compilation of the Document or its derivatives with other separate and independent documents or works, in or
Translation is considered a kind of modication, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled Acknowledgements, Dedications,
178
Formatting information
or History, the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title.
D.10
D.9
TERMINATION
You may not copy, modify, sublicense, or distribute the Document except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, or distribute it is void, and will automatically terminate your rights under this License. However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and nally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder noties you of the violation by some reasonable means, this is the rst time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, receipt of a copy of some or all of the same material does not give you any rights to use it.
2
The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See Copyleft2 . Each version of the License is given a distinguishing version number. If the Document species that a particular numbered version of this License or any later version applies to it, you have the option of following the terms and conditions either of that specied version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. If the Document species that a proxy can decide which future versions of this License can be used, that proxys public statement of acceptance of a version permanently authorizes you to choose that version for the Document.
D.11
RELICENSING
Massive Multiauthor Collaboration Site (or MMC Site) means any World Wide Web server that publishes copyrightable works and also provides prominent facilities for anybody to edit those works. A public wiki that anybody can edit is an example of such a server. A Massive Multiauthor Collaboration (or MMC) contained in the site means any set of copyrightable works thus published on the MMC site. CC-BY-SA means the Creative Commons Attribution-Share Alike 3.0 license published by Creative Commons Corpo-
http://www.gnu.org/copyleft/
Formatting information
179
ration, a not-for-prot corporation with a principal place of business in San Francisco, California, as well as future copyleft versions of that license published by that same organization. Incorporate means to publish or republish a Document, in whole or in part, as part of another Document. An MMC is eligible for relicensing if it is licensed under this License, and if all works that were rst published under this License somewhere other than this MMC, and subsequently incorporated in whole or in part into the MMC, (1) had no cover texts or invariant sections, and (2) were thus incorporated prior to November 1, 2008. The operator of an MMC Site may republish an MMC contained in the site under CC-BY-SA on the same site at any time before August 1, 2009, provided the MMC is eligible for relicensing.
ify this document under the terms of the GNU Free Documentation License, Version 1.3 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 the section entitled GNU Free Documentation License. If you have Invariant Sections, FrontCover Texts and Back-Cover Texts, replace the with. . . Texts. line with this: with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.
D.12
To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: Copyright YEAR YOUR NAME Permission is granted to copy, distribute and/or mod-
180
Formatting information
REFERENCES
References
1. Bull, RJ: Accounting in Business. London: Butterworths, 1972, ISBN 0406706514
A 2. Heller, Robert: New To L TEX. . . Unlearning Bad Habits. comp.text.tex, 11 March 2003, Nr. [email protected] (all pages) A 3. Lamport, Leslie: L TEX: A Document Preparation System. 2nd edition. Reading, MA: Addison-Wesley, 1994, ISBN 0201529831 A 4. Mittelbach, Frank et al.: The L TEX Companion. 2nd edition. Boston, MA: Addison-Wesley/Pearson Education, 2004, ISBN 0201362996
5. Ryder, John: Printing for Pleasure. London: Bodley Head, 1976, ISBN 0370104439
Formatting information
181
FORMATTING INFORMATION
Index
The same fonts are used here as in the text of the book (see About this book on p. xxi) to distinguish between different meanings:
Notation CTAN Meaning Acronyms (small caps in some typefaces)
A LTEX control sequences (monospace font)
\command
term product
Dening instance of a specialist term (bold italics) program or product name (italics)
A LTEX environment (sans-serif bold) A LTEX package (sans-serif; all available from CTAN)
environment
package options
variables
In the online version, the entries below are all hyperlinked to their source, with subsequent multiple occurrences giving the section number or name. Page or section numbers in bold type indicate a dening instance. Acrobat . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Special characters \( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Acrobat Reader. . . . . . . . .4, 5, 7, 48, 57 \) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Acronyms, dened \- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 AFM . . . . . . . . . . . . . . . . . . . . . . . . 131 \# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 AMS . . . . . . . . . . . . . . . . . . . . . . . . 121 \$ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 ANSI . . . . . . . . . . . . . . . . . . . . . . . . 169 \% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 ASCII . . . . . . . . . . . . . . . . . . . . . . . 169 \& . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 BMP. . . . . . . . . . . . . . . . . . . . . . . . . .86 \] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 CGI . . . . . . . . . . . . . . . . . . . . . . . . . . xix CLI. . . . . . . . . . . . . . . . . . . . . . . . . . .xix CM . . . . . . . . . . . . . . . . . . . . . . . . . 116 CMYK . . . . . . . . . . . . . . . . . . . . . . 129 11pt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 12pt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 CSS . . . . . . . . . . . . . . . . . . . . . . . . . 160 3B2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 CTAN . . . . . . . . . . . . . . . . . . . . . . . . 61 DEC . . . . . . . . . . . . . . . . . . . . . . . . . xiii DSSSL. . . . . . . . . . . . . . . . . . . . . . .162 A DTP . . . . . . . . . . . . . . . . . . . . . . . . . xiii a4paper . . . . . . . . . . . . . . . . . . . . . . . 34, 35 DVI . . . . . . . . . . . . . . . . . . . . . . . . . . 48 AbiWord . . . . . . . . . . . . . . . 152, 154, 155 ECDL . . . . . . . . . . . . . . . . . . . . . . . . xvi abstract .. . . . . . . . . . . . . . . . . . . . . 39, 40 EPS . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 \abstractname .. . . . . . . . . . . . . . . . . . . . 39 FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . 69 abstracts . . . . . . . . . . . . . . . . . . . . . . . . . . 37 FTP. . . . . . . . . . . . . . . . . . . . . . . . . . .61 accents. . . . . . . . . . . . . . . . . . . . . . . . . . . .20 182
Formatting information
INDEX
GIF . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 GNU . . . . . . . . . . . . . . . . . . . . . . . . . xiv GUI . . . . . . . . . . . . . . . . . . . . . . . . . . 49 HTML . . . . . . . . . . . . . . . . . . . . . . 152 HTTP. . . . . . . . . . . . . . . . . . . . . . . . .61 IEEETR. . . . . . . . . . . . . . . . . . . . . .104 JPG . . . . . . . . . . . . . . . . . . . . . . . . . . 86 NFSS . . . . . . . . . . . . . . . . . . . . . . . . 130 NTS. . . . . . . . . . . . . . . . . . . . . . . . . .xiv PCL. . . . . . . . . . . . . . . . . . . . . . . . . . .86 PDA . . . . . . . . . . . . . . . . . . . . . . . . . . xv PDF . . . . . . . . . . . . . . . . . . . . . . . . . . 57 PFA . . . . . . . . . . . . . . . . . . . . . . . . . 131 PFB . . . . . . . . . . . . . . . . . . . . . . . . . 131 PNG . . . . . . . . . . . . . . . . . . . . . . . . . . 86 PS. . . . . . . . . . . . . . . . . . . . . . . . . . .161 RGB. . . . . . . . . . . . . . . . . . . . . . . . .129 RIS. . . . . . . . . . . . . . . . . . . . . . . . . .106 RTF . . . . . . . . . . . . . . . . . . . . . . . . . 153 SGML . . . . . . . . . . . . . . . . . . . . . . . 162 SVG . . . . . . . . . . . . . . . . . . . . . . . . 128 TDS . . . . . . . . . . . . . . . . . . . . . . . . . . 68 TEI. . . . . . . . . . . . . . . . . . . . . . . . . .161 TIFF . . . . . . . . . . . . . . . . . . . . . . . . . . 89 TUG . . . . . . . . . . . . . . . . . . . . . . . . 167 URI. . . . . . . . . . . . . . . . . . . . . . . . . . .90 URL . . . . . . . . . . . . . . . . . . . . . . . . . . 90 WYSIWYG . . . . . . . . . . . . . . . . . . . xx XHTML . . . . . . . . . . . . . . . . . . . . . 153 XML . . . . . . . . . . . . . . . . . . . . . . . . 152 XSL . . . . . . . . . . . . . . . . . . . . . . . . . 162 XSLT . . . . . . . . . . . . . . . . . . . . . . . . 153 \addcontentsline . . . . . . . . . . . . . . . . . 45 \addtocontents .. . . . . . . . . . . . . . . . . . . 45 \affiliation .. . . . . . . . . . . . . . . . . . . . . 37 AFM. . . . . . . . . . . . . . . . . . . . . . . . . . . . .131 afm2tfm . . . . . . . . . . . . . . . . . . . . 133, 136 agsm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 alpha . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 AMS. . . . . . . . . . . . . . . . . . . . . . . . . . . . .121 ANSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 apacite . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 Apple Mac . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Formatting information
apsr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104 apt . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii, 2 \arabic . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 ArcInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 arguments . . . . . . . . . . . . . . . . . . . . . . . 16 array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 \arraystretch .. . . . . . . . . . . . . . . . . . . . 82 article . . . . . . . . . . . . . . . . . . . . . . . . . 32, 33 ASCII. . . .xvi, 22, 29, 55, 87, 91, 130, 157, 169, 169 \author .. . . . . . . . . . . . . . . . . . 37, 99, 142 AutoCAD . . . . . . . . . . . . . . . . . . . . . . . . . . 88 avant . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
backslash . . . . . . . . . . . . . . . . . . . . . . . . 14 backtick . . . . . . . . . . . . . . . . . . . . . . . . . . 90 badness . . . . . . . . . . . . . . . . . . . . . . . . . . 54 BaKoMa TEX . . . . . . . . . . . . . . . . . . . . . . .xx BaKoMa . . . . . . . . . . . . . . . . . . . . . . . . . xxi \baselineskip . . . . . . . . . . . . . . . . . . 114 \baselinestretch .. . . . . . . . . . . . . . . 114 bbding . . . . . . . . . . . . . . . . . . . . . . . 74, 149 beer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 lite . . . . . . . . . . . . . . . . . . . . . . . . . . 108 American . . . . . . . . . . . . . . . . . 108 \begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Berger, Jens. . . . . . . . . . . . . . . . . . . . . .108 Berry, Karl. . . . . . . . . .1, 132, 134, 135 \bfseries . . . . . . . . . . . . . . . . . . . . . . . . 123 biblatex . . . . . . . . . . . . . . . . . . . . . . . . . . 102 bibliographies . . . . . . . . . . . . . . . . . . . 102 \bibliography.. . . . . . . . . . . . . . . . . . .103 \bibliographystyle . . . . . . . . 103, 104 \bibname . . . . . . . . . . . . . . . . . . . . . . . . . 106 bibtex . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 bibunits . . . . . . . . . . . . . . . . . . . . . . . . . . 104 \bigskip . . . . . . . . . . . . . . . . . . . . . . . . . 113 BMP . . . . . . . . . . . . . . . . . . . . . . . . . . 86, 89 book . . . . . . . . . . . . . . . . . . . . . . . . . . 32, 41 bookman . . . . . . . . . . . . . . . . . . . .118, 120 183
FORMATTING INFORMATION
Capacity exceeded . . . . . . . . . . . . . . . . .53 \caption . . . . . . . . . . . . . . . . . . . . . .80, 101 cc (Ciceros) . . . . . . . . . . . . . . . . . . . . . . . .24 ccr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .118 cd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 CD-ROM . . . . . . . . . . . . . . . . . . . . . . . . 152 center . . . . . . . . . . . . . . . 27, 82, 83, 122 \centering . . . . . . . . . . . . . . . 27, 82, 122 cep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 CGI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix \chapter . . . . . . . . . . . . . . . . . . . . . . . 41, 42 chapter . . . . . . . . . . . . . . . . . . . . . . . . 147 chapterbib . . . . . . . . . . . . . . . . . . . . . . . .104 charmap . . . . . . . . . . . . . . . . . . . . . . . . . . 22 charter . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Chassell, Bob . . . . . . . . . . . . . . . . . . . . . xiv ChemDraw . . . . . . . . . . . . . . . . . . . . . . . . 88 Chikrii, Kirill A . . . . . . . . . . . . . . . . . . 160 Chocolate Stout . . . . . . . . . . . . . . . . . 109 Chocolate Stout . . . . . . . . . . . . . . . . . . 109 \cite . . . . . . . . . . . . . . . . . . . . . . . . 103, 104 \citequote . . . . . . . . . . . . . . . . . . . . . . . . 98 \clearpage . . . . . . . . . . . . . . . . . . . . . . . xxii CLI . . . . . . . . . . . . . . . . . . . . . . . xii, xix, xix \cline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 CM . . . . . . . . . . . . . . . . . . . 116, 117, 138 cm (centimeters) . . . . . . . . . . . . . . . . . . 24 CMYK . . . . . . . . . . . . . . . . . . . . . . 128, 129 \color . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 color names . . . . . . . . . . . . . . . . . . . . .128 \colorbox . . . . . . . . . . . . . . . . . . . . . . . . 129 colortbl . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 colour . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 columns . . . . . . . . . . . . . . . . . . . . . . . . . 110 \columnsep .. . . . . . . . . . . . . . . . . . . . . . 110 \command . . . . . . . . . . . . . . . . . . . . xxii, 182 Commands \( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 184
\) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 \- . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 \# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 \$ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 \% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 \& . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 \] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 \abstractname . . . . . . . . . . . . . . . . 39 \addcontentsline .. . . . . . . . . . . . 45 \addtocontents .. . . . . . . . . . . . . . 45 \affiliation.. . . . . . . . . . . . . . . . .37 \arabic . . . . . . . . . . . . . . . . . . . . . . 148 \arraystretch . . . . . . . . . . . . . . . . 82 \author . . . . . . . . . . . . . . 37, 99, 142 \baselinestretch . . . . . . . . . . . 114 \begin . . . . . . . . . . . . . . . . . . . . . . . . . 36 \bfseries .. . . . . . . . . . . . . . . . . . . 123 \bibliography .. . . . . . . . . . . . . . 103 \bibliographystyle .. . . 103, 104 \bibname . . . . . . . . . . . . . . . . . . . . . 106 \bigskip . . . . . . . . . . . . . . . . . . . . . 113 \caption . . . . . . . . . . . . . . . . . 80, 101 \centering .. . . . . . . . . . 27, 82, 122 \chapter . . . . . . . . . . . . . . . . . . 41, 42 \cite . . . . . . . . . . . . . . . . . . . 103, 104 \citequote .. . . . . . . . . . . . . . . . . . . 98 \clearpage .. . . . . . . . . . . . . . . . . . xxii \cline . . . . . . . . . . . . . . . . . . . . . . . . . 82 \color . . . . . . . . . . . . . . . . . . . . . . . 128 \colorbox .. . . . . . . . . . . . . . . . . . . 129 \columnsep.. . . . . . . . . . . . . . . . . .110 \command . . . . . . . . . . . . . . . . xxii, 182 \date . . . . . . . . . . . . . 37, 52, 53, 142 \datesubmitted .. . . . . . . . . . . . . . 37 \DeclareFontFamily .. . . . . . . . 137 \DeclareFontShape .. . . . 137, 138 \def . . . . . . . . . . . . . . . . . . . . . . . . . . 146 \definecolor .. . . . . . . . . . 128, 129 \documentclass .. . . . . . . . . . 32, 40 \dvips . . . . . . . . . . . . . . . . . . . . . . . . . 90 \ef . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 \emph. . . . . . . . . . . . . . . . . . . . . . . . .127 \end . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Formatting information
INDEX
\enspace . . . . . . . . . . . . . . . . . . . . . 114 \EUR . . . . . . . . . . . . . . . . . . . . . . . 19, 81 \fancyhead.. . . . . . . . . . . . . . . . . .116 \fbox . . . . . . . . . . . . . . . . . 93, 96, 129 \flushleft.. . . . . . . . . . . . . . . . . .122 \flushright . . . . . . . . . . . . . . . . . 122 \fnsymbol .. . . . . . . . . . . . . . . . . . . 100 \fontencoding .. . . . . . . . . . . . . . 121 \fontfamily . . . . . . . . . . . . . . . . . 121 \fontsize. . . . . . . . . . . . . . .125, 126 \footnote . . . . . . . . . . . . xxii, 98, 99 \footnotesize .. . . . . . . . . . . . . . 125 \foreign . . . . . . . . . . . . . . . . . . . . . 127 \glossary .. . . . . . . . . . . . . . . . . . . 109 \graphicspath . . . . . . . . . . . . . . . . 89 \hline . . . . . . . . . . . . . . . . . . . . . . . . . 82 \hrule . . . . . . . . . . . . . . . . . . . . . . . 143 \hspace . . . . . . . . . . . . . . . . . . . . . . 114 \Huge. . . . . . . . . . . . . . . . . . . . . . . . .125 \huge. . . . . . . . . . . . . . . . . . . . . . . . .125 \hyphenation.. . . . . . . . . . . . . . . . .25 \i . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 \includegraphics .. . . . 8487, 89 \index . . . . . . . . . . . . . 108, 109, 146 \item . . . . . . . . . . . . . . . . . . . . . . . . . . 73 \itshape . . . . . . . . . . . . . . . . . . . . . 123 \label . . . . . . . . . . 76, 80, 101, 102 \LARGE . . . . . . . . . . . . . . . . . . . . . . . 125 \Large . . . . . . . . . . . . . . . . . . . . . . . 125 \large . . . . . . . . . . . . . . . . . . . . . . . 125 \LaTeX . . . . . . . . . . . . . . . . . . . . . . . 155 \leftmark .. . . . . . . . . . . . . . . . . . . 116 \linebreak.. . . . . . . . . . . . . . . . . .145 \listoffigures .. . . . . . . . . . . . . . 45 \listoftables . . . . . . . . . . . . . . . . 45 \makeatletter .. . . . . . . . . . . . . . 143 \makeatother .. . . . . . . . . . . . . . . 143 \makeglossary .. . . . . . . . . . . . . . 109 \makeindex.. . . . . . . . . . . . . . . . . .108 \maketitle .. . . 37, 39, 40, 53, 63, 142, 143 \markboth .. . . . . . . . . . . . . . . . . . . 115 \markright.. . . . . . . . . . . . . . . . . .115
Formatting information
\mbox . . . . . . . . . . . . . . . . . . . . .26, 145 \medskip .. . . . . . . . . . . . . . . . . . . . 113 \multicolumn.. . . . . . . . . . . . . . . . .83 \newcommand .. . . . . . . . . . . 142, 146 \newgeometry .. . . . . . . . . . . . . . . 112 \normalsize . . . . . . . . . . . . . . . . . 125 \ovalbox . . . . . . . . . . . . . . . . . . . . . . 96 \P . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 \pageref .. . . . . . . . . . . . . . . . . . . . 102 \pagestyle . . . . . . . . . . . . . 115, 116 \par . . . . . . 83, 113, 122, 125, 143 \paragraph .. . . . . . . . . . . . . . . 41, 76 \parbox . . . . . . . . . . . . . . . . . . . .92, 93 \part . . . . . . . . . . . . . . . . . . . . . . . . . . 41 \part* . . . . . . . . . . . . . . . . . . . . . . . . .43 \person .. . . . . . . . . . . . . . . . 145147 \printindex . . . . . . . . . . . . . . . . . 109 \product . . . . . . . . . . 122, 127, 144 \protect . . . . . . . . . . . . . . . . . . . . . . 99 \ProvidesPackage . . . . . . . . . . . 136 \qquad . . . . . . . . . . . . . . . . . . . . . . . 114 \quad . . . . . . . . . . . . . . . . . . . . .25, 114 \raggedleft .. . . . . . . . . . . . . . . . . . 27 \raggedright .. . . . . . . . . 27, 92, 94 \raisebox .. . . . . . . . . . . . . . . . . . . 149 \ref . . . . . . . . . . . . . . . . .76, 101, 102 \refname .. . . . . . . . . . . . . . . . . . . . 106 \reindex .. . . . . . . . . . . . . . . 145, 146 \renewcommand .. . 39, 40, 82, 143, 147 \rightmark.. . . . . . . . . . . . . . . . . .116 \rmdefault.. . . . . . . . . . . . . . . . . .136 \S . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 \scriptsize . . . . . . . . . . . . . . . . . 125 \scshape .. . . . . . . . . . . . . . . . . . . . 123 \section . . . . . . . . . . . . . . . . . . 41, 44 \selectfont .. . . . . . . . . . . 121, 123 \sentinel .. . . . . . . . . . . . . . . . . . . 146 \setcounter .. . . . . . . . . . . . . . . . . . 42 \setlength .. . . . . . . . . . . 43, 44, 93 \sfdefault.. . . . . . . . . . . . . . . . . .136 \sffamily.. . . . . . . . . . . . . .123, 143 \shadowbox .. . . . . . . . . . . . . . 96, 146 185
FORMATTING INFORMATION
\slshape . . . . . . . . . . . . . . . . . . . . . 123 \small . . . . . . . . . . . . . . . . . . . 97, 125 \smallskip.. . . . . . . . . . . . . . . . . .113 \space . . . . . . . . . . . . . . . . . . . . . . . 147 \subparagraph . . . . . . . . . . . . 41, 76 \subparagraph* .. . . . . . . . . . . . . . 43 \subsection .. . . . . . . . . . . . . . . . . . 41 \subsubsection .. . . . . . . . . . . . . . 41 \tableofcontents .. . . . 16, 45, 51 \textbackslash .. . . . . . . . . . . . . . 18 \textbrokenbar .. . . . . . . . . . . . . . 28 \textbullet .. . . . . . . . . . . . . . . . . . 74 \textcolor . . . . . . . . . . . . . 128, 129 \texteuro .. . . . . . . . . . . . . . . . . . . . 19 \textit . . . . . . . . . . . . . . . . . . . . . . 127 \textlangle .. . . . . . . . . . . . . . . . . . 28 \textrangle .. . . . . . . . . . . . . . . . . . 28 \textsterling . . . . . . . . . . . . . . . . 19 \textsuperscript . . . . . . . . . . . 126 \texttrademark .. . . . . . . . . . . . . 144 \thechapter . . . . . . . . . . . . . . . . . 147 \theenumi .. . . . . . . . . . . . . . . . . . . . 78 \theenumii .. . . . . . . . . . . . . . . . . . . 78 \theenumiii .. . . . . . . . . . . . . . . . . . 78 \theenumiv .. . . . . . . . . . . . . . . . . . . 78 \TheSbox . . . . . . . . . . . . . . . . . . . . . 146 \thinspace .. . . . . . . . . . . . . . 20, 114 \thispagestyle .. . . . . . . . . . . . . 115 \tiny. . . . . . . . . . . . . . . . . . . . . . . . .125 \title. . . . . . . . . . . . . . . .37, 99, 142 \tmproduct.. . . . . . . . . . . . . . . . . .144 \ttdefault.. . . . . . . . . . . . . . . . . .136 \ttfamily .. . . . . . . . . . . . . . . . . . . 123 \uline . . . . . . . . . . . . . . . . . . . . . . . 124 \upshape . . . . . . . . . . . . . . . . . . . . . 123 \url . . . . . . . . . . . . . . 91, 92, 99, 159 \usepackage 54, 62, 63, 107, 128, 131 \vbox . . . . . . . . . . . . . . . . . . . . . . . . . . 93 \verb . . . . . . . . . . . . . . 19, 9092, 98 \VerbatimFootnotes . . . . . . . . . . 98 \vspace . . . . . . . . . . . . . . . . . 113, 114 \vspace* . . . . . . . . . . . . . . . . . . . . . 113 186
Unix commands cd . . . . . . . . . . . . . . . . . . . . . . . . . . 49 dvips . . . . . . . . . . . . . . . . . . . . . . . . 3 latex . . . . . . . . . . . . . . . . . . . . 3, 49 ls . . . . . . . . . . . . . . . . . . . . . . . . .163 man . . . . . . . . . . . . . . . . . . . . . . . 109 mkdir . . . . . . . . . . . . . . . . . . . . . 134 pdflatex .. . . . . . . . . . . . . . . . . . 49 sudo . . . . . . . . . . . . . . . . . . . . . . 2, 3 texconfig .. . . . . . . . . . . . . . . . . . 3 texdoc . . . . . . . . . . . . . . . . . . . . . 63 comment character . . . . . . . . . . . . . . 18 commercial implementations . . . . . xx commutative. . . . . . . . . . . . . . . . . . . .123 congure . . . . . . . . . . . . . . . . . . . . . . . . . . 67 consistency . . . . . . . . . . . . . . . . . . . . . . . 31 Cont . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xiii counter . . . . . . . . . . . . . . . . . . . . . . . . xxii Counters chapter . . . . . . . . . . . . . . . . . . . 147 counter . . . . . . . . . . . . . . . . . . . .xxii enumi . . . . . . . . . . . . . . . . . . . . . . . 78 enumii . . . . . . . . . . . . . . . . . . . . . . 78 enumiii . . . . . . . . . . . . . . . . . . . . . 78 enumiv . . . . . . . . . . . . . . . . . . . . . . 78 example . . . . . . . . . . . . . . . . . . . . . 78 secnumdepth . . . . . . . . . . . . 42, 43 section . . . . . . . . . xxii, 147, 148 tocdepth . . . . . . . . . . . . . . . .42, 45 variables . . . . . . . . . . . . . . . . . 182 courier . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 Crayola . . . . . . . . . . . . . . . . . . . . . . . xi, 128 cross-references . . . . . . . . . . . . . . . . . 100 CSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 CTAN . ix, xii, xvii, xviii, xxii, 1, 8, 33, 59, 61, 61, 62, 64, 69, 87, 103, 107, 109, 117, 130, 153, 159, 161, 167, 182 curly braces . . . . . . . . . . . . . . . . . . . . . . 17 Cygwin . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
datatool . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Formatting information
INDEX
\date . . . . . . . . . . . . . . . . . 37, 52, 53, 142 \datesubmitted .. . . . . . . . . . . . . . . . . . . 37 dcolumn . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 dcu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 dd (Didot points) . . . . . . . . . . . . . . . . . . 24 DEC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii \DeclareFontFamily.. . . . . . . . . . . . .137 \DeclareFontShape.. . . . . . . . .137, 138 \def . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 \definecolor . . . . . . . . . . . . . . . 128, 129 description .. . . . . . . . . . . . . . . . . . . . . 75 detex. . . . . . . . . . . . . . . . . . . . . . . . . . . . .161 dimension . . . . . . . . . . . . . . . . . . . . . . . . 24 dimension . . . . . . . . . . . . . . . . . . . . . . . . 43 dimensions . . . . . . . . . . . . . . . . . . . . . . . 22 DOC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 DocBook . . . . . . . . . . . . . . . . . . . . . . . . . . xxi document . . . . . . . . . . . . . . . . . xvii, 36, 40 document class . . . . . . . . . . . . . . . . . . . 32 \documentclass .. . . . . . . . . . . . . . . 32, 40 Dorner, Fernando . . . . . . . . . . . . . . . . 160 double-spacing . . . . . . . . . . . . . . . . . . 113 draft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Draw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .88 DSSSL . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 DTP . . . . . . . . . . . . . . . . . xii, xiii, 78, 117 DuBois, Paul . . . . . . . . . . . . . . . . . . . . . 153 DVD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 DVI . . . xii, xiii, 48, 49, 5557, 63, 64, 89, 92, 161 dvialw . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 dvieps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 dvihp. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 dvips . . . 5658, 86, 87, 89, 128, 135, 139 \dvips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 dvips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 dviview . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 DynaTag . . . . . . . . . . . . . . . . . . . . . . . . . 153
eiad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .118 element. . . . . . . . . . . . . . . . . . . . . . . . . . .31 elsevier . . . . . . . . . . . . . . . . . . . . . . . . . . .107 em (relative measure) . . . . . . . . . . . . . 24 Emacs . . . xix, 2, 7, 20, 48, 50, 51, 58, 82, 105 \emph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 empty . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 \end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 EndNote . . . . . . . . . . . . . . . . . . . . . . . . . 106 endnote . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 \enspace . . . . . . . . . . . . . . . . . . . . . . . . . 114 enumerate . . . . . . . . . . . . . . . . . . . . . . . . 74 enumerate* . . . . . . . . . . . . . . . . . . . . . . . 74 enumi . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 enumii . . . . . . . . . . . . . . . . . . . . . . . . . . 78 enumiii . . . . . . . . . . . . . . . . . . . . . . . . . 78 enumiv . . . . . . . . . . . . . . . . . . . . . . . . . . 78 environment . . . . . . . . . . . . . . . . . . . . . . 73 environment . . . . . . . . . . . . . . . . . . . . . 36 environment .. . . . . . . . . . . . . . .xxii, 182 Environments abstract .. . . . . . . . . . . . . . . . 39, 40 center . . . . . . . . . . 27, 82, 83, 122 description.. . . . . . . . . . . . . . . . .75 document .. . . . . . . . . . . xvii, 36, 40 enumerate .. . . . . . . . . . . . . . . . . . . 74 enumerate* .. . . . . . . . . . . . . . . . . . 74 environment .. . . . . . . . . . xxii, 182 equation .. . . . . . . . . . . . . . . . . . . . 29 figure . . . . . . . . . . . . . . . . . . . . . . . 84 figure* .. . . . . . . . . . . . . . . . . . . . 110 flushleft . . . . . . . . . 83, 122, 143 flushright . . . . . . . . . . . . . 83, 122 inparaenum .. . . . . . . . . . . . . . . . . . 75 itemize . . . . . . . . . . . . . . . . . . . . . . 73 itemize* .. . . . . . . . . . . . . . . . . . . . 74 minipage .. . . . . . . 93, 96, 99, 146 multicols.. . . . . . . . . . . . . . . . . .110 multirow .. . . . . . . . . . . . . . . . . . . . 83 picture . . . . . . . . . . . . . . . . . . . . . . 85 E quotation .. . . . . . . . . . . . . . xxii, 98 ECDL. . . . . . . . . . . . . . . . . . . . . . . . .xvi, xvi quote . . . . . . . . . . . . . . . . . . . . . . . . .98 \ef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Formatting information
187
FORMATTING INFORMATION
raggedleft .. . . . . . . . . . . . . . . . . . 27 raggedright.. . . . . . . . . . . . . . . . .27 Sbox . . . . . . . . . . . . . . . . . . . . .96, 146 table . . . . . . . . . . . . . . . . . . . . . 80, 84 table* . . . . . . . . . . . . . . . . . . . . . . 110 tabular.. . . . . . . . . . . . . .80, 83, 93 Verbatim . . . . . . . . . . . . . . . . . 91, 92 verbatim . . . . . . . . . . . . . . . . . 91, 92 EPS. . . . . . . . . . . . . . . . . . . .86, 86, 8789 epsf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 equation .. . . . . . . . . . . . . . . . . . . . . . . . .29 Error messages File not found . . . . . . . . . . . . . . . . 54 Overfull hbox . . . . . . . . . . . . . . . . 54 Runaway argument . . . . . . . . . . 53 Too many }s . . . . . . . . . . . . . . . . . 52 Undened control sequence . . 52 Underfull hbox . . . . . . . . . . . . . . . 53 Esser, Thomas . . . . . . . . . . . . . . . . . . . . . . 1 \EUR . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19, 81 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 EuroMath . . . . . . . . . . . . . . . . . . . . . . . . 152 ex (relative measure) . . . . . . . . . . . . . . 24 example . . . . . . . . . . . . . . . . . . . . . . . . . 78 extarticle . . . . . . . . . . . . . . . . . . . . . . . . . . 35 extbook . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 extreport . . . . . . . . . . . . . . . . . . . . . . . . . . 35 extsizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
\fancyhead .. . . . . . . . . . . . . . . . . . . . . . 116 fancyvrb . . . . . . . . . . . . . . . . . . . . . . . 91, 98 FAQ . . . . . . . . . . . . . . . . . . . . ix, 61, 69, 69 \fbox . . . . . . . . . . . . . . . . . . . . . 93, 96, 129 \fboxrule . . . . . . . . . . . . . . . . . . . . . . . . 94 \fboxsep . . . . . . . . . . . . . . . . . . . . . . . . . 94 Feuerstack, Thomas . . . . . . . . . . . . . . . . 1 figure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 figure* . . . . . . . . . . . . . . . . . . . . . . . . . 110 gures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 File not found . . . . . . . . . . . . . . . . . . . . . 54 188
lenames . . . . . . . . . . . . . . . . . . . . . . . . . 47 Fine, Jonathan . . . . . . . . . . . . . . . . . . . . xx x-cm . . . . . . . . . . . . . . . . . . . . . . 125, 126 oat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80 oats. . . . . . . . . . . . . . . . . . . . . . . . . .79, 84 \flushleft .. . . . . . . . . . . . . . . . . . . . . . 122 flushleft .. . . . . . . . . . . . . 83, 122, 143 \flushright .. . . . . . . . . . . . . . . . . . . . . 122 flushright .. . . . . . . . . . . . . . . . . 83, 122 fnpara . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 \fnsymbol . . . . . . . . . . . . . . . . . . . . . . . . 100 font denition . . . . . . . . . . . . . . . . . . 137 font family . . . . . . . . . . . . . . . . . . . . . 123 font series. . . . . . . . . . . . . . . . . . . . . . .123 font shape . . . . . . . . . . . . . . . . . . . . . . 123 fontenc . . . . . . . . . . . . . . . . . . . . . . 22, 136 \fontencoding.. . . . . . . . . . . . . . . . . . .121 \fontfamily .. . . . . . . . . . . . . . . . . . . . . 121 FontForge . . . . . . . . . . . . . . . . . . . . . . . . 131 fontname . . . . . . . . . . . . . . . . . . . . . . . . 132 fontname . . . . . . . . . . . . . . . . . . . 137, 138 fonts . . . . . . . . . . . . . . . . . .116 changing temporarily. . . . . . .121 changing the default . . . . . . . . 120 colour. . . . . . . . . . . . . . . . . . . . . . .128 Computer Modern . . . . . . . . . . 116 encoding . . . . . . . . . . . . . . . . . . . . 133 families . . . . . . . . . . . . . . . . . . . . . 120 in general . . . . . . . . . . . . . . . . . . . 116 installing . . . . . . . . . . . . . . . . . . . 129 . . . . . . . . . . . . . . . . . .117 PostScript . . . . . . . . . . . . . . 117, 131 sizes. . . . . . . . . . . . . . . . . . . . .34, 124 styles . . . . . . . . . . . . . . . . . . . . . . . 123 TrueType . . . . . . . . . . . . . . . . . . . . 117 Type 1 . . . . . . . . . . . . . . . . . . . . . . .117 \fontsize .. . . . . . . . . . . . . . . . . . 125, 126 footmisc . . . . . . . . . . . . . . . . . . . . . . . . . .xxii \footnote .. . . . . . . . . . . . . . . . xxii, 98, 99 footnotes . . . . . . . . . . . . . . . . . . . . . . . . . 98 \footnotesize.. . . . . . . . . . . . . . . . . . .125 \foreign . . . . . . . . . . . . . . . . . . . . . . . . . 127
Formatting information
INDEX
Foxit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 HTML . . . . ii, xxi, 12, 32, 44, 78, 152, 153, 156, 160162 FrameMaker . . . . . . . . . . . . . . . . . . . . . 152 FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 HTML Tidy . . . . . . . . . . . . . . . . . . . . . . .153 full . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 HTTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 \Huge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 \huge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 G geometry . . . . . . . .34, 63, 64, 100, 112 hyphenation . . . . . . . . . . . . . . . . . . . . . . 22 GhostScript . . . . . . . . . . . . . . . . . . . . . . 1, 5 \hyphenation .. . . . . . . . . . . . . . . . . . . . . 25 Ghostscript . . . . . . . . . . . . . . .57, 59, 119 hyphens discretionary . . . . . . . . . . . . . . . . . 25 GIF. . . . . . . . . . . . . . . . . . . . . . . . . . . .86, 88 soft . . . . . . . . . . . . . . . . . . . . . . . . . . .25 GIMP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .88 glossaries . . . . . . . . . . . . . . . . . . . . . . . . 108 \glossary . . . . . . . . . . . . . . . . . . . . . . . . 109 I GNU . . . . . . . . . . . . . . . . . . . . . . . . xiv, xxii \i . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 GNUplot . . . . . . . . . . . . . . . . . . . . . . . . . . 88 IBM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi Granzer, Andreas . . . . . . . . . . . . . . . . 160 IEEETR . . . . . . . . . . . . . . . . . . . . . . . . . . 104 graphics . . . . . . . . . . . . . . . . . . . . . . . . . . 85 ieeetr. . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Illustrator . . . . . . . . . . . . . . . . . . . . . . . . . 88 \graphicspath .. . . . . . . . . . . . . . . . . . . . 89 ImageMagick . . . . . . . . . . . . . . . . . . . . . . 87 images . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 graphicx . . . . . . . . . . . . . . . . . . . . . . . 85, 87 grave accent . . . . . . . . . . . . . . . . . . . . . 90 in (inches). . . . . . . . . . . . . . . . . . . . . . . . .24 Gregorio, Enrico . . . . . . . . . . . . . . . . . . 86 \includegraphics.. . . . . . . . .8487, 89 group . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 \index . . . . . . . . . . . . . . . . . 108, 109, 146 grouping . . . . . . . . . . . . . . . . . . . . . . . . 122 indexes . . . . . . . . . . . . . . . . . . . . . . . . . . 108 GSView . . . . . . . . . . . . . . . . . . . . . . . xviii, 1 InkScape . . . . . . . . . . . . . . . . . . . . . . . . . . 88 GSview . . . . . . . . . . . . 5, 48, 57, 58, 119 Inline lists . . . . . . . . . . . . . . . . . . . . . . . 77 GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi, 49 inparaenum . . . . . . . . . . . . . . . . . . . . . . . 75 inputenc . . . . . . . . . . . . . .21, 22, 29, 169 Instant Preview . . . . . . . . . . . . . . . . . . . .xx H \item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Hagen, Hans . . . . . . . . . . . . . . . . . . . . . xiii itemize .. . . . . . . . . . . . . . . . . . . . . . . . . . 73 har2nat . . . . . . . . . . . . . . . . . . . . . . . . . . 104 itemize* .. . . . . . . . . . . . . . . . . . . . . . . . .74 hard space . . . . . . . . . . . . . . . . . . . . . . . . 26 \itshape . . . . . . . . . . . . . . . . . . . . . . . . . 123 harvard . . . . . . . . . . . . . . . . . . . . . . . . . . 107 harvard . . . . . . . . . . . . . . . . . . . . . . . . . . .104 J hash mark . . . . . . . . . . . . . . . . . . . . . . . 19 Jrgensen, Palle . . . . . . . . . . . . . . . . . 119 headings . . . . . . . . . . . . . . . . . . . . . . . . . 115 JabRef . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Java . . . . . . . . . . . . . . . . . . . . . . . . . xxi, 154 helvet . . . . . . . . . . . . . . . . . . . . . . 118, 120 JPG . . . . . . . . . . . . . . . . . . . 86, 86, 88, 89 Hennings, Wilfried . . . . . . . . . . . . . . 160 jurabib . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 H&J . . . see hyphenation, justication justication . . . . . . . . . . . . . . . . . . . . . . . 22 \hline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 \hrule . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 K \hspace . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 Kastrup, David . . . . . . . . . . . . . . . . . . . . xx
Formatting information
189
FORMATTING INFORMATION
Kay, Michael . . . . . . . . . . . . . . . . . . . . . xxi kdvi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3, 7 Kew, Jonathan . . . . . . . . . . . . . . xiii, 117 Kile . . . . . . . . . . . . xiii, xix, 2, 7, 15, 104 kluwer . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 kluwer . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 Knuth, Donald. . . . . . . . . .xii, 145, 167 komascript . . . . . . . . . . . . . . . . . . . . . 32, 33 kpdf . . . . . . . . . . . . . . . . . . . . . . . . . 3, 7, 48 kpsewhich. . . . . . . . . . . . . . . . . . . . . . . .164 Kword . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
ls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 LYX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx Mac OS X . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 macros . . . . . . . . . . . . . . . . . . . . . . . . . . 141 macros . . . . . . . . . . . . . . . . . . . . . . . . . . 141 MacTEX . . . . . . . . . . . . . . . . . . . . . . . . 1, 4, 7 \makeatletter.. . . . . . . . . . . . . . . . . . .143 \makeatother .. . . . . . . . . . . . . . . . . . . . 143 makebst. . . . . . . . . . . . . . . . . . . . . . . . . .107 \makeglossary.. . . . . . . . . . . . . . . . . . .109 makeidx . . . . . . . . . . . . . . . . . . . . . . . . . . 108 makeindex . . . . . . . . . . . . . . . . . . 108, 109 \makeindex .. . . . . . . . . . . . . . . . . . . . . . 108 \maketitle .. . 37, 39, 40, 53, 63, 142, 143 Malyshev, Basil K . . . . . . . . . . . . . . . . . xxi man . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Maple . . . . . . . . . . . . . . . . . . . . . . . . 88, 152 marginal notes . . . . . . . . . . . . . . . . . . 100 margins . . . . . . . . . . . . . . . . . . . . . . . . . 112 \markboth . . . . . . . . . . . . . . . . . . . . . . . . 115 \markright .. . . . . . . . . . . . . . . . . . . . . . 115 markup. . . . . . . . . . . . . . . . . . . . . . . . . . .11 marvosym . . . . . . . . . . . . . . . . . . . . . 19, 81 math characters . . . . . . . . . . . . . . . . . . 28 MathCAD . . . . . . . . . . . . . . . . . . . . . . . . . 88 Mathematica. . . . . . . . . . . . . . . . .88, 152 mathematics. . . . . . . . . . . . . . . . .xvii, 28 mathpazo . . . . . . . . . . . . . . . . . . . . . . . . 121 mathptmx . . . . . . . . . . . . . . . . . . . . . . . . 121 \mbox . . . . . . . . . . . . . . . . . . . . . . . . . 26, 145 mdwlist . . . . . . . . . . . . . . . . . . . . . . 74, 113 \medskip . . . . . . . . . . . . . . . . . . . . . . . . . 113 memoir . . . . . . . . . . . . . . . . . . . . . . . . 32, 33 Mendeley. . . . . . . . . . . . . . . . . . . . . . . . .106 metacharacters . . . . . . . . . . . . . . . . . . 18 metadata . . . . . . . . . . . . . . . . . . . . . . . . 36 . . . . . xii, 55, 66, 117, 119, 120, 124, 129, 130, 138, 164, 167, 188 metainformation . . . . . . . . . . . . . . . . 36
Formatting information
\label . . . . . . . . . . . . . . . 76, 80, 101, 102 Lamport, Leslie. . . . . . . . . . . . . .xiii, 146 landscape . . . . . . . . . . . . . . . . . . . . . . . . . . 81 \LARGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 \Large . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 \large . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 \LaTeX . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 latex . . . . . . . . . . . . . . . . . . . . . . . . . . . 3, 49 A LTEX2HTML . . . . . . . . . . . 104, 159161 latex2rtf . . . . . . . . . . . . . . . . . . . . . . . . .160 \leftmark . . . . . . . . . . . . . . . . . . . . . . . . 116 length . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 \length . . . . . . . . . . . . . . . . . . . . . . . . . xxii letter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 letterpaper . . . . . . . . . . . . . . . . . . . . . 34, 35 letterspacing . . . . . . . . . . . . . . . . . . . . 114 \linebreak .. . . . . . . . . . . . . . . . . . . . . . 145 Linux. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 \listoffigures .. . . . . . . . . . . . . . . . . . . 45 \listoftables .. . . . . . . . . . . . . . . . . . . . 45 lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 bulleted . . . . . . . . . . . . . . . . . . . . . . 73 description . . . . . . . . . . . . . . . . . . . 75 discussion . . . . . . . . . . . . . . . . . . . . 75 enumerated . . . . . . . . . . . . . . . . . . 74 inline . . . . . . . . . . . . . . . . . . . . . . . . . 75 itemized . . . . . . . . . . . . . . . . . . . . . . 73 numbered . . . . . . . . . . . . . . . . . . . . 74 longtable . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Lotz, Manfred . . . . . . . . . . . . . . . . . . . . . . 1 190
INDEX
Microbrew . . . . . . . . . . . . . . . . . . . see beer Microsoft Windows . . . . . . . . . . . . . . . . 1 MiKTEX. . . . . . . . . . . . . . . .xviii, 1, 5, 6, 9 MikTEX . . . . . . . . . . . . . . . . . . . . . . . . . . 134 minipage .. . . . . . . . . . . .93, 96, 99, 146 mirror . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 mkdir . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 mktexlsr . . . . . . . . . . . . . . . . 67, 163, 164 mm (millimeters) . . . . . . . . . . . . . . . . . 24 Mozilla . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 multicol . . . . . . . . . . . . . . . . . . . . . . . . . . 110 multicols .. . . . . . . . . . . . . . . . . . . . . . 110 \multicolumn .. . . . . . . . . . . . . . . . . . . . . 83 multiplier . . . . . . . . . . . . . . . . . . . . . . . . 82 multirow . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 multirow .. . . . . . . . . . . . . . . . . . . . . . . . .83 myheadings . . . . . . . . . . . . . . . . . . . . . . 115
N800 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv natbib . . . . . . . . . . . . . . . . . . . . . . 103, 104 NetPBM . . . . . . . . . . . . . . . . . . . . . . . . . . 160 newcent . . . . . . . . . . . . . . . . . . . . 118, 121 \newcommand .. . . . . . . . . . . . . . . .142, 146 \newgeometry .. . . . . . . . . . . . . . . . . . . . 112 NFSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 \normalsize .. . . . . . . . . . . . . . . . . . . . . 125 Notepad . . . . . . . . . . . . . . . . . . . . . . . . . . xvi Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi NTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
apsr . . . . . . . . . . . . . . . . . . . . . . . . . 104 b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 dcu . . . . . . . . . . . . . . . . . . . . . . . . . 104 draft . . . . . . . . . . . . . . . . . . . . . . . . . .34 empty . . . . . . . . . . . . . . . . . . . . . . . 115 full . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6 headings . . . . . . . . . . . . . . . . . . . . . 115 kluwer . . . . . . . . . . . . . . . . . . . . . . . 104 letterpaper . . . . . . . . . . . . . . . . 34, 35 myheadings . . . . . . . . . . . . . . . . . . 115 oneside . . . . . . . . . . . . . . . . . . . . . . . 34 options . . . . . . . . . . . . . . . . . . . . . . 182 pdftex . . . . . . . . . . . . . . . . . . . . . . . 129 plain . . . . . . . . . . . . . . . . . . . 103, 115 scaled . . . . . . . . . . . . . . . . . . . . . . . 120 svgnames . . . . . . . . . . . . . . . . . . . . 128 t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 T1 . . . . . . . . . . . . . . . . . . . . . . . 22, 136 titlepage . . . . . . . . . . . . . . . . . . . . . . 34 twoside . . . . . . . . . . . . . . . . . . . . . . . 34 utf8x . . . . . . . . . . . . . . . . . . . . . . . . . 22
options . . . . . . . . . . . . . see Class Options options . . . . . . . . . . . . . . . . . . . . . . . . . . .182 Rogue . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 OS X. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 Ota, Takaaki . . . . . . . . . . . . . . . . . . . . . . 82 \ovalbox .. . . . . . . . . . . . . . . . . . . . . . . . . . 96 Overfull hbox . . . . . . . . . . . . . . . . . . . . . 54 oxford. . . . . . . . . . . . . . . . . . . . . . . . . . . .107
octothorpe. . . . . . . . . . . . . . . . . . . . . . . .19 Okular . . . . . . . . . . . . . . . . . . . . . . . 3, 7, 48 Omnimark . . . . . . . . . . . . . . . . . . . . . . . 153 oneside . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 OpenOfce. . . . . . . . . . . . . .xvi, 152, 153 Options 11pt . . . . . . . . . . . . . . . . . . . . . . . . . . 34 12pt . . . . . . . . . . . . . . . . . . . . . . . . . . 34 a4paper . . . . . . . . . . . . . . . . . . . 34, 35 agsm . . . . . . . . . . . . . . . . . . . . . . . . 104 alpha . . . . . . . . . . . . . . . . . . . . . . . . 103
Formatting information
\P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 package . . . . . . . . . . . . . . . . . . . . . xxii, 182 Packages apacite . . . . . . . . . . . . . . . . . . . . . . 103 array . . . . . . . . . . . . . . . . . . . . . . . . . .81 article . . . . . . . . . . . . . . . . . . . . . 32, 33 avant . . . . . . . . . . . . . . . . . . . . . . . . 118 babel . . . . . . . . . . . . . . . . . 21, 28, 44 bbding . . . . . . . . . . . . . . . . . . .74, 149 biblatex . . . . . . . . . . . . . . . . . . . . . . 102 bibunits . . . . . . . . . . . . . . . . . . . . . .104 book . . . . . . . . . . . . . . . . . . . . . . 32, 41 191
FORMATTING INFORMATION
multirow . . . . . . . . . . . . . . . . . . . . . . 81 bookman . . . . . . . . . . . . . . . 118, 120 natbib . . . . . . . . . . . . . . . . . . 103, 104 ccr . . . . . . . . . . . . . . . . . . . . . . . . . . 118 newcent . . . . . . . . . . . . . . . . 118, 121 chapterbib . . . . . . . . . . . . . . . . . . . 104 package . . . . . . . . . . . . . . . . xxii, 182 charter . . . . . . . . . . . . . . . . . . . . . . 119 palatino . . . . . . . . . . . . . . . . 118, 121 colortbl . . . . . . . . . . . . . . . . . . . . . . . 81 pandora . . . . . . . . . . . . . . . . . . . . . 117 courier . . . . . . . . . . . . . . . . . . . . . . 118 paralist . . . . . . . . 54, 67, 68, 75, 77 datatool . . . . . . . . . . . . . . . . . . . . . . .82 parskip . . . . . . . . . . . . . . . . . . . . . . . . 44 dcolumn . . . . . . . . . . . . . . . . . . . . . . 81 pifont . . . . . . . . . . . . . . . . . . . 74, 118 eiad . . . . . . . . . . . . . . . . . . . . . . . . . 118 preview-latex . . . . . . . . . . . . . . . . . . xx endnote . . . . . . . . . . . . . . . . . . . . . . 99 pslatex . . . . . . . . . . . . . . . . . . . . . . 121 epsf . . . . . . . . . . . . . . . . . . . . . . . . . . 85 ragged2e . . . . . . . . . . . . . . . . . . . . . .27 extarticle . . . . . . . . . . . . . . . . . . . . . . 35 report . . . . . . . . . . . . . . . . . . . . .32, 41 extbook . . . . . . . . . . . . . . . . . . . . . . . 35 rotating . . . . . . . . . . . . . . . . . . . . . . . 81 extreport . . . . . . . . . . . . . . . . . . . . . .35 section . . . . . . . . . . . . . . . . . . 41, 113 extsizes . . . . . . . . . . . . . . . . . . . . . . . 35 sectsty . . . . . . . . . . . . . . . . . . .41, 113 fancybox . . . . . . . . . . . . . 91, 96, 146 setspace . . . . . . . . . . . . . . . . . . . . . 114 fancyhdr . . . . . . . . . . . . . . . . . . . . . 115 soul . . . . . . . . . . . . . . . . . . . . . 27, 115 fancyvrb . . . . . . . . . . . . . . . . . . 91, 98 tabular . . . . . . . . . . . . . . . . . . . . . . . . 95 x-cm . . . . . . . . . . . . . . . . . . 125, 126 tabularx . . . . . . . . . . . . . . . . . . . . . . . 81 oat . . . . . . . . . . . . . . . . . . . . . . . . . . 80 tabulary . . . . . . . . . . . . . . . . . . . . . . . 81 fnpara . . . . . . . . . . . . . . . . . . . . . . . . 99 textcomp . . . . . . . . 19, 28, 74, 126 fontenc . . . . . . . . . . . . . . . . . . 22, 136 times . . . . . . . . . . . . . 118, 120, 121 fontname . . . . . . . . . . . . . . .137, 138 ucs . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 footmisc . . . . . . . . . . . . . . . . . . . . . xxii ulem . . . . . . . . . . . . . . . . . . . . . . . . 124 geometry . . . 34, 63, 64, 100, 112 url . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 graphics . . . . . . . . . . . . . . . . . . . . . . .65 utopia . . . . . . . . . . . . . . . . . . . . . . . 119 graphicx . . . . . . . . . . . . . . . . . . .85, 87 xcolor . . . . . . . . . . 6265, 128, 129 har2nat . . . . . . . . . . . . . . . . . . . . . . 104 zapfchan . . . . . . . . . . . . . . . . . . . . .118 harvard . . . . . . . . . . . . . . . . . . . . . . 104 helvet . . . . . . . . . . . . . . . . . . 118, 120 packages documentation . . . . . . . . . . . . . . . 63 inputenc . . . . . . . . . 21, 22, 29, 169 downloading . . . . . . . . . . . . . . . . . 64 jurabib . . . . . . . . . . . . . . . . . . . . . . .108 installing . . . . . . . . . . . . . . . . . 64, 65 komascript . . . . . . . . . . . . . . . . 32, 33 using . . . . . . . . . . . . . . . . . . . . . . . . . 62 landscape . . . . . . . . . . . . . . . . . . . . . 81 letter . . . . . . . . . . . . . . . . . . . . . . . . . 32 packages . . . . . . . . . . . . . . . . . . . . . 33, 62 longtable . . . . . . . . . . . . . . . . . . . . . .81 page size margins. . . . . . . . . . . . . . . . . . . . .112 makeidx . . . . . . . . . . . . . . . . . . . . . 108 scaling . . . . . . . . . . . . . . . . . . . . . . . 58 marvosym . . . . . . . . . . . . . . . . . 19, 81 mathpazo . . . . . . . . . . . . . . . . . . . . 121 PageMaker . . . . . . . . . . . . . . . . . . . . . . . 152 mathptmx . . . . . . . . . . . . . . . . . . . 121 \pageref . . . . . . . . . . . . . . . . . . . . . . . . . 102 mdwlist . . . . . . . . . . . . . . . . . . 74, 113 \pagestyle .. . . . . . . . . . . . . . . . . 115, 116 memoir . . . . . . . . . . . . . . . . . . . 32, 33 PaintShop Pro . . . . . . . . . . . . . . . . . . . . . 88 multicol . . . . . . . . . . . . . . . . . . . . . .110 palatino . . . . . . . . . . . . . . . . . . . . . 118, 121
192
Formatting information
INDEX
pandora . . . . . . . . . . . . . . . . . . . . . . . . . . 117 panels. . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 paper sizes . . . . . . . . . . . . . . . . . . . . . . . . 34 \par . . . . . . . . . . . 83, 113, 122, 125, 143 \paragraph. . . . . . . . . . . . . . . . . . . . .41, 76 paralist . . . . . . . . . . . . . 54, 67, 68, 75, 77 \parbox . . . . . . . . . . . . . . . . . . . . . . . . 92, 93 \parindent . . . . . . . . . . . . . . . . . . . 44, 93 parskip . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 \parskip . . . . . . . . . . . . . . . . . . . . . 43, 44 \part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 \part* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 pc (picas) . . . . . . . . . . . . . . . . . . . . . . . . . .24 PCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 PC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi PDA . . . . . . . . . . . . . . . . . . . . . xiv, xv, 151 PDF . . . . . ii, xii, 20, 33, 4850, 55, 57, 57, 58, 6365, 86, 88, 89, 92, 131, 135, 161, 162 A pdfLTEX . . . . . . . . . . . 34, 48, 50, 55, 65, 86, 89, 117, 120, 129, 131, 139, 152, 161 pdatex. . . . . . . . . . . . . . . . . . . . . . . . . .104 pdflatex .. . . . . . . . . . . . . . . . . . . . . . . . .49 pdftex . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 pdftotext. . . . . . . . . . . . . . . . . . . . . . . . .161 \person . . . . . . . . . . . . . . . . . . . . . 145147 PFA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .131 PFB . . . . . . . . . . . . . . . . . . . . . . . . 131, 135 PhotoShop . . . . . . . . . . . . . . . . . . . . . . . . . 88 picas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 picture . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 pifont . . . . . . . . . . . . . . . . . . . . . . . . 74, 118 plain . . . . . . . . . . . . . . . . . . . . . . . . 103, 115 plain-text . . . . . . . . . . . . . . . . . . . . . . . . 11 PNG . . . . . . . . . . . . . . . . . . . 86, 86, 88, 89 points . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 PostScript . . . . . . . xii, 5559, 89, 120, 128131, 135, 136 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 preamble . . . . . . . . . . . . . . . . . . . . . . . . . 40 Preview . . . . . . . . . . . . . . . . . . . . . xviii, 4, 7 preview . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
preview-latex . . . . . . . . . . . . . . . . . . . . . . . xx \printindex .. . . . . . . . . . . . . . . . . . . . . 109 printing . . . . . . . . . . . . . . . . . . . . . . . 47, 57 reverse order . . . . . . . . . . . . . . . . . 58 selected pages . . . . . . . . . . . . . . . . 58 ProCite . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 product . . . . . . . . . . . . . . . . . . . . . xxii, 182 \product .. . . . . . . . . . . . . . 122, 127, 144 Products 3B2 . . . . . . . . . . . . . . . . . . . . . . . . . 152 AbiWord . . . . . . . . . . 152, 154, 155 Acrobat . . . . . . . . . . . . . . . . . . . . . 161 Acrobat Reader . . . . 4, 5, 7, 48, 57 afm2tfm . . . . . . . . . . . . . . . 133, 136 apt . . . . . . . . . . . . . . . . . . . . . . . xviii, 2 ArcInfo . . . . . . . . . . . . . . . . . . . . . . . 88 AutoCAD. . . . . . . . . . . . . . . . . . . . . .88 BaKoMa TEX . . . . . . . . . . . . . . . . . . xx bibtex . . . . . . . . . . . . . . . . . . . . . . . 104 cep. . . . . . . . . . . . . . . . . . . . . . . . . . . .87 charmap . . . . . . . . . . . . . . . . . . . . . . 22 ChemDraw . . . . . . . . . . . . . . . . . . . .88 Chocolate Stout . . . . . . . . . . . . . . 109 congure. . . . . . . . . . . . . . . . . . . . . .67 Crayola . . . . . . . . . . . . . . . . . . xi, 128 Cygwin . . . . . . . . . . . . . . . . . . . . . . . 68 detex . . . . . . . . . . . . . . . . . . . . . . . . 161 DocBook . . . . . . . . . . . . . . . . . . . . . . xxi Draw . . . . . . . . . . . . . . . . . . . . . . . . . 88 dvialw . . . . . . . . . . . . . . . . . . . . . . . . 59 dvieps . . . . . . . . . . . . . . . . . . . . . . . . 59 dvihp . . . . . . . . . . . . . . . . . . . . . . . . . 59 dvips . . . . 5658, 86, 87, 89, 128, 135, 139 dviview . . . . . . . . . . . . . . . . . . . . . . . 55 DynaTag . . . . . . . . . . . . . . . . . . . . 153 elsevier . . . . . . . . . . . . . . . . . . . . . . 107 Emacs. . .xix, 2, 7, 20, 48, 50, 51, 58, 82, 105 EndNote . . . . . . . . . . . . . . . . . . . . . 106 EuroMath . . . . . . . . . . . . . . . . . . . 152 FontForge . . . . . . . . . . . . . . . . . . . . 131 fontname . . . . . . . . . . . . . . . . . . . . 132
Formatting information
193
FORMATTING INFORMATION
Foxit . . . . . . . . . . . . . . . . . . . . . . . . . . 48 FrameMaker . . . . . . . . . . . . . . . . . 152 GhostScript . . . . . . . . . . . . . . . . . . 1, 5 Ghostscript . . . . . . . . . . 57, 59, 119 GIMP . . . . . . . . . . . . . . . . . . . . . . . . . 88 GNUplot . . . . . . . . . . . . . . . . . . . . . . 88 GSView . . . . . . . . . . . . . . . . . . . xviii, 1 GSview . . . . . . . . 5, 48, 57, 58, 119 harvard . . . . . . . . . . . . . . . . . . . . . 107 HTML Tidy . . . . . . . . . . . . . . . . . . 153 ieeetr . . . . . . . . . . . . . . . . . . . . . . . . 107 Illustrator . . . . . . . . . . . . . . . . . . . . 88 ImageMagick . . . . . . . . . . . . . . . . . 87 InkScape . . . . . . . . . . . . . . . . . . . . . . 88 Instant Preview . . . . . . . . . . . . . . . xx JabRef . . . . . . . . . . . . . . . . . . . . . . 106 Java . . . . . . . . . . . . . . . . . . . . xxi, 154 kdvi . . . . . . . . . . . . . . . . . . . . . . . . . 3, 7 Kile . . . . . . . .xiii, xix, 2, 7, 15, 104 kluwer . . . . . . . . . . . . . . . . . . . . . . 107 kpdf . . . . . . . . . . . . . . . . . . . . . 3, 7, 48 kpsewhich . . . . . . . . . . . . . . . . . . . 164 Kword . . . . . . . . . . . . . . . . . . . . . . . 152 A LTEX2HTML. . . . . . .104, 159161 latex2rtf . . . . . . . . . . . . . . . . . . . . 160 LYX . . . . . . . . . . . . . . . . . . . . . . . . . . . xx MacTEX . . . . . . . . . . . . . . . . . . . 1, 4, 7 makebst . . . . . . . . . . . . . . . . . . . . . 107 makeindex . . . . . . . . . . . . . 108, 109 Maple . . . . . . . . . . . . . . . . . . . 88, 152 MathCAD . . . . . . . . . . . . . . . . . . . . . 88 Mathematica . . . . . . . . . . . . 88, 152 Mendeley . . . . . . . . . . . . . . . . . . . . 106 MiKTEX . . . . . . . . . . . xviii, 1, 5, 6, 9 MikTEX . . . . . . . . . . . . . . . . . . . . . . 134 mktexlsr . . . . . . . . . . . 67, 163, 164 Mozilla . . . . . . . . . . . . . . . . . . . . . . . 70 N800. . . . . . . . . . . . . . . . . . . . . . . . .xiv NetPBM . . . . . . . . . . . . . . . . . . . . . 160 Notepad . . . . . . . . . . . . . . . . . . . . . . xvi Notes. . . . . . . . . . . . . . . . . . . . . . . . .xvi Okular . . . . . . . . . . . . . . . . . . .3, 7, 48 Omnimark. . . . . . . . . . . . . . . . . . .153 194
OpenOfce . . . . . . . . . xvi, 152, 153 oxford . . . . . . . . . . . . . . . . . . . . . . . 107 PageMaker. . . . . . . . . . . . . . . . . . .152 PaintShop Pro . . . . . . . . . . . . . . . . . 88 A pdfLTEX . . . . . . 34, 48, 50, 55, 65, 86, 89, 117, 120, 129, 131, 139, 152, 161 pdatex . . . . . . . . . . . . . . . . . . . . . 104 pdftotext . . . . . . . . . . . . . . . . . . . . 161 PhotoShop . . . . . . . . . . . . . . . . . . . . 88 Preview . . . . . . . . . . . . . . . . xviii, 4, 7 ProCite . . . . . . . . . . . . . . . . . . . . . . 106 product. . . . . . . . . . . . . . . . .xxii, 182 ProTEXt . . . . . . . . . . . . . . . . . . . . . . 5, 7 proTEXt . . . . . . . . . . . . . . . . . . . . . . . . 9 psnup . . . . . . . . . . . . . . . . . . . . . . . . .58 pstops . . . . . . . . . . . . . . . . . . . . . . . . 58 Publisher . . . . . . . . . . . . . . . . . . . . 152 pybliographic . . . . . . . . . . . . . . . . 106 Reference Manager . . . . . . . . . . . 106 rtf2latex2e . . . . . . . . . . . . . 153, 160 Runoff . . . . . . . . . . . . . . . . . . . . . . . . 12 Saxon . . . . . . . . . . . . . .xxi, 154, 156 Scientic Word . . . . . . . . . . . . . . . . xx Synaptic . . . . . . . . . . . . . . . . . . xviii, 2 t1binary . . . . . . . . . . . . . . . . . . . . 131 t1utils. . . . . . . . . . . . . . . . . . . . . . .131 TEX2Word . . . . . . . . . . . . . . . . . . . 160 TEX4ht . . . . . . . . . . . . . . . . . 159, 161 texcong . . . . . . . . . . . . . . . . . . . . . . . 3 texhash . . . . . . . . . . . . 67, 163, 164 TEXnicCenter xviii, xix, 1, 57, 13, 82, 104 TEXshop . . . . . . . . . xviii, xix, 1, 4, 7 TextEdit . . . . . . . . . . . . . . . . . . . . . . xvi Textures. . . . . . . . . . . . . . . . . . . . . . .xx Tidy . . . . . . . . . . . . . . . . . . . . . . . . . 160 tkbibtex . . . . . . . . . . . . . . . . . . . . . 106 tkPaint . . . . . . . . . . . . . . . . . . . . . . . 88 updmap. . . . . . . . . . .135, 138, 139 updmap-sys . . . . . . . . . . . . . . . . . 135 Velcro. . . . . . . . . . . . . . . . . . . . . . . .144 vi . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Formatting information
INDEX
vptovf . . . . . . . . . . . . . . . . . . . . . . . 133 which . . . . . . . . . . . . . . . . . . . . . . . 164 Windows . . . . . . . . . . . . . . . . . xviii, 7 WinEDT . . . . . . . . . . . . . . . . . . . . . . xiii Winedt . . . . . . . . . . . . . . . . . . . . . . . 82 Word . . . xvi, xvii, 126, 152, 153, 159161 WordPerfect . . . . . . . . . . . . . . . . . . xvi xdvi . . . . . . . . . . . . . . . . . . . . . . 55, 57 xkeycaps . . . . . . . . . . . . . . . . . . . . . . 22 xpdf . . . . . . . . . . . . . . . . . . . . . . . . . . 48 XPress . . . . . . . . . . . . . . . . . . . . . . . 152 Yap . . . . . . . . . . . . . . . . . . . . . . . . . xviii yum . . . . . . . . . . . . . . . . . . . . . . xviii, 2 Zaurus . . . . . . . . . . . . . . . . . . . . . . . xiv Zotero . . . . . . . . . . . . . . . . . . . . . . . 106 \protect . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 ProTEXt . . . . . . . . . . . . . . . . . . . . . . . . . . 5, 7 proTEXt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 \ProvidesPackage .. . . . . . . . . . . . . . . 136 PS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 pslatex . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 psnup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 pstops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 pt (points) . . . . . . . . . . . . . . . . . . . . . . . . 24 Publisher. . . . . . . . . . . . . . . . . . . . . . . . .152 pybliographic . . . . . . . . . . . . . . . . . . . . 106
\raisebox . . . . . . . . . . . . . . . . . . . . . . . . 149 \ref . . . . . . . . . . . . . . . . . . . . . 76, 101, 102 Reference Manager . . . . . . . . . . . . . . . 106 references . . . . . . . . . . . . . . . . . . . . . . . 102 \refname . . . . . . . . . . . . . . . . . . . . . . . . . 106 \reindex .. . . . . . . . . . . . . . . . . . . 145, 146 \renewcommand .. .39, 40, 82, 143, 147 report . . . . . . . . . . . . . . . . . . . . . . . . . 32, 41 RGB. . . . . . . . . . . . . . . . . . .128, 129, 129 \rightmark .. . . . . . . . . . . . . . . . . . . . . . 116 RIS . . . . . . . . . . . . . . . . . . . . . . . . . 106, 106 \rmdefault .. . . . . . . . . . . . . . . . . . . . . . 136 rotate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 rotating . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 RTF . . . . . . . . . . . . . . . . . . . 153, 154, 160 rtf2latex2e . . . . . . . . . . . . . . . . . 153, 160 Runaway argument . . . . . . . . . . . . . . 53 Runoff . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
\qquad . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 \quad . . . . . . . . . . . . . . . . . . . . . . . . . 25, 114 quotation . . . . . . . . . . . . . . . . . . . xxii, 98 quotation marks . . . . . . . . . . . . . . . . . . 19 quote . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
ragged2e . . . . . . . . . . . . . . . . . . . . . . . . . . 27 \raggedleft . . . . . . . . . . . . . . . . . . . . . . . 27 raggedleft . . . . . . . . . . . . . . . . . . . . . . . 27 \raggedright . . . . . . . . . . . . . . 27, 92, 94 raggedright .. . . . . . . . . . . . . . . . . . . . . 27 Raggett, Dave . . . . . . . . . . . . . . . . . . . 153 Rahtz, Sebastian . . . . . . . . . . . . . . . . . . . 1
\S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 Sathyam, Ujwal . . . . . . . . . . . . . . . . . 153 Saxon . . . . . . . . . . . . . . . . . . xxi, 154, 156 Sbox . . . . . . . . . . . . . . . . . . . . . . . . . 96, 146 scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 scaled . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 Schenk, Christian . . . . . . . . . . . . . . . . . . 1 Scientic Word . . . . . . . . . . . . . . . . . . . . xx \scriptsize .. . . . . . . . . . . . . . . . . . . . . 125 \scshape . . . . . . . . . . . . . . . . . . . . . . . . . 123 secnumdepth . . . . . . . . . . . . . . . . .42, 43 section . . . . . . . . . . . . . . . . . . . . . . . 41, 113 \section . . . . . . . . . . . . . . . . . . . . . . . 41, 44 section . . . . . . . . . . . . . .xxii, 147, 148 section numbering . . . . . . . . . . . . . . . . 42 sections . . . . . . . . . . . . . . . . . . . . . . . 31, 40 sectsty . . . . . . . . . . . . . . . . . . . . . . . 41, 113 \selectfont .. . . . . . . . . . . . . . . . 121, 123 \sentinel . . . . . . . . . . . . . . . . . . . . . . . . 146 \setcounter . . . . . . . . . . . . . . . . . . . . . . . 42 \setlength .. . . . . . . . . . . . . . . . 43, 44, 93 setspace . . . . . . . . . . . . . . . . . . . . . . . . . 114 \sfdefault .. . . . . . . . . . . . . . . . . . . . . . 136 195
Formatting information
FORMATTING INFORMATION
\sffamily .. . . . . . . . . . . . . . . . . . 123, 143 SGML . . . . . . . . . 12, 32, 152, 162, 162 \shadowbox .. . . . . . . . . . . . . . . . . . 96, 146 sidebars . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 \slshape . . . . . . . . . . . . . . . . . . . . . . . . . 123 \small . . . . . . . . . . . . . . . . . . . . . . . . 97, 125 \smallskip .. . . . . . . . . . . . . . . . . . . . . . 113 soul . . . . . . . . . . . . . . . . . . . . . . . . . . 27, 115 sp (scaled points) . . . . . . . . . . . . . . . . . .24 space. . . . . . . . . . . . . . . . .see white-space \space . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 \spaceskip . . . . . . . . . . . . . . . . . . . . . . . 26 spacing . . . . . . . see double-spacing, see white-space special characters . . . . . . . . . . . . . . . . . 18 Stallman, Richard . . . . . . . . . . . . . . . . xiv Stephani, Philipp. . . . . . . . . . . . . . . . . .86 \subparagraph .. . . . . . . . . . . . . . . . 41, 76 \subparagraph* .. . . . . . . . . . . . . . . . . . . 43 \subsection . . . . . . . . . . . . . . . . . . . . . . . 41 \subsubsection .. . . . . . . . . . . . . . . . . . . 41 sudo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2, 3 summaries. . . . . . . . . . . . . . . . . . . . . . . .37 SVG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 svgnames . . . . . . . . . . . . . . . . . . . . . . . . 128 Synaptic . . . . . . . . . . . . . . . . . . . . . . xviii, 2
t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 T1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 22, 136
t1binary . . . . . . . . . . . . . . . . . . . . . . . . . 131 t1utils . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 \tabcolsep . . . . . . . . . . . . . . . . . . . . . . . 82 table . . . . . . . . . . . . . . . . . . . . . . . . . 80, 84 table of contents adding manual entry . . . . . . . . . 45 automated entries . . . . . . . . . . . . 45 table* . . . . . . . . . . . . . . . . . . . . . . . . . . .110 \tableofcontents.. . . . . . . . .16, 45, 51 tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 tabular . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 tabular .. . . . . . . . . . . . . . . . . . 80, 83, 93 tabularx . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 196
tabulary . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Talbot, Nicola . . . . . . . . . . . . . . . . . . . . . 82 TDS . . . . . . . . . . . . . . 62, 6668, 68, 129 TEI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 temporary directory . . . . . . . . . . . . . 65 term . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii te . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 TEX2Word . . . . . . . . . . . . . . . . . . . . . . . . 160 TEX4ht . . . . . . . . . . . . . . . . . . . . . .159, 161 texcong . . . . . . . . . . . . . . . . . . . . . . . . . . . .3 texconfig .. . . . . . . . . . . . . . . . . . . . . . . . . 3 texdoc . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 texhash . . . . . . . . . . . . . . . . . 67, 163, 164 Live . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 TEXnicCenter xviii, xix, 1, 57, 13, 82, 104 TEXshop . . . . . . . . . . . . . xviii, xix, 1, 4, 7 \textbackslash .. . . . . . . . . . . . . . . . . . . 18 \textbrokenbar .. . . . . . . . . . . . . . . . . . . 28 \textbullet . . . . . . . . . . . . . . . . . . . . . . . 74 \textcolor .. . . . . . . . . . . . . . . . . 128, 129 textcomp . . . . . . . . . . . . . 19, 28, 74, 126 TextEdit . . . . . . . . . . . . . . . . . . . . . . . . . . xvi \texteuro .. . . . . . . . . . . . . . . . . . . . . . . . .19 \textit . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 \textlangle . . . . . . . . . . . . . . . . . . . . . . . 28 \textrangle . . . . . . . . . . . . . . . . . . . . . . . 28 \textsterling .. . . . . . . . . . . . . . . . . . . . 19 \textsuperscript .. . . . . . . . . . . . . . . 126 \texttrademark . . . . . . . . . . . . . . . . . . 144 Textures . . . . . . . . . . . . . . . . . . . . . . . . . . . xx \textwidth . . . . . . . . . . . . . . . . . . . . . . xxii Th Thnh, Hn . . . . . . . . . . . . . . . . . xiii \thechapter .. . . . . . . . . . . . . . . . . . . . . 147 \theenumi .. . . . . . . . . . . . . . . . . . . . . . . . .78 \theenumii . . . . . . . . . . . . . . . . . . . . . . . . 78 \theenumiii . . . . . . . . . . . . . . . . . . . . . . . 78 \theenumiv . . . . . . . . . . . . . . . . . . . . . . . . 78 \TheSbox . . . . . . . . . . . . . . . . . . . . . . . . . 146 \thinspace .. . . . . . . . . . . . . . . . . . 20, 114 \thispagestyle . . . . . . . . . . . . . . . . . . 115 Tidy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 TIFF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Formatting information
INDEX
times . . . . . . . . . . . . . . . . . . 118, 120, 121 \tiny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 \title . . . . . . . . . . . . . . . . . . . . 37, 99, 142 titlepage . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 tkbibtex. . . . . . . . . . . . . . . . . . . . . . . . . .106 tkPaint . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 \tmproduct .. . . . . . . . . . . . . . . . . . . . . . 144 tocdepth . . . . . . . . . . . . . . . . . . . . 42, 45 Too many }s. . . . . . . . . . . . . . . . . . . . . .52 tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 tracking . . . . . . . . . . . . see letterspacing True . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi \ttdefault .. . . . . . . . . . . . . . . . . . . . . . 136 \ttfamily . . . . . . . . . . . . . . . . . . . . . . . . 123 TUG . . . . ix, xiii, xiv, xviii, xxi, 1, 167 twoside . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 typesetting . . . . . . . . . . . . . . . . . . . . . . . 47 typographics . . . . . . . . . . . . . . . . . . . . 111
\verb . . . . . . . . . . . . . . . . . . . 19, 9092, 98 Verbatim .. . . . . . . . . . . . . . . . . . . . . 91, 92 verbatim .. . . . . . . . . . . . . . . . . . . . . 91, 92 verbatim text . . . . . . . . . . . . . . . . . . . . . 90 \VerbatimFootnotes .. . . . . . . . . . . . . . 98 vertical bar . . . . . . . . . . . . . . . . . . . . . . 90 vi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix viewing . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 vptovf . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 \vspace . . . . . . . . . . . . . . . . . . . . . 113, 114 \vspace* . . . . . . . . . . . . . . . . . . . . . . . . . 113 V . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
\uline . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Undened control sequence . . . . . . . 52 Underfull hbox . . . . . . . . . . . . . . . . . . . 53 units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Unix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 updmap . . . . . . . . . . . . . . . 135, 138, 139 updmap-sys. . . . . . . . . . . . . . . . . . . . . .135 \upshape . . . . . . . . . . . . . . . . . . . . . . . . . 123 URI . . . . 8, 47, 69, 90, 90, 91, 92, 154 URL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90 url . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 X \url . . . . . . . . . . . . . . . . . . .91, 92, 99, 159 xcolor . . . . . . . . . . . . . . . 6265, 128, 129 \usepackage 54, 62, 63, 107, 128, 131 xdvi . . . . . . . . . . . . . . . . . . . . . . . . . . . 55, 57 utf8x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 xetex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii utopia . . . . . . . . . . . . . . . . . . . . . . . . . . . .119 XHTML . . . . . . . . . . . . . . . . . . . . 153, 160 xkeycaps . . . . . . . . . . . . . . . . . . . . . . . . . . 22 V XML . . . . . . . . . . . ii, x, xiv, xvii, xxi, 32, variables . . . . . . . . . . . . . . . . . . . . . .182 78, 90, 152, 152, 153155, \vbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 157, 159, 161, 162, 169 Velcro . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 xpdf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Formatting information
Wawrykiewicz, Staszek. . . . . . . . . . .87 which . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 white-space . . . . . . . . . . . . . . . . . . . . . . . 17 double-spacing . . . . . . . . . . . . . 113 hard . . . . . . . . . . . . . . . . . . . . . . . . . . 26 horizontal . . . . . . . . . . . . . . . . . . 114 vertical disappearing. . . . . . . . . . . . . .113 xed . . . . . . . . . . . . . . . . . . . . . . 113 exible . . . . . . . . . . . . . . . . . . . . 113 white-space . . . . . . . . . . . . . . . . . . . . . . 16 Windows. . . . . . . . . . . . . . . . . . . . . .xviii, 7 WinEDT . . . . . . . . . . . . . . . . . . . . . . . . . . xiii Winedt . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Word . . . . . . . . xvi, xvii, 126, 152, 153, 159161 WordPerfect . . . . . . . . . . . . . . . . . . . . . . . xvi WYSIWYG . . . . . . . xii, xviii, xx, 31, 55
197
FORMATTING INFORMATION
XPress . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 yum. . . . . . . . . . . . . . . . . . . . . . . . . . .xviii, 2 XSL . . . . . . . . . . . . . . . . . . . . . . . . 162, 162 XSLT ii, xxi, 153, 153, 154157, 162, Z 169 zapfchan . . . . . . . . . . . . . . . . . . . . . . . . . 118 Zaurus. . . . . . . . . . . . . . . . . . . . . . . . . . . .xiv Y Yap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii Zotero. . . . . . . . . . . . . . . . . . . . . . . . . . . .106
198
Formatting information