the tex your 260 questions answered version 3.1a, date ...trivedi/latexhelp/docs/faqs/newfaq.pdf ·...

130
The UK T E X FAQ Your 260 Questions Answered version 3.1a, date 2002/09/05 Maintained by Robin Fairbairns September 5, 2002 NOTE This document is an updated and extended version of the FAQ article that was published as the December 1994 and 1995, and March 1999 editions of the UK TUG magazine Baskerville (which weren’t formatted like this). The article is also available via the World Wide Web. Contents A Introduction 6 B The Background 7 1 What is T E X? .............................. 7 2 How should I pronounce “T E X”? ................... 7 3 What is METAFONT? ......................... 7 4 What is MetaPost? ........................... 8 5 How can I be sure it’s really T E X? ................... 8 6 Are T E X and friends Y2K compliant? ................. 8 7 What is L A T E X? ............................. 9 8 What is L A T E X2 ε ? ........................... 9 9 How should I pronounce “L A T E X(2 ε )”? ................ 9 10 Should I use Plain T E X or L A T E X? ................... 9 11 How does L A T E X relate to Plain T E X? ................. 10 12 What is ConT E Xt? ........................... 10 13 What are the AMS packages (A M S -T E X, etc.)? ............ 10 14 What is Eplain? ............................ 10 15 What is Lollipop? ........................... 11 16 What is Texinfo? ............................ 11 17 If T E X is so good, how come it’s free? ................ 11 18 What is the future of T E X? ....................... 11 19 Reading (L A )T E X files .......................... 12 20 Why is T E X not a WYSIWYG system? ................. 12 21 T E X User Groups ........................... 13 C Documentation and Help 13 22 Books on T E X and its relations .................... 13 23 Books on Type ............................. 15 24 Where to find FAQs .......................... 15 25 Where to get help ........................... 16 26 How to ask a question ......................... 16 27 (L A )T E X Tutorials, etc. ......................... 17 28 Learning to write L A T E X classes and packages ............. 18 29 METAFONT and MetaPost Tutorials ................. 18 30 BIBT E X Documentation ........................ 18 31 Where can I find the symbol for. . . .................. 19 32 The P I CT E X manual .......................... 19 1

Upload: others

Post on 04-Feb-2021

4 views

Category:

Documents


0 download

TRANSCRIPT

  • TheUK TEX FAQYour 260 Questions Answeredversion 3.1a, date 2002/09/05

    Maintained by Robin Fairbairns

    September 5, 2002

    NOTE

    This document is an updated and extended version of theFAQ article thatwas published as the December 1994 and 1995, and March 1999 editions of theUK TUG magazineBaskerville(which weren’t formatted like this).

    The article is also available via the World Wide Web.

    Contents

    A Introduction 6B The Background 7

    1 What is TEX? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 How should I pronounce “TEX”? . . . . . . . . . . . . . . . . . . . 73 What isMETAFONT? . . . . . . . . . . . . . . . . . . . . . . . . . 74 What is MetaPost?. . . . . . . . . . . . . . . . . . . . . . . . . . . 85 How can I be sure it’s really TEX? . . . . . . . . . . . . . . . . . . . 86 Are TEX and friends Y2K compliant?. . . . . . . . . . . . . . . . . 87 What is LATEX? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 What is LATEX 2ε? . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 How should I pronounce “LATEX(2ε)”? . . . . . . . . . . . . . . . . 910 Should I use Plain TEX or LATEX? . . . . . . . . . . . . . . . . . . . 911 How does LATEX relate to Plain TEX? . . . . . . . . . . . . . . . . . 1012 What is ConTEXt? . . . . . . . . . . . . . . . . . . . . . . . . . . . 1013 What are theAMS packages (AMS-TEX, etc.)? . . . . . . . . . . . . 1014 What is Eplain? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1015 What is Lollipop? . . . . . . . . . . . . . . . . . . . . . . . . . . . 1116 What is Texinfo?. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1117 If TEX is so good, how come it’s free?. . . . . . . . . . . . . . . . 1118 What is the future of TEX? . . . . . . . . . . . . . . . . . . . . . . . 1119 Reading (LA)TEX files . . . . . . . . . . . . . . . . . . . . . . . . . . 1220 Why is TEX not aWYSIWYG system?. . . . . . . . . . . . . . . . . 1221 TEX User Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    C Documentation and Help 1322 Books on TEX and its relations . . . . . . . . . . . . . . . . . . . . 1323 Books on Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1524 Where to findFAQs . . . . . . . . . . . . . . . . . . . . . . . . . . 1525 Where to get help. . . . . . . . . . . . . . . . . . . . . . . . . . . 1626 How to ask a question. . . . . . . . . . . . . . . . . . . . . . . . . 1627 (LA)TEX Tutorials, etc. . . . . . . . . . . . . . . . . . . . . . . . . . 1728 Learning to write LATEX classes and packages. . . . . . . . . . . . . 1829 METAFONT and MetaPost Tutorials. . . . . . . . . . . . . . . . . 1830 BIBTEX Documentation. . . . . . . . . . . . . . . . . . . . . . . . 1831 Where can I find the symbol for. . .. . . . . . . . . . . . . . . . . . 1932 The PICTEX manual . . . . . . . . . . . . . . . . . . . . . . . . . . 19

    1

  • D Bits and pieces of TEX 1933 What is aDVI file? . . . . . . . . . . . . . . . . . . . . . . . . . . . 1934 What is a driver?. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1935 What arePK files? . . . . . . . . . . . . . . . . . . . . . . . . . . . 2036 What areTFM files? . . . . . . . . . . . . . . . . . . . . . . . . . . 2037 Virtual fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2038 \special commands. . . . . . . . . . . . . . . . . . . . . . . . . 2039 Documented LATEX sources (.dtx files) . . . . . . . . . . . . . . . . 2140 What are encodings?. . . . . . . . . . . . . . . . . . . . . . . . . . 2141 How does hyphenation work in TEX? . . . . . . . . . . . . . . . . . 2242 What are theEC fonts? . . . . . . . . . . . . . . . . . . . . . . . . 2243 What is theTDS? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2344 What is “Encapsulated PostScript”. . . . . . . . . . . . . . . . . . 23

    E Acquiring the Software 2445 Repositories of TEX material . . . . . . . . . . . . . . . . . . . . . 2446 What’s theCTAN nonfree tree? . . . . . . . . . . . . . . . . . . . 2447 Contributing a file to the archives. . . . . . . . . . . . . . . . . . . 2448 Finding (LA)TEX macro packages . . . . . . . . . . . . . . . . . . . 2549 Finding files in theCTAN archives. . . . . . . . . . . . . . . . . . . 2550 Finding files by Web search. . . . . . . . . . . . . . . . . . . . . . 2651 Finding new fonts. . . . . . . . . . . . . . . . . . . . . . . . . . . 2652 TEX CD-ROMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    F TEX Systems 2653 (LA)TEX for different machines. . . . . . . . . . . . . . . . . . . . . 2654 TEX-friendly editors and shells. . . . . . . . . . . . . . . . . . . . 2855 Commercial TEX implementations . . . . . . . . . . . . . . . . . . 29

    G DVI Drivers and Previewers 3156 DVI to PostScript conversion programs. . . . . . . . . . . . . . . . 3157 DVI drivers forHP LaserJet . . . . . . . . . . . . . . . . . . . . . . 3158 Output to “other” printers. . . . . . . . . . . . . . . . . . . . . . . 3159 DVI previewers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

    H Support Packages for TEX 3260 Fig, a TEX-friendly drawing package. . . . . . . . . . . . . . . . . 3261 TEXCAD, a drawing package for LATEX . . . . . . . . . . . . . . . . 3262 Spelling checkers for work with TEX . . . . . . . . . . . . . . . . . 3263 How many words have you written?. . . . . . . . . . . . . . . . . . 33

    I Literate programming 3364 What is Literate Programming?. . . . . . . . . . . . . . . . . . . . 3365 WEB systems for various languages. . . . . . . . . . . . . . . . . . 33

    J Format conversions 3466 Conversion between (LA)TEX and others. . . . . . . . . . . . . . . . 3467 Conversion from (LA)TEX to plain ASCII . . . . . . . . . . . . . . . . 3568 Conversion fromSGML or HTML to TEX . . . . . . . . . . . . . . . 3669 (LA)TEX conversion toHTML . . . . . . . . . . . . . . . . . . . . . . 3670 Using TEX to readSGML or XML directly . . . . . . . . . . . . . . . 3771 Retrieving (LA)TEX from DVI , etc. . . . . . . . . . . . . . . . . . . . 3772 Translating LATEX to Plain TEX . . . . . . . . . . . . . . . . . . . . 38

    K Hypertext and PDF 3873 Making hypertext documents from TEX . . . . . . . . . . . . . . . . 3874 Making Acrobat documents from LATEX . . . . . . . . . . . . . . . . 3875 Quality ofPDF from PostScript . . . . . . . . . . . . . . . . . . . . 3976 Finding ‘8-bit’ Type 1 fonts. . . . . . . . . . . . . . . . . . . . . . 4077 Replacing Type 3 fonts in PostScript. . . . . . . . . . . . . . . . . 40

    L Fonts 41L.1 METAFONT fonts 41

    78 GettingMETAFONT to do what you want . . . . . . . . . . . . . . 4179 Which font files should be kept. . . . . . . . . . . . . . . . . . . . 4280 Acquiring bitmap fonts . . . . . . . . . . . . . . . . . . . . . . . . 42

    2

  • L.2 Adobe Type 1 (“PostScript”) fonts 4381 Using PostScript fonts with TEX . . . . . . . . . . . . . . . . . . . . 4382 Previewing files using Type 1 fonts. . . . . . . . . . . . . . . . . . 4383 TEX font metric files for PostScript fonts. . . . . . . . . . . . . . . 4484 Deploying Type 1 fonts. . . . . . . . . . . . . . . . . . . . . . . . 4585 Choice of scalable outline fonts. . . . . . . . . . . . . . . . . . . . 4586 Weird characters indvipsoutput. . . . . . . . . . . . . . . . . . . . 49

    L.3 Particular font families 4987 Using the “Concrete” fonts. . . . . . . . . . . . . . . . . . . . . . 49

    M Graphics 5088 How to import graphics into (LA)TEX documents . . . . . . . . . . . 5089 Graphics indvips . . . . . . . . . . . . . . . . . . . . . . . . . . . 5190 Graphics inPDFLATEX . . . . . . . . . . . . . . . . . . . . . . . . . 5191 Making MetaPost output display inghostscript. . . . . . . . . . . . 5192 Drawing with TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . 5293 Drawing Feynman diagrams in LATEX . . . . . . . . . . . . . . . . . 52

    N Bibliographies and citations 53N.1 Creating bibliographies 53

    94 Creating a bibliography style. . . . . . . . . . . . . . . . . . . . . 5395 Capitalisation in BIBTEX . . . . . . . . . . . . . . . . . . . . . . . 5396 ‘String too long’ in BIBTEX . . . . . . . . . . . . . . . . . . . . . . 5397 BIBTEX doesn’t understand lists of names. . . . . . . . . . . . . . 5498 URLs in BIBTEX bibliographies . . . . . . . . . . . . . . . . . . . . 5499 Using BIBTEX with Plain TEX . . . . . . . . . . . . . . . . . . . . . 55

    N.2 Creating citations 55100 Separate bibliographies per chapter?. . . . . . . . . . . . . . . . . 55101 Multiple bibliographies?. . . . . . . . . . . . . . . . . . . . . . . . 55102 Putting bibliography entries in text. . . . . . . . . . . . . . . . . . 56103 Sorting and compressing citations. . . . . . . . . . . . . . . . . . . 56104 Multiple citations . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

    N.3 Manipulating whole bibliographies 57105 Listing all your BIBTEX entries . . . . . . . . . . . . . . . . . . . . 57106 MakingHTML of your Bibliography . . . . . . . . . . . . . . . . . 57

    O Installing (LA)TEX files 57107 Installing a new package. . . . . . . . . . . . . . . . . . . . . . . . 57108 Where to put new files. . . . . . . . . . . . . . . . . . . . . . . . . 58109 Installing MikTEX “known packages”. . . . . . . . . . . . . . . . . 59110 “Temporary” installation of (LA)TEX files . . . . . . . . . . . . . . . 59

    P Adjusting the typesetting 60P.1 Alternative document classes 60

    111 Replacing the standard classes. . . . . . . . . . . . . . . . . . . . . 60112 Formatting a thesis in LATEX . . . . . . . . . . . . . . . . . . . . . . 60113 Setting papers for journals. . . . . . . . . . . . . . . . . . . . . . . 60114 A ‘report’ from lots of ‘article’s . . . . . . . . . . . . . . . . . . . . 61115 Curriculum Vitae(Resuḿe) . . . . . . . . . . . . . . . . . . . . . . 61116 Letters and the like. . . . . . . . . . . . . . . . . . . . . . . . . . . 62117 Other “document font” sizes?. . . . . . . . . . . . . . . . . . . . . 62

    P.2 Document structure 62118 The style of document titles. . . . . . . . . . . . . . . . . . . . . . 62119 The style of section headings. . . . . . . . . . . . . . . . . . . . . 62120 Indent after section headings. . . . . . . . . . . . . . . . . . . . . 63121 How to create a\subsubsubsection . . . . . . . . . . . . . . . . 63122 The style of captions. . . . . . . . . . . . . . . . . . . . . . . . . . 63123 Alternative head- and footlines in LATEX . . . . . . . . . . . . . . . . 64124 Changing the margins in LATEX . . . . . . . . . . . . . . . . . . . . 64125 Wide figures in two-column documents. . . . . . . . . . . . . . . . 65126 1-column abstract in 2-column document. . . . . . . . . . . . . . . 65127 Really blank pages between chapters. . . . . . . . . . . . . . . . . 66128 Balancing columns at the end of a document. . . . . . . . . . . . . 66

    3

  • P.3 Page layout 67129 How to get rid of page numbers. . . . . . . . . . . . . . . . . . . . 67130 \pagestyle{empty} on first page in LATEX . . . . . . . . . . . . . 67131 How to create crop marks. . . . . . . . . . . . . . . . . . . . . . . 68132 ‘Watermarks’ on every page. . . . . . . . . . . . . . . . . . . . . . 68133 Typesetting things in landscape orientation. . . . . . . . . . . . . . 68134 Putting things at fixed positions on the page. . . . . . . . . . . . . 69

    P.4 Spacing of characters and lines 69135 Double-spaced documents in LATEX . . . . . . . . . . . . . . . . . . 69136 Changing the space between letters. . . . . . . . . . . . . . . . . . 69137 Setting text ragged right. . . . . . . . . . . . . . . . . . . . . . . . 70138 Cancelling\ragged commands. . . . . . . . . . . . . . . . . . . . 70

    P.5 Typesetting specialities 70139 Including a file verbatim in LATEX . . . . . . . . . . . . . . . . . . . 70140 Including line numbers in typeset output. . . . . . . . . . . . . . . 71141 Code listings in LATEX . . . . . . . . . . . . . . . . . . . . . . . . . 71142 Generating an index in (LA)TEX . . . . . . . . . . . . . . . . . . . . 71143 TypesettingURLs . . . . . . . . . . . . . . . . . . . . . . . . . . . 72144 Typesetting music in TEX . . . . . . . . . . . . . . . . . . . . . . . 73145 Zero paragraph indent. . . . . . . . . . . . . . . . . . . . . . . . . 73146 Set specifications and Dirac brackets. . . . . . . . . . . . . . . . . 74147 Big letters at the start of a paragraph. . . . . . . . . . . . . . . . . 74148 The comma as a decimal separator. . . . . . . . . . . . . . . . . . 74149 Breaking boxes of text. . . . . . . . . . . . . . . . . . . . . . . . . 74

    P.6 Tables of contents and indexes 75150 The format of the Table of Contents, etc.. . . . . . . . . . . . . . . 75151 Unnumbered sections in the Table of Contents. . . . . . . . . . . . 75152 Bibliography, index, etc., inTOC . . . . . . . . . . . . . . . . . . . 76153 Multiple indexes. . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

    Q How do I do X in (LA)TEX 77Q.1 Mathematics 77

    154 Proof environment. . . . . . . . . . . . . . . . . . . . . . . . . . . 77155 Roman theorems. . . . . . . . . . . . . . . . . . . . . . . . . . . . 77156 Defining a new log-like function in LATEX . . . . . . . . . . . . . . . 77

    Q.2 Lists 77157 Fancy enumeration lists. . . . . . . . . . . . . . . . . . . . . . . . 77158 How to reduce list spacing. . . . . . . . . . . . . . . . . . . . . . . 78

    Q.3 Tables, figures and diagrams 78159 Fixed-width tables. . . . . . . . . . . . . . . . . . . . . . . . . . . 78160 Spacing lines in tables. . . . . . . . . . . . . . . . . . . . . . . . . 79161 Tables longer than a single page. . . . . . . . . . . . . . . . . . . . 79162 How to alter the alignment of tabular cells. . . . . . . . . . . . . . 80163 Flowing text around figures in LATEX . . . . . . . . . . . . . . . . . 80164 Floats on their own on float pages. . . . . . . . . . . . . . . . . . . 81

    Q.4 Footnotes 81165 Footnotes in tables. . . . . . . . . . . . . . . . . . . . . . . . . . . 81166 Footnotes in LATEX section headings. . . . . . . . . . . . . . . . . . 82167 Footnotes in captions. . . . . . . . . . . . . . . . . . . . . . . . . 82168 Footnotes whose texts are identical. . . . . . . . . . . . . . . . . . 83

    Q.5 Document management 84169 What’s the name of this file. . . . . . . . . . . . . . . . . . . . . . 84170 All the files used by this document. . . . . . . . . . . . . . . . . . 84171 Marking changed parts of your document. . . . . . . . . . . . . . . 85172 Conditional compilation and “comments”. . . . . . . . . . . . . . . 85173 Bits of document from other directories. . . . . . . . . . . . . . . . 86174 Version control usingRCSor CVS . . . . . . . . . . . . . . . . . . . 87175 Makefiles for LATEX documents . . . . . . . . . . . . . . . . . . . . 87

    4

  • Q.6 Hyphenation 87176 My words aren’t being hyphenated. . . . . . . . . . . . . . . . . . 87177 Weird hyphenation of words. . . . . . . . . . . . . . . . . . . . . . 88178 (Merely) peculiar hyphenation. . . . . . . . . . . . . . . . . . . . 88179 Accented words aren’t hyphenated. . . . . . . . . . . . . . . . . . 89180 Using a new language with Babel. . . . . . . . . . . . . . . . . . . 89181 Stopping all hyphenation. . . . . . . . . . . . . . . . . . . . . . . 90

    Q.7 Odds and ends 91182 Typesetting all those TEX-related logos. . . . . . . . . . . . . . . . 91183 Referring to things by their name. . . . . . . . . . . . . . . . . . . 91184 How to do bold-tt or bold-sc. . . . . . . . . . . . . . . . . . . . . . 91

    R Symbols, etc. 92185 Symbols for the number sets. . . . . . . . . . . . . . . . . . . . . . 92186 Better script fonts for maths. . . . . . . . . . . . . . . . . . . . . . 92187 Setting bold Greek letters in LATEX . . . . . . . . . . . . . . . . . . 93188 The Principal Value Integral symbol. . . . . . . . . . . . . . . . . 94189 How to use the underscore character. . . . . . . . . . . . . . . . . 94190 How to type an ‘@’ sign?. . . . . . . . . . . . . . . . . . . . . . . 94191 Typesetting the Euro sign. . . . . . . . . . . . . . . . . . . . . . . 94

    S Macro programming 95S.1 “Generic” macros 95

    192 Finding the width of a letter, word, or phrase. . . . . . . . . . . . . 95193 Patching existing commands. . . . . . . . . . . . . . . . . . . . . 96194 Comparing the “job name”. . . . . . . . . . . . . . . . . . . . . . 96195 Is the argument a number?. . . . . . . . . . . . . . . . . . . . . . . 97196 Defining macros within macros. . . . . . . . . . . . . . . . . . . . 98197 Spaces in macros. . . . . . . . . . . . . . . . . . . . . . . . . . . . 98198 How to break the 9-argument limit. . . . . . . . . . . . . . . . . . 99199 Defining characters as macros. . . . . . . . . . . . . . . . . . . . . 100200 Active characters in command arguments. . . . . . . . . . . . . . . 101201 Defining a macro from an argument. . . . . . . . . . . . . . . . . . 102202 Transcribing LATEX command definitions. . . . . . . . . . . . . . . 102

    S.2 LATEX macros 103203 How to change LATEX’s “fixed names”. . . . . . . . . . . . . . . . . 103204 Changing the wordsbabeluses . . . . . . . . . . . . . . . . . . . . 104205 Running equation, figure and table numbering. . . . . . . . . . . . 104206 \@ and@ in macro names. . . . . . . . . . . . . . . . . . . . . . . 105207 What’s the reason for ‘protection’?. . . . . . . . . . . . . . . . . . 105208 \edef does not work with\protect . . . . . . . . . . . . . . . . . 106209 Optional arguments like\section . . . . . . . . . . . . . . . . . . 106210 Making labels from a counter. . . . . . . . . . . . . . . . . . . . . 106211 Finding if you’re on an odd or an even page. . . . . . . . . . . . . 106212 How to change the format of labels. . . . . . . . . . . . . . . . . . 107213 A command with two optional arguments. . . . . . . . . . . . . . . 107214 Adjusting the presentation of section numbers. . . . . . . . . . . . 107

    T Things are Going Wrong. . . 108T.1 Getting things to fit 108

    215 Enlarging TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108216 Why can’t I load PICTEX? . . . . . . . . . . . . . . . . . . . . . . . 108

    T.2 Making things stay where you want them 109217 Moving tables and figures in LATEX . . . . . . . . . . . . . . . . . . 109218 Underlined text won’t break. . . . . . . . . . . . . . . . . . . . . . 110219 Controlling widows and orphans. . . . . . . . . . . . . . . . . . . 111

    T.3 Things have “gone away” 111220 Old LATEX font references such as\tenrm . . . . . . . . . . . . . . 111221 Missing symbol commands. . . . . . . . . . . . . . . . . . . . . . 111222 Where are themsx andmsy fonts?. . . . . . . . . . . . . . . . . . . 111223 Where are theam fonts? . . . . . . . . . . . . . . . . . . . . . . . . 112

    U Why does itdo that? 112

    5

  • U.1 Common errors 112224 LATEX gets cross-references wrong. . . . . . . . . . . . . . . . . . . 112225 Start of line goes awry. . . . . . . . . . . . . . . . . . . . . . . . . 112226 Why doesn’t\verb work within. . . ? . . . . . . . . . . . . . . . . . 113227 No line here to end. . . . . . . . . . . . . . . . . . . . . . . . . . . 114

    U.2 Common misunderstandings 114228 What’s going on in my\include commands?. . . . . . . . . . . . 114229 Why does it ignore paragraph parameters?. . . . . . . . . . . . . . 115230 Case-changing oddities. . . . . . . . . . . . . . . . . . . . . . . . 115231 Why does LATEX split footnotes across pages?. . . . . . . . . . . . . 116232 Getting\marginpar on the right side . . . . . . . . . . . . . . . . 116233 Where have my characters gone?. . . . . . . . . . . . . . . . . . . 117234 “Rerun” messages won’t go away. . . . . . . . . . . . . . . . . . . 117235 Commands gobble following space. . . . . . . . . . . . . . . . . . 117236 (LA)TEX makes overfull lines. . . . . . . . . . . . . . . . . . . . . . 118

    V The joy of TEX errors 119237 How to approach errors. . . . . . . . . . . . . . . . . . . . . . . . 119238 The structure of TEX error messages. . . . . . . . . . . . . . . . . 120239 An extra ‘}’?? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121240 Capacity exceeded [semantic nest. . . ]. . . . . . . . . . . . . . . . . 121241 No room for a new ‘thing’ . . . . . . . . . . . . . . . . . . . . . . . 122242 epsf gives up after a bit. . . . . . . . . . . . . . . . . . . . . . . . 122243 Improper\hyphenation will be flushed . . . . . . . . . . . . . . . 122244 “Too many unprocessed floats”. . . . . . . . . . . . . . . . . . . . 123245 \spacefactor complaints . . . . . . . . . . . . . . . . . . . . . . 123246 \end occurred inside a group. . . . . . . . . . . . . . . . . . . . . 123247 “Missing number, treated as zero”. . . . . . . . . . . . . . . . . . . 124248 “Please type a command or say\end” . . . . . . . . . . . . . . . . 125249 “Unknown graphics extension”. . . . . . . . . . . . . . . . . . . . 125

    W Current TEX Projects 125250 The LATEX3 project . . . . . . . . . . . . . . . . . . . . . . . . . . . 125251 The Omega project. . . . . . . . . . . . . . . . . . . . . . . . . . 126252 TheNT S project . . . . . . . . . . . . . . . . . . . . . . . . . . . 126253 ThePDFTEX project . . . . . . . . . . . . . . . . . . . . . . . . . . 126254 FutureWEB technologies and (LA)TEX . . . . . . . . . . . . . . . . . 127255 The TEXtrace project. . . . . . . . . . . . . . . . . . . . . . . . . . 127256 The TEX document preparation environment. . . . . . . . . . . . . 128

    X You’re still stuck? 129257 You don’t understand the answer. . . . . . . . . . . . . . . . . . . 129258 Submitting new material for theFAQ . . . . . . . . . . . . . . . . . 129259 Reporting a LATEX bug . . . . . . . . . . . . . . . . . . . . . . . . . 129260 What to do if you find a bug. . . . . . . . . . . . . . . . . . . . . . 130

    ❧ ❧ ❧ ❧ ❧ ❧ ❧ ❧ ❧ ❧ ❧ ❧ ❧ ❧ ❧ ❧ ❧ ❧

    A Introduction

    This FAQ was originated by the Committee of theUK TEX Users’ Group (UK TUG)as a development of a regular posting to theUsenetnewsgroupcomp.text.tex thatwas maintained for some time by Bobby Bodenheimer. The firstUK version was muchre-arranged and corrected from the original, and little of Bodenheimer’s work nowremains.

    An HTML translation of theFAQ is available on the World-Wide Web, viaURLhttp://www.tex.ac.uk/faq; an alternativeHTML version is also to be found on theTEX Live CD-ROM (see question52).

    Most members of the committee ofUK TUG, over the years since 1994, have con-tributed to thisFAQ to some extent. The following people, who have never been mem-bers of the committee, have also contributed help or advice: Donald Arseneau, Bar-bara Beeton, Karl Berry, Giuseppe Bilotta, Damian Cugley, Michael Dewey, MichaelDownes, Thomas Esser, Anthony Goreham, Norman Gray, Eitan Gurari, John Hobby,Berthold Horn, Ian Hutchinson, Werner Icking, David Kastrup, Regnor Jernsletten,

    6

    http://www.tex.ac.uk/faq

  • Daniel Luecking, Sanjoy Mahajan, Andreas Matthias, Ted Nieland, Hans Nordhaug,Pat Rau, Heiko Oberdiek, Piet van Oostrum, Scott Pakin, Oren Patashnik, José CarlosSantos, Walter Schmidt, Joachim Schrod, Ulrik Vieth, Mike Vulis, Peter Wilson, RickZaccone and Reinhard Zierke.

    Finding the FilesUnless otherwise specified, all files mentioned in thisFAQ are available from aCTANarchive, or from one of their mirrors. Question45 gives details of theCTAN archives,and how to retrieve files from them. If you don’t have access to the Internet, question52tells you of sources ofCD-ROMs that offer snapshots of the archives.

    The reader should also note that the first directory name of the path name of everyfile on CTAN has been elided from what follows, for the simple reason that it’s alwaysthe same (tex-archive/).

    To avoid confusion, we’ve also elided the full stop1 from the end of any sentencewhose last item is a path name (such sentences are rare, and only occur at the end ofparagraphs). Though the path names are set in a different font from running text, it’snot easy to distinguish the font of a single dot!

    B The Background

    1 What is TEX?

    TEX is a typesetting system written byDonald E. Knuth, who says in the Preface to hisbook on TEX (see question22) that it is “intended for the creation of beautiful books —and especially for books that contain a lot of mathematics”.

    Knuth is Emeritus Professor of the Art of Computer Programming at Stanford Uni-versity in California,USA. Knuth developed the first version of TEX in 1978 to dealwith revisions to his series “the Art of Computer Programming”. The idea proved pop-ular and Knuth produced a second version (in 1982) which is the basis of what we usetoday.

    Knuth developed a system of ‘literate programming’ (see question64) to write TEX,and he provides the literate (WEB) source of TEX free of charge, together with tools forprocessing theweb source into something that can be compiled and something that canbe printed; there’s never any mystery about what TEX does. Furthermore, theWEBsystem provides mechanisms to port TEX to new operating systems and computers;and in order that one may have some confidence in the ports, Knuth supplied a test (seequestion5) by means of which one may judge the fidelity of a TEX system. TEX and itsdocuments are therefore highly portable.

    TEX is a macro processor, and offers its users a powerful programming capabil-ity. For this reason, TEX on its own is a pretty difficult beast to deal with, so Knuthprovided a package of macros for use with TEX called Plain TEX; Plain TEX is effec-tively the minimum set of macros one can usefully employ with TEX, together withsome demonstration versions of higher-level commands (the latter are better regardedas models than used as-is). When people say they’re “programming in TEX”, theyusually mean they’re programming in Plain TEX.

    2 How should I pronounce “TEX”?

    The ‘X’ stands for the lower case Greek letter Chi (χ — the upper-case Greek letterdoesn’t look in the least like a letter “X”), and is pronounced by English-speakers eithera bit like the ‘ch’ in the Scots word ‘loch’ ([x] in the IPA) or like ‘k’. It definitely is notpronounced ‘ks’.

    3 What is METAFONT?

    METAFONT was written by Knuth as a companion to TEX; whereas TEX defines thelayout of glyphs on a page,METAFONT defines the shapes of the glyphs and the re-lations between them.METAFONT details the sizes of glyphs, for TEX’s benefit, anddetails the rasters used to represent the glyphs, for the benefit of programs that willproduce printed output as post processes after a run of TEX.

    1‘Full stop’ (British English)==‘period’ (American English)

    7

    http://sunburn.stanford.edu/~knuth/

  • METAFONT’s language for defining fonts permits the expression of several classesof things: first (of course), the simple geometry of the glyphs; second, the properties ofthe print engine for which the output is intended; and third, ‘meta’-information whichcan distinguish different design sizes of the same font, or the difference between twofonts that belong to the same (or related) families.

    Knuth (and others) have designed a fair range of fonts usingMETAFONT, but fontdesign usingMETAFONT is much more of a minority skill than is TEX macro-writing.The complete TEX-user nevertheless needs to be aware ofMETAFONT, and to be ableto runMETAFONT to generate personal copies of new fonts.

    4 What is MetaPost?

    The MetaPost system (by John Hobby) implements a picture-drawing language verymuch like that ofMETAFONT except that it outputs Encapsulated PostScript files in-stead of run-length-encoded bitmaps. MetaPost is a powerful language for producingfigures for documents to be printed on PostScript printers, either directly or embed-ded in (LA)TEX documents. It includes facilities for directly integrating TEX text andmathematics with the graphics. (Knuth tells us that he uses nothing but MetaPost fordiagrams in text that he is writing.)

    The PostScript output is of such a simple form that MetaPost output files can bedirectly included inPDFLATEX

    2 documents (see question253).Much of MetaPost’s source code was copied fromMETAFONT’s sources with

    Knuth’s permission.

    5 How can I be sure it’s really TEX?

    TEX (andMETAFONT and MetaPost) are written in a ‘literate’ programming languagecalled Web (see question64) which is designed to be portable across a wide range ofcomputer systems. How, then, is a new version of TEX checked?

    Of course, any sensible software implementor will have his own suite of tests tocheck that his software runs: those who port TEX and its friends to other platforms doindeed perform such tests.

    Knuth, however, provides a ‘conformance test’ for both TEX (trip) andMETA-FONT (trap). He characterises these as ‘torture tests’: they are designed not to checkthe obvious things that ordinary typeset documents, or font designs, will exercise, butrather to explore small alleyways off the main path through the code of TEX. They are,to the casual reader, pretty incomprehensible!

    Once an implementation of TEX has passed itstrip, or an implementation ofMETAFONT has passed itstrap, test it may reasonably be distributed as a workingversion.

    6 Are TEX and friends Y2K compliant?

    Crashing: None of TEX, METAFONT or MetaPost can themselves crash due to anychange whatever in the date of any sort.

    Timestamps: In the original sources, a 2-digit year was stored as the creation time forformat files and that value is printed in logfiles. These items should not be ofgeneral concern, since the only use of the date format file is to produce the logoutput, and the log file is designed for human readers only.Knuth announced in 1998 that implementators could alter this code without fearof being accused of non-compliance. Nearly all implementations that are beingactively maintained had been modified to generate 4-digit years in the format fileand the log, by the end of 1998. The original sources themselves have now beenmodified so that 4-digit year numbers are stored.

    The \year primitive: Certification of a TEX implementation (see question5) doesnot require that\year return a meaningful value (which means that TEX can, inprinciple, be implemented on platforms that don’t make the value of the clockavailable to user programs). TheTEXbook(see question22) defines\year as“the current year of our Lord”, which is the only correct meaning for\yearfor those implementations which can supply a meaningful value, which is to saynearly all of them.

    2PDFLATEX cannot normally handle PostScript inclusions

    8

  • In short, TEX implementations should provide a value in\year giving the 4-digit year Anno Domini, or the value 1776 if the platform does not support adate function.Note that if the system itself fails to deliver a correct date to TEX, then\year willof course return an incorrect value. TEX cannot be considered Y2K compliant,in this sense, on a system that is not itself Y2K compliant.

    Macros: TEX macros can in principle perform calculations on the basis of the valueof \year. The LATEX suite (see question7) performs such calculations in a smallnumber of places; the calculations performed in the current (supported) versionof LATEX are known to be Y2K compliant.Other macros and macro packages should be individually checked.

    External software: Software such asDVI translators needs to be individually checked.

    7 What is LATEX?

    LATEX is a TEX macro package, originally written by Leslie Lamport, that provides adocument processing system. LATEX allows markup to describe the structure of a doc-ument, so that the user need not think about presentation. By using document classesand add-on packages, the same document can be produced in a variety of differentlayouts.

    Lamport says that LATEX “ represents a balance between functionality and ease ofuse”. This shows itself as a continual conflict that leads to the need for such things asFAQs: LATEX canmeet most user requirements, but finding outhow is often tricky.

    8 What is LATEX 2ε?

    Lamport’s last version of LATEX (LATEX 2.09, last updated in 1992) was supersededin 1994 by a new version (LATEX 2ε) written by the LATEX team (see question250).LATEX 2ε is now the only readily-available version of LATEX, and draws together severalthreads of LATEX development from the later days of LATEX 2.09.

    LATEX 2ε has several enhancements over LATEX 2.09, but they were all rather minor,with a view to continuity and stability rather than the “big push” that some had expectedfrom the team. LATEX 2ε continues to this day to offer a compatibility mode in whichmost files prepared for use with LATEX 2.09 will run (albeit with somewhat reducedperformance). Differences between LATEX 2ε and LATEX 2.09 are outlined in a series of‘guide’ files that are available in every LATEX distribution; the most important of thesefiles is available on the Web ashttp://www.tex.ac.uk/tex-archive/macros/latex/doc/html/usrguide/ and outlines the differences as seen by the ordinarywriter of documents and of simple macros.

    9 How should I pronounce “LATEX(2ε)”?

    Lamport never recommended how one should pronounce LATEX, but a lot of peoplepronounce it ‘Lay TEX’ or perhaps ‘Lah TEX’ (with TEX pronounced as the programitself; see question2). It is definitely not to be pronounced in the same way as therubber-tree gum.

    The ‘epsilon’ in ‘LATEX 2ε’ is supposed to be suggestive of a small improvementover the old LATEX 2.09. Nevertheless, most people pronounce the name as ‘LATEX-two-ee’.

    10 Should I use Plain TEX or LATEX?

    There’s no straightforward answer to this question. Many people swear by Plain TEX,and produce highly respectable documents using it (Knuth is an example of this, ofcourse). But equally, many people are happy to let someone else take the design deci-sions for them, accepting a small loss of flexibility in exchange for a saving of brainpower.

    The arguments around this topic can provoke huge amounts of noise and heat, with-out offering much by way of light; your best bet is to find out what those around youare using, and to go with the crowd. Later on, you can always switch your allegiance;don’t bother about it.

    If you are preparing a manuscript for a publisher or journal, ask them what markupthey want before you develop your own; many big publishers have developed theirown (LA)TEX styles for journals and books, and insist that authors stick closely to theirmarkup.

    9

    http://www.tex.ac.uk/tex-archive/macros/latex/doc/html/usrguide/http://www.tex.ac.uk/tex-archive/macros/latex/doc/html/usrguide/

  • 11 How does LATEX relate to Plain TEX?

    LATEX is a program written in the programming language TEX. (In the same sense, anyLATEX document is also a program, which is designed to run ‘alongside’, or ‘inside’LATEX, whichever metaphor you prefer.)

    Plain TEX is also a program written in the programming language TEX.Both exist because writing your documents in ‘raw’ TEX would involve much rein-

    venting of wheels for every document. They both serve as convenient aids to makedocument writing more pleasant: LATEX is a far more extensive aid.

    LATEX is close to being a superset of Plain TEX. Many documents designed for PlainTEX will work with LATEX with no more than minor modifications (though some willrequire substantial work).

    Interpretation of any (LA)TEX program involves some data-driven elements, andLATEX has a wider range of such elements than does Plain TEX. As a result, the mappingfrom LATEX to Plain TEX is far less clear than that in the other direction.

    12 What is ConTEXt?

    ConTEXt is a macro package developed by Hans Hagen, originally to serve the needsof the Dutch firm, Pragma. It was designed with the same general-purpose aims asLATEX, but (being younger) reflects much more recent thinking about the structure ofmarkup, etc. In particular, ConTEXt can customise its markup to an author’s language(customising modules for Dutch, English and German are provided, at present).

    ConTEXt is well integrated, in all of its structure, with the needs of hypertextmarkup, and in particular with the facilities offered byPDFTEX (see question253).The default installation employs a version of TEX built with both thePDFTEX and ε-TEX (see question252) extensions, and makes good use of both.

    ConTEXt doesn’t yet have quite such a large developer community as does LATEX,but those developers who are active seem to have prodigious energy.

    ConTEXt distribution: macros/context

    13 What are theAMS packages (AMS-TEX, etc.)?AMS-TEX is a TEX macro package, originally written by Michael Spivak for the Amer-ican Mathematical Society (AMS) during 1983–1985 and is described in the book “TheJoy of TEX” (see question22). It is based on Plain TEX, and provides many features forproducing more professional-looking maths formulas with less burden on authors. Itpays attention to the finer details of sizing and positioning that mathematical publisherscare about. The aspects covered include multi-line displayed equations, equation num-bering, ellipsis dots, matrices, double accents, multi-line subscripts, syntax checking(faster processing on initial error-checking TEX runs), and other things.

    As LATEX increased in popularity, authors asked to submit papers to theAMS inLATEX, and so theAMS developedAMS-LATEX, which is a collection of LATEX packagesand classes that offer authors most of the functionality ofAMS-TEX.AMS-TEX distribution: macros/amstexAMS-LATEX distribution: macros/latex/required/amslatex

    14 What is Eplain?

    The Eplain macro package expands on and extends the definitions in Plain TEX. Eplainis not intended to provide “generic typesetting capabilities”, as do LATEX or Texinfo (seequestion16). Instead, it provides definitions that are intended to be useful regardlessof the high-level commands that you use when you actually prepare your manuscript.

    For example, Eplain does not have a command\section, which would formatsection headings in an “appropriate” way, as LATEX’s \section. The philosophy ofEplain is that some people will always need or want to go beyond the macro designer’sidea of “appropriate”. Such canned macros are fine — as long as you are willing toaccept the resulting output. If you don’t like the results, or if you are trying to match adifferent format, you are out of luck.

    On the other hand, almost everyone would like capabilities such as cross-referencingby labels, so that you don’t have to put actual page numbers in the manuscript. KarlBerry, the author of Eplain, says he is not aware of any generally available macropackages that do not force their typographic style on an author, and yet provide suchcapabilities.

    10

    http://www.ntg.nl/context/ftp://ftp.tex.ac.uk/tex-archive/macros/context.zipftp://ftp.tex.ac.uk/tex-archive/macros/amstex.zipftp://ftp.tex.ac.uk/tex-archive/macros/latex/required/amslatex.zip

  • Eplain distribution: macros/eplain

    15 What is Lollipop?

    Lollipop is a macro package written by Victor Eijkhout; it was used in the productionof his book “TEX by Topic” (see question27). The manual says of it:

    Lollipop is ‘TEX made easy’. Lollipop is a macro package that functionsas a toolbox for writing TEX macros. It was my intention to make macrowriting so easy that implementing a fully new layout in TEX would becomea matter of less than an hour for an average document, and that it wouldbe a task that could be accomplished by someone with only a very basictraining in TEX programming.

    Lollipop is an attempt to make structured text formatting available forenvironments where previously onlyWYSIWYG packages could be usedbecause adapting the layout is so much more easy with them than withtraditional TEX macro packages.

    The manual goes on to talk of ambitions to “capture some of the LATEX marketshare”; it’s a very witty package, but little sign of it taking over from LATEX is de-tectable. . . An article about Lollipop appeared inTUGboat 13(3).

    Lollipop distribution: macros/lollipop

    16 What is Texinfo?

    Texinfo is a documentation system that uses one source file to produce both on-lineinformation and printed output. So instead of writing two different documents, one forthe on-line help and the other for a typeset manual, you need write only one documentsource file. When the work is revised, you need only revise one document. You canread the on-line information, known as an “Info file”, with an Info documentation-reading program. By convention, Texinfo source file names end with a.texi or.texinfo extension. You can write and format Texinfo files into Info files withinGNU emacs, and read them using theemacsInfo reader. You can also format Texinfofiles into Info files usingmakeinfoand read them usinginfo, so you’re not dependenton emacs. The distribution includes aPerl script, texi2html, that will convert Texinfosources intoHTML .

    Texinfo distribution: macros/texinfo/texinfo

    17 If TEX is so good, how come it’s free?

    It’s free because Knuth chose to make it so. He is nevertheless apparently happy thatothers should earn money by selling TEX-based services and products. While severalvaluable TEX-related tools and packages are offered subject to restrictions imposed bytheGNU General Public Licence (‘Copyleft’), TEX itself is not subject to Copyleft.

    There are commercial versions of TEX available; for some users, it’s reassuringto have paid support. What is more, some of the commercial implementations havefeatures that are not available in free versions. (The reverse is also true: some freeimplementations have features not available commercially.)

    This FAQ concentrates on ‘free’ distributions of TEX, but we do at least list themajor vendors (see question55).

    18 What is the future of TEX?

    Knuth has declared that he will do no further development of TEX; he will continue tofix any bugs that are reported to him (though bugs are rare). This decision was madesoon after TEX version 3.0 was released; at each bug-fix release the version numberacquires one more digit, so that it tends to the limitπ (at the time of writing, Knuth’slatest release is version 3.14159). Knuth wants TEX to be frozen at versionπ when hedies; thereafter, no further changes may be made to Knuth’s source. (A similar rule isapplied toMETAFONT; its version number tends to the limite, and currently stands at2.718.)

    There are projects (some of them long-term projects: see, for example, ques-tion 250) to build substantial new macro packages based on TEX. For the even longerterm, there are various projects to build asuccessorto TEX; see questions251and 252.

    11

    ftp://ftp.tex.ac.uk/tex-archive/macros/eplain.zipftp://ftp.tex.ac.uk/tex-archive/macros/lollipop.zipftp://ftp.tex.ac.uk/tex-archive/macros/texinfo/texinfo.zip

  • 19 Reading (LA)TEX files

    So you’ve been sent a TEX file: what are you going to do with it? Well, the good newsis that TEX systems are available, free, for most sorts of computer; the bad news is thatyou need a pretty complete TEX system even to read a single file, and complete TEXsystems are pretty large.

    TEX is a typesetting system that arose from a publishing project (see question1),and its basic source is available free from its author. However, at its root, it isjust atypesetting engine: even to view or to print the typeset output, you will need ancil-iary programs. In short, you need a TEX distribution — a collection of TEX-relatedprograms tailored to your operating system: for details of the sorts of things that areavailable, see question53or 55 (for commercial distributions).

    But beware — TEX makes no attempt to look like the sort ofWYSIWYG systemyou’re probably used to (see question20): while many modern versions of TEX have acompile–view cycle that rivals the best commercial word processors in its responsive-ness, what you type is usuallymark-up, which typically defines a logical (rather than avisual) view of what you want typeset.

    However, in this context markup proves to be a blessing in disguise: a good pro-portion of most TEX documents is immediately readable in an ordinary text editor. So,while you need to install a considerable system to attain the full benefits of the TEXdocument that you were sent, the chances are you can understand quite a bit of it withnothing more than the ordinary tools you already have on your computer.

    20 Why is TEX not a WYSIWYG system?

    WYSIWYG is a marketing term (“What you see is what you get”) for a particular styleof text processor. WYSIWYG systems are characterised by two principal claims: thatyou type what you want to print, and that what you see on the screen as you type is aclose approximation to how your text will finally be printed.

    The simple answer to the question is, of course, that TEX was conceived long be-fore the marketing term, at a time when the marketing imperative wasn’t perceived assignificant. However, that was a long time ago: why has nothing been done with the“wonder text processor” to make it fit with modern perceptions?

    There are two answers to this. First, the simple “thingshavebeen done” (butthey’ve not taken over the TEX world); and second, “there are philosophical reasonswhy the way TEX has developed is ill-suited to theWYSIWYG style”. Indeed, there is afundamental problem with applyingWYSIWYG techniques to TEX: the complexity ofTEX makes it hard to get the equivalent of TEX’s output without actually running TEX.

    A celebrated early system offering “WYSIWYG using TEX” came from the VorTEXproject: a pair of (early) Sun workstations worked in tandem, one handling the user in-terface while the other beavered away in the background typesetting the result. VorTEXwas quite impressive for its time, but the two workstations combined had hugely lesspower than the average sub-thousand dollar Personal Computer nowadays, and its codehas not proved portable (it never even made the last ‘great’ TEX version change, at theturn of the 1990s, to TEX version 3). Modern systems that are similar in their approachare Lightning Textures (an extension of Blue Sky’s original TEX system for the Macin-tosh), and Scientific Word (which can also cooperate with a computer algebra system);both these systems are commercially available (see question55).

    The issue has of recent years started to attract attention from TEX developers, andseveral interesting projects addressing the “TEX document preparation environment”(see question256) are in progress.

    Nevertheless, The TEX world has taken a long time to latch onto the idea ofWYSI-WYG. Apart from simple arrogance (“we’re better, and have no need to consider thepetty doings of the commercial word processor market”), there is a real conceptualdifference between the word processor model of the world and the model LATEX andConTEXt employ — the idea of “markup”. “Pure” markup expresses a logical modelof a document, where every object within the document is labelled according to whatit is rather than how it should appear: appearance is deduced from the properties ofthe type of object. Properly applied, markup can provide valuable assistance when itcomes to re-use of documents.

    EstablishedWYSIWYG systems find the expression of this sort of structured markupdifficult; however, markupis starting to appear in the lists of the commercial world’srequirements, for two reasons. First, an element of markup helps impose style on a

    12

  • document, and commercial users are increasingly obsessed with uniformity of style;and second, the increasingly pervasive use ofXML -derived document archival formatsdemands it. The same challenges must needs be addressed by TEX-based documentpreparation support schemes, so we are observing a degree of confluence of the needsof the two communities: interesting times may be ahead of us.

    21 TEX User Groups

    There has been a TEX User Group since very near the time TEX first appeared. Thatfirst group,TUG, is still active and its journalTUGboat continues in publication (4issues a year) with articles about TEX, METAFONT and related technologies, and aboutdocument design, processing and production.TUG holds a yearly conference, whoseproceedings are published inTUGboat.

    TUG’s web site is a valuable resource for all sorts of TEX-related matters, such asdetails of TEX software, and lists of TEX vendors and TEX consultants. Back articlesfrom TUGboat are slowly (subject to copyright issues, etc.) making their way to thesite, too.

    Some time ago,TUG established a “technical council”, whose task was to overseethe development of TEXnical projects. Most such projects nowadays go on their waywithout any support fromTUG, butTUG’s web site lists itsTechnical Working Groups(TWGs).

    TUG has a reasonable claim to be considered a world-wide organisation, but thereare many national and regional user groups, too;TUG’s web site maintains a list of“Local User Groups” (LUGs).

    ContactTUG itself via:

    TEX Users Group1466 NW Front Avenue, Suite 3141Portland, OR 97209USA

    Tel: +1 503-223-9994Fax: +1 503-223-3960Email: [email protected]:http://www.tug.org/

    C Documentation and Help

    22 Books on TEX and its relations

    While Knuth’s book is the definitive reference for TEX, there are other books coveringTEX:

    The TEXbook by Donald Knuth (Addison-Wesley, 1984,ISBN 0-201-13447-0, paper-backISBN 0-201-13448-9)

    A Beginner’s Book of TEX by Raymond Seroul and Silvio Levy, (Springer Verlag,1992,ISBN 0-387-97562-4)

    TEX by Example: A Beginner’s Guideby Arvind Borde (Academic Press, 1992,ISBN 0-12-117650-9 — now out of print)

    Introduction to TEX by Norbert Schwarz (Addison-Wesley, 1989,ISBN 0-201-51141-X — now out of print)

    A Plain TEX Primer by Malcolm Clark (Oxford University Press, 1993, ISBNs 0-198-53724-7 (hardback) and 0-198-53784-0 (paperback))

    TEX by Topic by Victor Eijkhout (Addison-Wesley, 1992,ISBN 0-201-56882-9 — nowout of print, but see question27)

    TEX for the Beginnerby Wynter Snow (Addison-Wesley, 1992,ISBN 0-201-54799-6)

    TEX for the Impatientby Paul W. Abrahams, Karl Berry and Kathryn A. Hargreaves(Addison-Wesley, 1990,ISBN 0-201-51375-7)

    TEX in Practice by Stephan von Bechtolsheim (Springer Verlag, 1993, 4 volumes,ISBN 3-540-97296-X for the set, or Vol. 1:ISBN 0-387-97595-0, Vol. 2:ISBN 0-387-97596-9, Vol. 3:ISBN 0-387-97597-7, and Vol. 4:ISBN 0-387-97598-5)

    13

    http://www.tug.org/twg.htmlhttp://www.tug.org/twg.htmlhttp://www.tug.org/lugs.htmlmailto:[email protected]://www.tug.org/

  • TEX: Starting from 13 by Michael Doob (Springer Verlag, 1993,ISBN 3-540-56441-

    1 — now out of print)

    The Joy of TEX by Michael D. Spivak (second edition,AMS, 1990,ISBN 0-821-82997-1)

    The Advanced TEXbook by David Salomon (Springer Verlag, 1995,ISBN 0-387-94556-3)

    A collection of Knuth’s publications about typography has recently been published:

    Digital Typographyby Donald Knuth (CSLI and Cambridge University Press, 1999,ISBN 1-57586-011-2, paperbackISBN 1-57586-010-4).

    and in late 2000, a “Millennium Boxed Set” of all 5 volumes of Knuth’s “Comput-ers and Typesetting” series (about TEX and METAFONT) was published by AddisonWesley:

    Computers & Typesetting, Volumes A–E Boxed Setby Donald Knuth (Addison-Wesley,2001,ISBN 0-201-73416-8).

    For LATEX, see:

    LATEX, a Document Preparation Systemby Leslie Lamport (second edition, AddisonWesley, 1994,ISBN 0-201-52983-1)

    A guide to LATEX Helmut Kopka and Patrick W. Daly (third edition, Addison-Wesley,1998,ISBN 0-201-39825-7)

    The LATEX Companionby Michel Goossens, Frank Mittelbach, and Alexander Samarin(Addison-Wesley, 1993,ISBN 0-201-54199-8)

    The LATEX Graphics Companion:Illustrating documents with TEX and PostScriptbyMichel Goossens, Sebastian Rahtz and Frank Mittelbach (Addison-Wesley,1997,ISBN 0-201-85469-4)

    The LATEX Web Companion:Integrating TEX, HTML andXML by Michel Goossens andSebastian Rahtz (Addison-Wesley, 1999,ISBN 0-201-43311-7)

    TEX Unbound: LATEX and TEX strategies for fonts, graphics, and moreby Alan Hoenig(Oxford University Press, 1998,ISBN 0-19-509685-1 hardback,ISBN 0-19-509686-X paperback)

    Math into LATEX: An Introduction to LATEX andAMS-LATEX by George Gr̈atzer (thirdedition Birkḧauser and Springer Verlag, 2000,ISBN 0-8176-4431-9,ISBN 3-7643-4131-9)

    A list of errata for the first printing is available from:http://www.springer-ny.com/catalog/np/jan99np/0-387-98708-8.html

    First Steps in LATEX by George Gr̈atzer (Birkḧauser, 1999,ISBN 0-8176-4132-7)

    LATEX: Line by Line: Tips and Techniques for Document Processingby Antoni Diller(second edition, John Wiley & Sons, 1999,ISBN 0-471-97918-X)

    LATEX for Linux: A Vade Mecumby Bernice Sacks Lipkin (Springer-Verlag, 1999,ISBN 0-387-98708-8, second printing)

    A sample of George Grätzer’s “Math into LATEX”, in Adobe Acrobat format, and exam-ple files for the LATEX Graphics and Web Companions, and for Grätzer’s “First Steps inLATEX”, are all available onCTAN.

    The list forMETAFONT is rather short:

    TheMETAFONTbook by Donald Knuth (Addison Wesley, 1986,ISBN 0-201-13445-4, ISBN 0-201-52983-1 paperback)

    Alan Hoenig’s ‘TEX Unbound ’ includes some discussion and examples of usingMETAFONT.

    This list only covers books in English: notices of new books, or warnings thatbooks are now out of print are always welcome. However, we donot carry reviews ofcurrent published material.

    3That’s ‘Starting from Square One’

    14

    http://www.springer-ny.com/catalog/np/jan99np/0-387-98708-8.htmlhttp://www.springer-ny.com/catalog/np/jan99np/0-387-98708-8.html

  • Examples for First Steps in LATEX: info/FirstSteps

    Examples for LATEX Graphics Companion: info/lgc

    Examples for LATEX Web Companion: info/lwc

    Sample of Math into LATEX: info/mil/mil.pdf

    23 Books on Type

    The following is a partial listing of books on typography in general. Of these,Bringhurst seems to be the one most often recommended.

    The Elements of Typographic Styleby Robert Bringhurst (Hartley & Marks, 1992,ISBN 0-88179-033-8)

    Finer Points in the Spacing & Arrangement of Typeby Geoffrey Dowding (Hartley &Marks, 1996,ISBN 0-88179-119-9)

    The Thames & Hudson Manual of Typographyby Ruari McLean (Thames & Hudson,1980,ISBN 0-500-68022-1)

    The Form of the Bookby Jan Tschichold (Lund Humphries, 1991,ISBN 0-85331-623-6)

    Type & Layoutby Colin Wheildon (Strathmore Press, 1995,ISBN 0-9624891-5-8)

    The Design of Booksby Adrian Wilson (Chronicle Books, 1993,ISBN 0-8118-0304-X)

    There are many catalogues of type specimens but the following books provide amore interesting overall view of types in general and some of their history.

    Alphabets Old & Newby Lewis F. Day (Senate, 1995,ISBN 1-85958-160-9)

    An Introduction to the History of Printing Typesby Geoffrey Dowding (British Li-brary, 1998, UKISBN 0-7123-4563-9; USAISBN 1-884718-44-2)

    The Alphabet Abecedariumby Richar A. Firmage (David R. Godine, 1993,ISBN 0-87923-998-0)

    The Alphabet and Elements of Letteringby Frederick Goudy (Dover, 1963,ISBN 0-486-20792-7)

    Anatomy of a Typefaceby Alexander Lawson (David R. Godine, 1990,ISBN 0-87923-338-8)

    A Tally of Typesby Stanley Morison (David R. Godine, 1999,ISBN 1-56792-004-7)

    Counterpunchby Fred Smeijers (Hyphen, 1996,ISBN 0-907259-06-5)

    Treasury of Alphabets and Letteringby Jan Tschichold (W. W. Norton, 1992,ISBN 0-393-70197-2)

    A Short History of the Printed Wordby Warren Chappell and Robert Bringhurst (Hart-ley & Marks, 1999,ISBN 0-88179-154-7)

    The above lists are limited to books published in English. Typographic styles aresomewhat language-dependent, and similarly the ‘interesting’ fonts depend on the par-ticular writing system involved.

    24 Where to find FAQs

    Bobby Bodenheimer’s article, from which thisFAQ was developed, used to be posted(nominally monthly) to newsgroupcomp.text.tex and cross-posted to newsgroupsnews.answers andcomp.answers. The (long obsolete) last posted copy of that ar-ticle is kept onCTAN for auld lang syne; it is no longer kept in thenews.answersarchives.

    A version of thepresentFAQ may be browsed via the World-Wide Web, and itssources are available fromCTAN.

    Another excellent information source, available in English, is the(LA)TEX navigator.Both the Francophone TEX usergroup Gutenberg and the Czech/Slovak usergroup

    CS-TUG have published translations of thisFAQ, with extensions appropriate to theirlanguages.

    Other non-EnglishFAQs are available:

    15

    ftp://ftp.tex.ac.uk/tex-archive/info/FirstSteps.zipftp://ftp.tex.ac.uk/tex-archive/info/lgc.zipftp://ftp.tex.ac.uk/tex-archive/info/lwc.zipftp://ftp.tex.ac.uk/tex-archive/info/mil/mil.pdfhttp://www.tex.ac.uk/faqhttp://tex.loria.fr

  • German Posted regularly tode.comp.tex, and archived onCTAN; the FAQ also ap-pears athttp://www.dante.de/faq/de-tex-faq/

    French Posted regularly tofr.comp.text.tex, and archived onCTAN.

    SpanishSeehttp://apolo.us.es/CervanTeX/FAQ/

    CzechSeehttp://www.fi.muni.cz/cstug/csfaq/

    DanteFAQ: usergrps/dante/de-tex-faq

    FrenchFAQ: help/LaTeX-FAQ-francaise

    Sources of thisFAQ: help/uk-tex-faq

    Obsoletecomp.text.tex FAQ: obsolete/help/TeX,_LaTeX,_etc.:_Frequently_Asked_Questions_with_Answers

    25 Where to get help

    First . . . read anyFAQ you can find. (Which is what you’re doing now, isn’t it?)An ambitiousFAQ-like project to collect all TEX-related information into one place

    is under way athttp://www.ctv.es/USERS/irmina/TeEncontreX.html; as withany FAQ, this project needs the support and help of all users — as yet, it carries anincomplete set of answers to potential questions. The sources of the package (includinga complete set ofhtml files) are available:info/spanish/TeEncontreX

    The tutorials and other on-line documentation (see question27) can get you startedbut for more in-depth understanding you should get and read at least one of the manygood books on the subject (see question22). The definitive source for (LA)TEX is thesource code itself, but that is not something to be approached lightly (if at all).

    If you are seeking a particular package or program, look on your own system first:you might already have it — the better TEX distributions contain a wide range of sup-porting material.

    If you have access to the internet, and in particular newsgroups, then (LA)TEX dis-cussions, includingMETAFONT and MetaPost, are oncomp.text.tex. It is best tospend a little time familiarising yourself with the current threads before asking a ques-tion. The group is normally very responsive but asking a question that has just beenanswered is likely to dampen people’s enthusiasm to help you.

    http://groups.google.com/ archives Usenet news discussions, andcomp.text.tex may be found there. Google’s archive now goes impressively far back intime (beforecomp.text.tex even existed), and it is a powerful resource for trackingdown that recommendation that no-one can now remember. Google also now allowsyou to post your own questions or followups.

    The few people who can’t use the World Wide Web, can’t access Usenet news, butcan use electronic mail can seek help through mailing lists.

    The TEXhax digest is nowadays operated as a moderated “MailMan” mailing list:its members now have the option of receiving messages in ‘real time’, and answersare more quickly forthcoming than ever they were in the past. Subscribe viahttp://lists.nottingham.ac.uk/mailman/listinfo/texhax; past digests are availableon CTAN.

    Many mailing lists exist that cover some small part of the TEX arena. A good sourceof pointers ishttp://www.tug.org/

    Announcements of TEX-related installations on theCTAN archives are sent tothe mailing listctan-ann. Subscribe to the list by sending a message ‘subscribectan-ann ’ to [email protected]

    Issues related toMETAFONT (and, increasingly, MetaPost) are discussed onthe metafont mailing list; subscribe by sending a message ‘subscribe metafont’ to [email protected]

    A few other TEX-related lists may be accessed [email protected]. Send a message containing the line ‘help’ to this address, or browsehttp://listserv.uni-heidelberg.de/cgi-bin/wa

    TEXhax digests: Browsedigests/texhax

    26 How to ask a question

    You want help from the community at large; you’ve decided where you’re going to askyour question (see question25), but how do you phrase it?

    16

    http://www.dante.de/faq/de-tex-faq/http://apolo.us.es/CervanTeX/FAQ/http://www.fi.muni.cz/cstug/csfaq/ftp://ftp.tex.ac.uk/tex-archive/usergrps/dante/de-tex-faq.zipftp://ftp.tex.ac.uk/tex-archive/help/LaTeX-FAQ-francaise.zipftp://ftp.tex.ac.uk/tex-archive/help/uk-tex-faq.zipftp://ftp.tex.ac.uk/tex-archive/obsolete/help/TeX,_LaTeX,_etc.:_Frequently_Asked_Questions_with_Answersftp://ftp.tex.ac.uk/tex-archive/obsolete/help/TeX,_LaTeX,_etc.:_Frequently_Asked_Questions_with_Answershttp://www.ctv.es/USERS/irmina/TeEncontreX.htmlftp://ftp.tex.ac.uk/tex-archive/info/spanish/TeEncontreX.ziphttp://groups.google.com/http://lists.nottingham.ac.uk/mailman/listinfo/texhaxhttp://lists.nottingham.ac.uk/mailman/listinfo/texhaxhttp://www.tug.org/mailto:[email protected]:[email protected]:[email protected]:[email protected]://listserv.uni-heidelberg.de/cgi-bin/wahttp://listserv.uni-heidelberg.de/cgi-bin/waftp://ftp.tex.ac.uk/tex-archive/digests/texhax/

  • Excellent “general” advice (how to ask questions of anyone) is contained inEricRaymond’s article on the topic. Eric’s an extremely self-confident person, and thiscomes through in his advice; but his guidelines are very good, even for us in the un-self-confident majority. It’s important to remember that you don’t have a right to advicefrom the world, but that if you express yourself well, you will usually find someonewho will be pleased to help.

    So how do you express yourself in the (LA)TEX world? There aren’t any compre-hensive rules, but a few guidelines may help in the application of your own commonsense.

    1. Make sure you’re asking the right people. Don’t ask in a TEX forum about printerdevice drivers for theFoobaroperating system. Yes, TEX users need printers, butno, TEX users will typicallynot beFoobarsystems managers.Similarly, avoid posing a question in a language that the majority of the groupdon’t use: post in Ruritanian tode.comp.text.tex and you may have a longwait before a German- and Ruritanian-speaking TEX expert notices your ques-tion.

    2. If your question is (or may be) TEX-system-specific, report what system you’reusing, or intend to use: “I can’t install TEX” is as good as useless, whereas “I’mtrying to install themumbleTeXdistribution on theGrobbleoperating system”gives all the context a potential respondent might need. Another common situa-tion where this information is important is when you’re having trouble installingsomething new in your system.

    3. If you need to know how to do something, make clear what your environmentis. “I want to dox in Plain TEX”, or “I want to do y in LATEX running theboggleclass”.

    4. If something’s going wrong, pretend you’re submitting a LATEX bug report (seequestion259), and try to generate a minimum failing example. If your exampleneeds your localxyzthesisclass, or some other resource not generally available,be sure to include a pointer to how the resource can be obtained.

    5. Be as succinct as possible. Your helpers probably don’t need to knowwhyyou’redoing something, justwhatyou’re doing and where the problem is.

    27 (LA)TEX Tutorials, etc.

    Some very fine tutorials have been written, over the years. Michael Doob’s splen-did ‘Gentle Introduction’ to Plain TEX has been stable for a very long time. An-other contender in the same game is from one D. R. Wilkins, available on the webathttp://www.ntg.nl/doc/wilkins/pllong.pdf

    More dynamic is Tobias Oetiker’s ‘(Not so) Short Introduction to LATEX 2ε’, whichis regularly updated, as people suggest better ways of explaining things, etc. The intro-duction has been translated into several languages other than its original English.

    Harvey Greenberg’s ‘Simplified Introduction to LATEX’ was written for a lecturecourse, and is available onCTAN (in PostScript only, unfortunately).

    Peter Flynn’s‘Beginner’s LATEX’ isn’t yet (April 2002) complete, but is anotherpleasing read. It too started as course material.

    TheAMS publishes a “Short Math Guide for LATEX”, which is available (in severalformats) viahttp://www.ams.org/tex/short-math-guide.html

    Reference material is somewhat more difficult to come by. A sterling example isset by David Bausum’slist of TEX primitives.

    Some university departments make their local documentation available on theweb. Most straightforwardly, there’s the simple translation of existing documenta-tion into HTML , for example theINFO documentation of the (LA)TEX installation, ofwhich a sample is the LATEX documentation available athttp://www.tac.dk/cgi-bin/info2www?(latex)

    More ambitiously, some departments have enthusiastic documenters who makepublic record of their (LA)TEX support. For example, Tim Love (of Cambridge Uni-versity Engineering Department) maintains his deparment’s excellent pageshttp://www-h.eng.cam.ac.uk/help/tpl/textprocessing/

    Another summary by command (somewhat akin to David Basum’s work for PlainTEX) is to be found athttp://www.giss.nasa.gov/latex/ltx-2.html

    People have long argued for (LA)TEX books to be made available on the web, andVictor Eijkhout’s excellent “TEX by Topic” (previously published by Addison-Wesley,

    17

    http://www.tuxedo.org/~esr/faqs/smart-questions.htmlhttp://www.tuxedo.org/~esr/faqs/smart-questions.htmlhttp://www.ntg.nl/doc/wilkins/pllong.pdfhttp://www.silmaril.ie/downloads/documents/beginlatex.pdfhttp://www.ams.org/tex/short-math-guide.htmlhttp://www.tug.org/utilities/plain/cseq.htmlhttp://www.tac.dk/cgi-bin/info2www?(latex)http://www.tac.dk/cgi-bin/info2www?(latex)http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/http://www.giss.nasa.gov/latex/ltx-2.html

  • but long out of print) was offered in this way at Christmas 2001. The book is currentlyavailable athttp://www.eijkhout.net/tbt/; it’s not a beginner’s tutorial but it’sa fine reference (contributions are invited, and the book is well worth the suggestedcontribution).

    Gentle Introduction: info/gentle/gentle.pdf

    Not so Short Introduction: info/lshort/english/lshort.pdf

    Simplified LATEX: info/simplified-latex/latex.ps

    28 Learning to write LATEX classes and packages

    There’s nothing particularly magic about the commands you use when writing a pack-age, so you can simply bundle up a set of LATEX \(re)newcommand and\(re)newenvironmentcommands, put them in a filepackage.sty and you have a package.

    However, any but the most trivial package will require rather more sophistication.Some details of LATEX commands for the job are to be found in ‘LATEX 2ε for class andpackage writers’ (http://www.tex.ac.uk/tex-archive/macros/latex/doc/html/clsguide: the LATEX source of this document appears in the LATEX distribution).Beyond this, a good knowledge of TEX itself is valuable. With such knowledge it ispossible to use the documented source of LATEX as reference material (dedicated authorswill acquaint themselves with the source as a matter of course). A complete set of thedocumented source of LATEX may be prepared by processing the filesource2e.tex inthe LATEX distribution.

    Writing good classes is not easy; it’s a good idea to read some established ones(classes.dtx, for example, produces the standard classes other thanletter, andmay itself be formatted with LATEX). Classes that are not part of the distributionare commonly based on ones that are, and start by loading the standard class with\LoadClass — an example of this technique may be seen inltxguide.cls

    classes.dtx : macros/latex/base/classes.dtx

    ltxguide.cls : macros/latex/base/ltxguide.cls

    source2e.tex : macros/latex/base/source2e.tex

    29 METAFONT and MetaPost Tutorials

    Unfortunately there appear to be no tutorials on how to useMETAFONT, except forthe information provided by Knuth. There are, though, a couple of articles on how torun bothMETAFONT and MetaPost.

    Geoffrey Tobin has providedMETAFONT for Beginners(see question78). Thisdescribes how theMETAFONT system works and how to avoid some of the potentialpitfalls.

    Peter Wilson’sSome Experiences in RunningMETAFONT and MetaPostoffersthe benefit of Peter’s experience (he has designed a number of ‘historical’ fonts usingMETAFONT). On theMETAFONT side the article is more geared towards testingand installing newMETAFONT fonts than on the system, while on the other side itdescribes how to use MetaPost illustrations in LATEX andPDFLATEX documents, with anemphasis on how to use appropriate fonts for any text or mathematics.

    Hans Hagen (of ConTEXt fame) offers a MetaPost tutorial called MetaFun (whichadmittedly concentrates on the use of MetaPost with in ConTEXt). It may be found onhis company’sMetaPost page.

    Beginners’ guide: info/metafont-for-beginners.tex

    Peter Wilson’s “experiences”: info/metafp.ps (PostScript) orinfo/metafp.pdf (PDF format)

    30 BIBTEX Documentation

    BIBTEX, a program originally designed to produce bibliographies in conjunction withLATEX, is explained in Section 4.3 and Appendix B of Leslie Lamport’s LATEX manual(see question22). The document “BIBTEXing”, contained in the filebtxdoc.tex,gives a more complete description.The LATEX Companion(see question22) also hasinformation on BIBTEX and writing BIBTEX style files.

    The document “Designing BIBTEX Styles”, contained in the filebtxhak.tex, ex-plains the postfix stack-based language used to write BIBTEX styles (.bst files). Thefile btxbst.doc is the template for the four standard styles (plain, abbrv, alpha,

    18

    http://www.eijkhout.net/tbt/ftp://ftp.tex.ac.uk/tex-archive/info/gentle/gentle.pdfftp://ftp.tex.ac.uk/tex-archive/info/lshort/english/lshort.pdfftp://ftp.tex.ac.uk/tex-archive/info/simplified-latex/latex.pshttp://www.tex.ac.uk/tex-archive/macros/latex/doc/html/clsguidehttp://www.tex.ac.uk/tex-archive/macros/latex/doc/html/clsguideftp://ftp.tex.ac.uk/tex-archive/macros/latex/base/classes.dtxftp://ftp.tex.ac.uk/tex-archive/macros/latex/base/ltxguide.clsftp://ftp.tex.ac.uk/tex-archive/macros/latex/base/source2e.texhttp://www.ntg.nl/context/metapost.htmftp://ftp.tex.ac.uk/tex-archive/info/metafont-for-beginners.texftp://ftp.tex.ac.uk/tex-archive/info/metafp.psftp://ftp.tex.ac.uk/tex-archive/info/metafp.pdfftp://ftp.tex.ac.uk/tex-archive/info/metafp.pdf

  • unsrt). It also contains their documentation. The complete BIBTEX documentationset (including the files above) is available onCTAN.

    There is a Unix BIBTEX manpage in theweb2cpackage (see question53). Anycopy you may find of amanpage written in 1985 (before “BIBTEXing” and “DesigningBIBTEX Styles” appeared) is obsolete, and should be thrown away.

    4

    BIBTEX documentation: biblio/bibtex/distribs/doc

    31 Where can I find the symbol for. . .

    There is a wide range of symbols available for use with TEX, most of which are notshown (or even mentioned) in (LA)TEX books. The Comprehensive LATEX Symbol List(by Scott Pakinet al.) illustrates over 2000 symbols, and details the commands andpackages needed to produce them.

    Other questions in thisFAQ offer specific help on kinds of symbols:

    • Script fonts for mathematics (question186)• Fonts for the number sets (question185)• Typesetting the principal value integral (question188)

    Symbol List : Browseinfo/symbols/comprehensive; there are processedversions in both PostScript andPDF forms for both A4 and letter paper.

    32 The PICTEX manual

    PICTEX is a set of macros by Michael Wichura for drawing diagrams and pictures.The macros are freely available; however, the PICTEX manual itself is not free. Un-fortunately,TUG is no longer able to supply copies of the manual (as it once did),and it is now available only through Personal TEX Inc, the vendors of PCTEX (http://www.pctex.com/). The manual isnot available electronically.

    pictex : graphics/pictex

    D Bits and pieces of TEX

    33 What is aDVI file?

    A DVI file (that is, a file with the type or extension.dvi) is TEX’s main output file, us-ing TEX in its broadest sense to include LATEX, etc. ‘DVI ’ is supposed to be an acronymfor DeVice-Independent, meaning that the file can be printed on almost any kind oftypographic output device. TheDVI file is designed to be read by a driver (see ques-tion 34) to produce further output designed specifically for a particular printer (e.g.,a LaserJet) or to be used as input to a previewer for display on a computer screen.DVI files use TEX’s internal coding; a TEX input file should produce the sameDVI fileregardless of which implementation of TEX is used to produce it.

    A DVI file contains all the information that is needed for printing or previewingexcept for the actual bitmaps or outlines of fonts, and possibly material to be introducedby means of\special commands (see question38).

    The canonical reference for the structure of aDVI file is the source ofdvitype.

    dvitype : systems/knuth/texware/dvitype.web

    34 What is a driver?

    A driver is a program that takes as input aDVI file (see question33) and (usually)produces a file that can be sent to a typographic output device, called a printer forshort.

    A driver will usually be specific to a particular printer, although any PostScriptprinter ought to be able to print the output from a PostScript driver.

    As well as theDVI file, the driver needs font information. Font information maybe held as bitmaps or as outlines, or simply as a set of pointers into the fonts that theprinter itself ‘has’. Each driver will expect the font information in a particular form.For more information on the forms of fonts, see questions35, 36, 37and 81.

    4Or submitted for inclusion in a museum dedicated to the history of computing: the stricture was con-ceivably reasonable in the first version of thisFAQ. . .

    19

    ftp://ftp.tex.ac.uk/tex-archive/biblio/bibtex/distribs/doc.zipftp://ftp.tex.ac.uk/tex-archive/info/symbols/comprehensive/http://www.pctex.com/http://www.pctex.com/ftp://ftp.tex.ac.uk/tex-archive/graphics/pictex.zipftp://ftp.tex.ac.uk/tex-archive/systems/knuth/texware/dvitype.web

  • 35 What are PK files?

    PK files (packed raster) contain font bitmaps. The output fromMETAFONT (see ques-tion 78) includes a generic font (GF) file and the utilitygftopk produces thePK filefrom that. There are a lot ofPK files, as one is needed for each font, that is each mag-nification (size) of each design (point) size for each weight for each family. Further,since thePK files for one printer do not necessarily work well for another, the wholeset needs to be duplicated for each printer type at a site. As a result, they are often heldin an elaborate directory structure, or in ‘font library files’, to regularise access.

    36 What are TFM files?

    TFM stands for TEX font metrics, andTFM files hold information about the sizes of thecharacters of the font in question, and about ligatures and kerns within that font. OneTFM file is needed for each font used by TEX, that is for each design (point) size foreach weight for each family; oneTFM file serves for all magnifications, so that thereare (typically) fewerTFM files than there arePK files. The important point is thatTFMfiles are used by TEX (LATEX, etc.), but are not, generally, needed by the printer driver.

    37 Virtual fonts

    Virtual fonts for TEX were first implemented by David Fuchs in the early days of TEX,but for most people they started when Knuth redefined the format, and wrote somesupport software, in 1989 (he published an article inTUGboat at the time, and a copyis available onCTAN). Virtual fonts provide a way of telling TEX about somethingmore complicated than just a one-to-one character mapping. The entities you define ina virtual font look like characters to TEX (they appear with their sizes in a font metricfile), but theDVI processor may expand them to something quite different. You can usethis facility just to remap characters, to make a composite font with glyphs drawn fromseveral sources, or to build up an effect in arbitrarily complicated ways — a virtual fontmay contain anything which is legal in aDVI file. In practice, the most common useof virtual fonts is to remap PostScript fonts (see question83) or to build ‘fake’ mathsfonts.

    It is important to realise that TEX itself doesnot see virtual fonts; for every virtualfont read by theDVI driver there is a correspondingTFM file read by TEX. Virtual fontsare normally created in a singleASCII vpl (Virtual Property List) file, which includesboth sets of information. Thevptovf program is then used to the create the binaryTFMandVF files. The commonest way (nowadays) of generatingvpl files is to use thefontinstpackage, which is described in detail in question83. qdtexvplis another utilityfor creating ad-hoc virtual fonts.

    fontinst : fonts/utilities/fontinst

    Knuth on virtual fonts: info/virtual-fonts.knuth

    qdtexvpl : fonts/utilities/qdtexvpl

    38 \special commands

    TEX provides the means to express things that device drivers can do, but about whichTEX itself knows nothing. For example, TEX itself knows nothing about how to includePostScript figures into documents, or how to set the colour of printed text; but somedevice drivers do.

    Such things are introduced to your document by means of\special commands;all that TEX does with these commands is to expand their arguments and then pass thecommand to theDVI file. In most cases, there are macro packages provided (oftenwith the driver) that provide a comprehensible interface to the\special; for example,there’s little point including a figure if you leave no gap for it in your text, and changingcolour proves to be a particularly fraught operation that requires real wizardry. LATEX 2εhas standard graphics and colour packages that make figure inclusion, rotation andscaling, and colour typesetting via\specials all easy.

    The allowable arguments of\special depend on the device driver you’re using.Apart from the examples above, there are\special commands in the emTEX drivers(e.g.,dvihplj, dviscr, etc.) that will draw lines at arbitrary orientations, and commandsin dvitoln03that permit the page to be set in landscape orientation.

    20

    ftp://ftp.tex.ac.uk/tex-archive/fonts/utilities/fontinst.zipftp://ftp.tex.ac.uk/tex-archive/info/virtual-fonts.knuthftp://ftp.tex.ac.uk/tex-archive/fonts/utilities/qdtexvpl.zip

  • 39 Documented LATEX sources (.dtx files)

    LATEX 2ε, and many support macro packages, are now written in a literate programmingstyle (see question64), with source and documentation in the same file. This format,known as ‘doc’, was originated by Frank Mittelbach. The documented sources conven-tionally have the suffix.dtx, and should normally be stripped of documentation beforeuse with LATEX. Alternatively you can run LATEX on a.dtx file to produce a nicely for-matted version of the documented code. An installation script (with suffix.ins) isusually provided, which needs the standard LATEX 2ε docstrippackage (among otherthings, the installation process strips all the comments that make up the documentationfor speed when loading the file into a running LATEX system). Several packages can beincluded in one.dtx file, with conditional sections, and there facilities for indices ofmacros etc. Anyone can write.dtx files; the format is explained inThe LATEX Com-panion(see question22), and a tutorial is available fromCTAN (together with skeleton.dtx and.ins files). There are no programs yet to assist in composition of.dtx files.

    .dtx files are not used by LATEX after they have been processed to produce.sty or.cls (or whatever) files. They need not be kept with the working system; however, formany packages the.dtx file is the primary source of documentation, so you may wantto keep.dtx files elsewhere.

    DTX tutorial : info/dtxtut

    40 What are encodings?

    Let’s start by defining two concepts, thecharacterand theglyph. The character is theabstract idea of the ‘atom’ of a language or other dialogue: so it might be a letter in analphabetic language, a syllable in a syllabic language, or an ideogram in an ideographiclanguage. The glyph is the mark created on screen or paper which represents a char-acter. Of course, if reading is to be possible, there must be some agreed relationshipbetween the glyph and the character, so while the precise shape of the glyph can beaffected by many other factors, such as the capabilities of the writing medium and thedesigner’s style, the essence of the underlying character must be retained.

    Whenever a computer has to represent characters, someone has to define the rela-tionship between a set of numbers and the characters they represent. This is the essenceof an encoding: it is a mapping between a set of numbers and a set of things to be rep-resented.

    TEX of course deals in encoded characters all the time: the characters presented toit in its input are encoded, and it emits encoded characters in itsDVI (or PDF) output.These encodings have rather different properties.

    The TEX input stream was pretty unruly back in the days when Knuth first imple-mented the language. Knuth himself prepared documents on terminals that producedall sorts of odd characters, and as a result TEX contains some provision for translatingthe input encoding to something regular. Nowadays, the operating system translateskeystrokes into a code appropriate for the user’s language: the encoding used is oftena national or international standard, though many operating systems use “code pages”defined by MicroSoft. These standards and code pages often contain characters thatcan’t appear in the TEX system’s input stream. Somehow, these characters have to bedealt with — so an input character like “é” needs to be interpreted by TEX in a way thatthat at least mimics the way it interprets “\’e”.

    The TEX output stream is in a somewhat different situation: characters in it are to beused to select glyphs from the fonts to be used. Thus the encoding of the output streamis notionally a font encoding (though the font in question may be a virtual one — seequestion37). In principle, a fair bit of what appears in the output stream could bedirect transcription of what arrived in the input, but the output stream also contains theproduct of commands in the input, and translations of the input such as ligatures likefi⇒“fi”.

    Font encodings became a hot topic when the Cork encoding (see question42) ap-peared, because of the possibility of suppressing\accent commands in the outputstream (and hence improving the quality of the hyphenation of text in inflected lan-guages, which is interrupted by the\accent commands — see question41). To takeadvantage of the diacriticised characters represented in the fonts, it is necessary toarrange that whenever the command sequence “\’e” has been input (explicitly, or im-plicitly via the sort of mapping of input mentioned above), the character that codes theposition of the “́e” glyph is used.

    21

    ftp://ftp.tex.ac.uk/tex-archive/info/dtxtut.zip

  • Thus we could have the odd arrangement that the diacriticised character in the TEXinput stream is translated into TEX commands that would generate something lookinglike the input character; this sequence of TEX commands is then translated back againinto a single diacriticised glyph as the output is created. This is in fact precisely whatthe LATEX packagesinputencandfontencdo, if operated in tandem on (most) charactersin the ISO Latin-1 input encoding and theT1 font encoding. At first sight, it seemseccentric to have the first package do a thing, and the second precisely undo it, but itdoesn’t always happen that way: most font encodings can’t match the correspondinginput encoding nearly so well, and the two packages provide the sort of symmetry theLATEX system needs.

    41 How does hyphenation work in TEX?

    Everyone knows what hyphenation is: we see it in most books we read, and (if we’realert) often spot ridiculous mis-hyphenation from time to time (at one time, Britishnewspapers were a fertile source).

    Hyphenation styles are culturally-determined, and the same language may be hy-phenated differently in different countries — for example, British and American stylesof hyphenation of English are very different. As a result, a typesetting system thatis not restricted to a single language at a single locale needs to be able to change itshyphenation rules from time to time.

    TEX uses a pretty good system for hyphenation (originally designed by FrankLiang), and while it’s capable of missing “sensible” hyphenation points, it seldomselects grossly wrong ones. The algorithm matches candidates for hyphenation againsta set of “hyphenation patterns”. The candidates for hyphenation must be sequences ofletters (or other single characters that TEX may be persuaded to think of as letters) —things such as TEX’s \accent primitive interrupt hyphenation.

    Sets of hyphenation patterns are usually derived from analysis of a list of validhyphenations (the process of derivation, using a tool calledpatgen, is not ordinarily aparticipatory sport).

    The patterns for the languages a TEX system is going to deal with may only beloaded when the system is installed. To change the set of languages, a partial reinstal-lation (see question180) is necessary.

    TEX provides two “user-level” commands for control of hyphenation:\language(which selects a hyphenation style), and\hyphenation (which gives explicit instruc-tions to the hyphenation engine, overriding the effect of the patterns).

    The ordinary LATEX user need not worry about\language, since it is very thor-oughly managed by thebabelpackage; use of\hyphenation is discussed in ques-tion 176.

    42 What are theEC fonts?

    A font consists of a number ofglyphs. In order that the glyphs may be printed, they areencoded(see question40), and the encoding is used as an index into tables within thefont. For various reasons, Knuth chose deeply eccentric encodings for his ComputerModern family of fonts; in particular, he chose different encodings for different fonts,so that the application using the fonts has to remember which font of the family it’susing before selecting a particular glyph.

    When TEX version 3 arrived, most of the excuses for the eccentricity of Knuth’s en-codings went away, and atTUG’s Cork meeting, an encoding for a set of 256 glyphs, foruse in TEX text, was defined. The intention was that these glyphs should cover ‘most’European languages that use Latin alphabets, in the sense of including all accented let-ters needed. (Knuth’sCMR fonts missed things necessary for Icelandic and Polish, forexample, but the Cork fonts have them. Even Cork’s coverage isn’t complete: it missesletters from Romanian, Eastern and Northern Sami, and Welsh, at least. The Cork en-coding does contain “NG” glyphs that allows it to support Southern Sami.) LATEX refersto the Cork encoding asT1, and provides the means to use fonts thus encoded to avoidproblems with the interaction of accents and hyphenation (see question179).

    The onlyMETAFONT-fonts that conform to the Cork encoding are theEC fonts.They lookCM-like, though their metrics differ fromCM-font metrics in several areas.The fonts are now regarded as ‘stable’ (in the same sense that theCM fonts are stable:their metrics are unlikely ever to change). Their serious disadvantages for the casualuser are their size (eachEC font is roughly twice the size of the correspondingCM font),and there are far more of them than th