The New TEX FAQ Your 75 Questions Answered version 1.4fwk, date 1994/11/05

The UK TEX Users Group Committee after the original maintained by Bobby Bodenheimer

November 7, 1994

Note

This document is an interim copy of something that’s still ‘work in progress’. It is being prepared for the December 1994 edition of the UK-TUG magazine Baskerville (which won’t be formatted like this), and will be available to be fed back into the normal comp.text.tex FAQ posting at around the time of that publication. It is also to be available as a www page.

Contents

A Introduction 4

B The Background 5 1 What is TEX? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2 What is L^{A}TEX? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3 Should I use plain TEX or L^{A}TEX? . . . . . . . . . . . . . . . . . . 5 4 What is Eplain? . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 5 If TEX is so good, how come it’s free? . . . . . . . . . . . . . . . 6 6 What is the future of TEX? . . . . . . . . . . . . . . . . . . . . . 6 7 What are TUG and TUGboat? . . . . . . . . . . . . . . . . . . . 7 8 Are there nationally-based user groups, too? . . . . . . . . . . . . 7

C Documentation and Help 8 9 Books on TEX and its relations . . . . . . . . . . . . . . . . . . . 8 10 Where to find this article . . . . . . . . . . . . . . . . . . . . . . 9 11 BibTEX Documentation . . . . . . . . . . . . . . . . . . . . . . . 9 12 The PICTEX manual . . . . . . . . . . . . . . . . . . . . . . . . . 9 13 Finding TEX macro or L^{A}TEX class or package files . . . . . . . . 10

14 Finding L^{A}TEX 2ε-related packages . . . . . . . . . . . . . . . . . 10

D Bits and pieces of TEX 10 15 Virtual fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 16 \special commands . . . . . . . . . . . . . . . . . . . . . . . . . 11

E DVI Drivers and Previewers 11 17 DVI to PostScript conversion programs . . . . . . . . . . . . . . 11 18 DVI drivers for HP LaserJet . . . . . . . . . . . . . . . . . . . . . 12 19 DVI previewers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

F PostScript and TEX 13 20 Using PostScript fonts with TEX . . . . . . . . . . . . . . . . . . 13 21 TEX font metric files for PostScript fonts . . . . . . . . . . . . . . 13 22 Problems using PostScript fonts . . . . . . . . . . . . . . . . . . . 14 23 Including a PostScript figure in L^{A}TEX . . . . . . . . . . . . . . . 15

G TEX Systems 15 24 TEX/L^{A}TEX for different machines . . . . . . . . . . . . . . . . . . 15 25 Commercial TEX vendors . . . . . . . . . . . . . . . . . . . . . . 16

H Support Packages for TEX 17 26 Fig, a TEX-friendly drawing package . . . . . . . . . . . . . . . . 17 27 TEXCAD, a friendly drawing package for L^{A}TEX . . . . . . . . . . 17 28 Spelling checkers for work with TEX . . . . . . . . . . . . . . . . 17 29 The VORTEX package . . . . . . . . . . . . . . . . . . . . . . . . . 17

I Literate programming 17 30 What is Literate Programming . . . . . . . . . . . . . . . . . . . 17 31 WEB for C, FORTRAN, and other languages . . . . . . . . . . . 18

J Miscellaneous (for want of a better title) 18 32 Converting other formats to TEX or L^{A}TEX (and vice-versa) … 18

K Special sorts of typesetting 20 33 Typesetting music in TEX . . . . . . . . . . . . . . . . . . . . . . 20 34 Double-spaced documents in L^{A}TEX . . . . . . . . . . . . . . . . . 20 35 Including a file in the verbatim environment in L^{A}TEX . . . . . . 21 36 Generating an index in TEX/L^{A}TEX . . . . . . . . . . . . . . . . . 21 37 Formatting a thesis in L^{A}TEX . . . . . . . . . . . . . . . . . . . . 21 38 Symbols for “the real numbers”, “the complex numbers”, etc… 22 39 Converting TEX or L^{A}TEX file into plain ASCII file . . . . . . . . 22 40 Using BibTEX with plain TEX . . . . . . . . . . . . . . . . . . . . 22 41 Drawing Feynman diagrams in L^{A}TEX . . . . . . . . . . . . . . . . 23 42 Changing the margins in L^{A}TEX . . . . . . . . . . . . . . . . . . . 23 43 Finding the width of a letter, word, or phrase in TEX . . . . . . . 24 44 Excluding blocks of text from the .dvi file . . . . . . . . . . . . 24

45 Defining a new log-like function in L^{A}TEX . . . . . . . . . . . . . . 24

L �������� 25 46 Getting to do what you want . . . . . . . . . . . . . 25 47 Which font files should be kept . . . . . . . . . . . . . . . . . . . 26

M Acquiring the Software 27 48 Repositories of TEX material . . . . . . . . . . . . . . . . . . . . 27 49 Contributing a file to the archives . . . . . . . . . . . . . . . . . . 28 50 Finding new fonts . . . . . . . . . . . . . . . . . . . . . . . . . . 28

N Things are Going Wrong… 28 51 Weird hyphenation of words . . . . . . . . . . . . . . . . . . . . . 28 52 (Merely) peculiar word division . . . . . . . . . . . . . . . . . . . 29 53 Enlarging TEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 54 Moving tables and figures . . . . . . . . . . . . . . . . . . . . . . 29 55 Disappearing tables and figures . . . . . . . . . . . . . . . . . . . 30 56 \pagestyle{empty} on first page in L^{A}TEX . . . . . . . . . . . . . 30 57 Odd behaviour of \rm, \bf, etc. . . . . . . . . . . . . . . . . . . . 30 58 Old L^{A}TEX font references like \tenrm . . . . . . . . . . . . . . . 30 59 Missing symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 60 Incorrect cross-references for floats (figures and tables) in L^{A}TEX . 31 61 \@ in macro names . . . . . . . . . . . . . . . . . . . . . . . . . . 31 62 Where are the msx and msx fonts? . . . . . . . . . . . . . . . . . 32 63 Where are the am fonts? . . . . . . . . . . . . . . . . . . . . . . . 32

O Why does it do that? 33 64 Why doesn’t it apply those paragraph parameters? . . . . . . . . 33 65 What’s the reason for ‘protection’? . . . . . . . . . . . . . . . . . 33

P How do I do X in L^{A}TEX 34 66 Proof environment . . . . . . . . . . . . . . . . . . . . . . . . . . 34 67 Roman theorems . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 68 Labels on lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 69 Style of section headings . . . . . . . . . . . . . . . . . . . . . . . 35

Q Recent Developments 35 70 The New Font Selection Scheme (NFSS) . . . . . . . . . . . . . . 35 71 L^{A}TEX 2ε (the new standard L^{A}TEX) . . . . . . . . . . . . . . . . . 35 72 The L^{A}TEX3 project . . . . . . . . . . . . . . . . . . . . . . . . . . 36 73 The Omega project . . . . . . . . . . . . . . . . . . . . . . . . . . 36 74 The NTS project . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

R Perhaps There isn’t an Answer 37 75 What to do if you find a bug . . . . . . . . . . . . . . . . . . . . 37

A Introduction

This article was prepared by the Committee of the UK TEX Users Group (UK TUG)^{1} as a development of a regular posting to the Usenet newsgroup comp. text.tex that has been maintained for some time by Bobby Bodenheimer

(bobby@hot.caltech.edu).

Usenet is a mechanism for exchanging articles between people who share interests or needs^{2}; a newsgroup is an area within Usenet carrying a particular class of articles. Since a common sort of article asks for help, advice or information, and since certain of these questions are regularly repeated (often with monotonous regularity), some public-spirited souls took to writing articles which listed “Frequently Asked Questions” and answers to them. Several members of UK TUG do not have access to Usenet, but could be expected to value the answers about TEX that have accumulated over the years; so your committee decided to update it and publish it in Baskerville; we are grateful to Bobby for his permission to use his article in this way. As a quid pro quo, we are making the source of the article freely available, and it can be compiled by anyone who runs a production L^{A}TEX 2ε (see question 71). It is the committee’s hope that it will also be possible for the content of this article to feed back to the world-wide TEX community via Bobby’s regular posting.

In addition, the article is to be available on the World-Wide Web, via

http://www.cogs.susx.ac.uk/cgi-bin/texfaq2html?introduction=yes^{3}

We have rearranged Bobby’s article quite a lot, and have added new questions and answers on the basis of our experience of answering questions about TEX, writing documents in TEX, and developing macros for TEX, over the years. In addition, we have pruned the article in the light of the changes that have happened in the world of TEX since Bobby first started.

The committee is grateful for help and advice, in the preparation of this article, from the following people outside its number: Joachim Schrod, Werner Icking, Karl Berry, …, HELP!

Finding the Files

Unless otherwise specified, all files mentioned in this article are available from a CTAN archive, or from one of their mirrors. Question 48 gives details of the CTAN archives, and how to retrieve files from them. The reader should note, however, that the first directory name of the path name of every file on CTAN has been elided from what follows, for the simple reason that it’s always the

same (tex-archive/).

1 for 1993-94: Peter Abbott, Rosemary Bailey, Robin Fairbairns, Jonathan Fine, Carol Hewlett, Alan Jeffrey, Sebastian Rahtz, and Chris Rowley; in addition, for 1994-95, David Carlisle

2 Usenet needs to be transmitted by some sort of network; in the earliest days this was via a telephone line, but nowadays Usenet is most often carried over the Internet

3 This is a temporary URL; a final home for the document is to be provided in due course

B The Background

1 What is TEX?

TEX is a typesetting package, written by Donald E. Knuth. Knuth says in the Preface to his book on TEX (see question 9) that it is “intended for the creation of beautiful books—and especially for books that contain a lot of mathematics”.

Knuth developed a system of ‘literate programming’ to write TEX, and he provides the literate (web) source of TEX free of charge, together with tools for processing the web source into something that can be compiled and something that can be printed. TEX is a macro processor, and offers its users a powerful programming capability.

TEX on its own is a pretty difficult beast to deal with, so Knuth provided a small package of macros for use with TEX called plain TEX; plain TEX is effectively the minimum set of macros one can usefully employ with TEX. When people say they’re “programming in TEX”, they usually mean they’re programming in plain TEX.

2 What is L^{A}TEX?

L^{A}TEX is a TEX macro package, written by Leslie Lamport, that provides a document processing system. L^{A}TEX defines markup to describe the structure of a document, so that the user is relieved of the need to think about presentation. Using document classes and add-on packages, the same document can be produced in a variety of different layouts.

Lamport says that L^{A}TEX “represents a balance between functionality and ease of use”. This balance manifests itself as a continual conflict that leads to the need for such as the present article: L^{A}TEX can do a large proportion of the things that the user wants when he’s preparing his documents, but finding out how it will do them is often tricky.

3 Should I use plain TEX or L^{A}TEX?

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, of course). But equally, many people are happy to let someone else take the design decisions for them, accepting a small loss of flexibility in exchange for a saving of brain power.

The arguments around this topic can provoke huge amounts of noise and heat, without offering much by way of light; your best bet is to find out what those around you are 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 markup they want you to use before you spend too much time developing your own; many big publishers have developed their own L^{A}TEX styles for journals and books, and want authors to stick closely to their markup.

4 What is Eplain?

The Eplain macro package expands on and extends the definitions in plain TEX. Eplain is not intended to provide “generic typesetting capabilities”, as do L^{A}TEX or Texinfo. Instead, it provides definitions that are intended to be useful regardless of the high-level commands that you use when you actually prepare your manuscript.

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

On the other hand, almost everyone would like capabilities such as crossreferencing by labels, so that you don’t have to put actual page numbers in the manuscript. Karl Berry, the author of Eplain, says he is not aware of any generally available macro packages that (1) do not force their typographic style on an author, and yet (2) provide such capabilities.

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

It’s free because Knuth chose to make it so. Knuth has a steady income from TEX, arising from royalties on his books about it, and is satisfied with that. Knuth is nevertheless happy that others should earn money by selling TEX-based services and products. While several valuable TEX-related tools and packages are offered subject to restrictions imposed by the GNU General Public Licence (‘Copyleft’)^{4}, TEX itself is not subject to Copyleft.

There are commercial versions of TEX available; for some people, and for some institutions, it’s reassuring to have back-up from someone you pay. What is more, some of the commercial implementations have features that are not available in free versions (though the reverse is also true: some free implementations have features that are not available commercially).

This article does not usually describe commercial versions of TEX; the addresses of some major vendors are listed in question 25.

6 What is the future of TEX?

Knuth has declared that he will do no further development of TEX; he will continue to mend any bugs that are reported to him (though bugs are rarely if ever found anyway). This decision was made at the time that TEX v3.0 was released; each of the bug-fix releases acquires one more digit, so that the version number tends to the limit π. Knuth wants TEX to be frozen at version π when he dies; thereafter, no further changes may be made to Knuth’s source.

There are various projects to build a successor to TEX; see questions 73 and 74.

4 Copyleft requires that no-one should charge for source derived from the restricted product

7 What are TUG and TUGboat?

TUG is the TEX Users Group. TUGboat is TUG’s main journal, containing useful articles about TEX and . TUG also produces a newsletter for members (TEX and TUG News), organises a yearly conference, runs training courses, sells almost all TEX-related books, and distributes TEX-related microcomputer software on disk. Enquiries should be directed to:

TEX Users Group P. O. Box 869 Santa Barbara, CA 93102-0869 USA Tel: (+1) 805-963-1338 Fax: (+1) 805-963-8358

Email: tug@tug.org

8 Are there nationally-based user groups, too?

The following groups publish their membership (etc.) information electronically on CTAN archives:

DANTE, Deutschsprachige Anwendervereinigung TEX e.V. Postfach 10 18 40 D-69008 Heidelberg Germany Tel: (+49) 06221/2 97 66 Fax: (+49) 06221/16 79 06

Email: dante@dante.de
CTAN details: usergrps/dante

GUTenberg, BP 10, 93220 Gagny principal, France

CTAN details: usergrps/gut

NTG Postbus 394, 1740AJ Schagen, The Netherlands

Email: ntg@nic.surfnet.nl
CTAN details: usergrps/ntg

UK TEX Users’ Group, c/o Peter Abbott, 1 Eymore Close, Selly Oak, Birmingham B29 4LB UK

     Email: UKTuG-Enquiries@tex.ac.uk
     CTAN details: usergrps/uktug

A listing of all known groups is available as usergrps/info/usergrps.tex

C Documentation and Help

9 Books on TEX and its relations

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

The TEXbook by Donald Knuth (Addison-Wesley, 1984, ISBN 0-201-13447-0, paperback 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 for the Impatient by Paul W. Abrahams, Karl Berry and Kathryn A. Hargreaves (Addison-Wesley, 1990, ISBN 0-201-51375-7)

TEX by Topic by Victor Eijkhout (Addison-Wesley, 1992, ISBN 0-201-56882-9)

A Plain TEX Primer by Malcolm Clark (Oxford University Press, 1993, ISBN?)

TEX in Practice by Stephan von Bechtolsheim (Springer Verlag, 1993, 3 volumes, ISBN?)

5 For L^{A}TEX, see:

L^{A}TEX, a Document Preparation System by Leslie Lamport (second edition, Addison Wesley, 1994, ISBN 0-201-15790-X)

A guide to L^{A}TEX Kopka and Daly (Addison Wesley, ISBN 0-201-56889-6, not yet available in an edition addressing L^{A}TEX 2ε)

The L^{A}TEX Companion by Michel Goossens, Frank Mittelbach, and Alexander Samarin (Addison Wesley, 1993, ISBN 0-201-54199-8)

L^{A}TEX Notes: Practical Tips for Preparing Technical Documents by J. Kenneth Shultis (Prentice Hall, 1994, ISBN 0-131-20973-6, not updated for L^{A}TEX 2ε)

Math into TEX: A Simplified Introduction using AMS-L^{A}TEX by George Grätzer (Birkhäuser, 1993, ISBN not known, not yet available in an edition addressing L^{A}TEX 2ε)

The list for is rather short:

5QUERY: Someone fill in those two ISBNs for me?

The book by Donald Knuth (Addison Wesley, 1984, ISBN 0-201-13445-4)

A book covering a range of topics (including installation and maintenance) which also seems worth considering is:

Making TEX Work by Norman Walsh (O’Reilly and Associates, Inc, 1994, ISBN 1-56592-051-1)

10 Where to find this article

This article is posted monthly to comp.text.tex and cross-posted to news. answers. The most recently posted copy of the article is in info/TeX-FAQ; it is also archived at any site that archives news.answers, such as rtfm.mit. edu (18.181.0.24), and this article is available there via anonymous ftp in the

directory ./pub/usenet/news.answers/tex-faq. If you do not have access to

ftp, send an e-mail message containing the lines “SENDME FAQ” to fileserv@ shsu.edu. Another way to retrieve it via email is through the mailserver at rtfm: send a message containing the lines “help” and “index” to mail-server@ rtfm.mit.edu for information on how to obtain it.

11 BibTEX Documentation

BibTEX, a program originally designed to produce bibliographies in conjunction with L^{A}TEX, is explained in Section 4.3 and Appendix B of Leslie Lamport’s L^{A}TEX manual (see question 9). The “BibTEXing” document, contained in the file btxdoc.tex, gives a more complete description. The L^{A}TEX Companion also has information on BibTEX and writing BibTEX style files.

The “Designing BibTEX Styles” document, contained in the file btxhak.tex, explains the postfix stack-based language used to write BibTEX styles (.bst files). The file btxbst.doc is the template file for the four standard styles (plain, abbrv, alpha, unsrt). It also contains the documentation for them.

The complete BibTEX documentation set (including the files above) is in

biblio/bibtex/distribs/doc

There is a Unix BibTEX man page in the web2c package (see question 24). Throw away any copy you may find of an obsolete man page written in 1985 before “BibTEXing” and “Designing BibTEX Styles” appeared.

12 The PICTEX manual

PICTEX is a set of macros for drawing diagrams and pictures. The macros are freely available in graphics/pictex; however, the PICTEX manual itself is not free. It is available for $30 ($35 with the disk) from the TEX Users Group (see question 7).

The proceeds from the sales go to Michael Wichura, the author of PICTEX, and to TUG.

13 Finding TEX macro or L^{A}TEX class or package files

Before you ask for a TEX macro or L^{A}TEX class or package file to do something, please search the TEX macro index written by David M. Jones (dmjones@

theory.lcs.mit.edu) and available in help/Tex-index/TeX-index

Those without access to anonymous ftp can send a message containing the

line “send TeX tex-index” to archive-server@theory.lcs.mit.edu. The

index is an excellent reference document with plenty of cross-references. Also, many archive sites (see question 48) maintain extensive L^{A}TEX style collections, which you can look through if you need something not in the index. ^{6}

Another possibility is to use the searching features of the CTAN archives (see question 48). Once you have an anonymous ftp connection established to a CTAN site, you can type the command ‘quote site index <term>’ and it will provide a list of files with the string <term> in their names.

14 Finding L^{A}TEX 2ε-related packages

A common confusion that can arise is that no .sty or .cls file exists on the CTAN archives for the package or class you’ve been recommended to acquire. For example, there are many packages listed in The L^{A}TEX Companion (see question 9) without details of their location on CTAN. The file info/ companion.ctan may be of help in finding such files, but it’s not a general solution.

The canonical way of distributing L^{A}TEX 2ε packages and classes is as .dtx files, which are ‘documented .tex’ sources for the thing being provided. Of course, if your site index command was for ‘package.sty’, you won’t find anything — you should simply ask for ‘package’ (the search can find things on the basis of substrings of their name).

In the case that what you’re seeking is indeed distributed this way, you should retrieve the whole directory that the .dtx file is in, which will get you all the related files, including one or more .ins (installation) files. Process the ‘appropriate’ .ins file using L^{A}TEX 2ε, and you will generate the file (or files) that you want.

D Bits and pieces of TEX

15 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 the necessary software, in 1989. Virtual fonts provide a way of telling TEX about something more complicated than just a one-to-one character mapping. You define in a virtual font en entity which looks like a character to TEX (it appears with a size in a font metric file) but which the dvi processor may expand to something quite different. You can use this facility just to remap characters, to make a composite font with glyphs drawn from several sources, or to build up an effect in arbitrarily complicated ways — a virtual font can contain anything which is legal in a dvi file.

6QUERY: Junk the reference to mail server?

In practice, the most common use of virtual fonts is to remap PostScript fonts (see question 21) or build ‘fake’ maths fonts.

It is important to realize that TEX itself does not see virtual fonts; for every virtual font read by the dvi driver there is a corresponding tfm file read by TEX. Virtual fonts are normally created in a single ASCII vpl (Virtual Property List) format, which includes both sets of information. The vptovf program is then used to the create the binary tfm and vf files.

16 \special commands

TEX provides the means to express things that device drivers can do, but about which TEX itself knows nothing. For example, TEX itself knows nothing about how to include PostScript figures into documents, or how to set the colour of printed text; but some device 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 the command to the .dvi file. In most cases, there are macro packages provided (often with 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 changing colour proves to be a particularly fraught operation that requires the comprehension of a real wizard.

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 dvihplj that will draw lines at arbitrary orientations, and commands in dvitoln03 that permit the page to be set in landscape orientation.

E DVI Drivers and Previewers

17 DVI to PostScript conversion programs

The best public domain dvi to PostScript conversion program which runs under many operating systems is Tom Rokicki’s dvips. dvips is written in C and ports easily to other operating systems; it is available as dviware/dvips

VMS versions are available through the DECUS library (see question 48),

and also from CTAN: systems/vms/Alpha/dvips555_axp_exe.zip (for Alpha-
based machines), systems/vms/VAX/dvips555_vax_exe.zip (for VAX ma-

chines); support files are available in systems/vms/dvips555_support.zip, and a set of fonts for use with L^{A}TEX 2ε are available in systems/vms/

dvips_fontsupport.zip

A precompiled version for MSDOS is available from systems/msdos/

dviware/dvips

Karl Berry’s version of dvips (called dvipsk) has a configure script and path searching code similar to that in his other programs (e.g., web2c); it is available

from dviware/dvipsk.

Another good portable program is dvitops by James Clark, which is also written in C and will compile under Unix, MSDOS, VMS, and Primos; however, it does not support virtual fonts. It is available from dviware/dvitops

Macintosh users can either use the excellent drivers built into OzTEX or Textures, or a port of dvips in the CMacTeX package.

18 DVI drivers for HP LaserJet

The emTEX package (see question 24) contains a driver for the LaserJet, dvihplj.

Version 2.10 of the Beebe drivers supports the LaserJet. These drivers will compile under Unix, VMS, and on the Atari ST and DEC-20’s, and are available

from dviware/beebe

Karl Berry’s dviljk, which has features analagous to his dvipsk (see question 17) is available in dviware/dviljk

19 DVI previewers

EmTEX and GTEX for the PC, and OzTEX for the Macintosh, all come with previewers that can be used on those platforms.

Previewers available via anonymous ftp for other operating systems include:

xdvi The most widely used previewer for the X Window System (and hence almost any Unix or modern VMS workstation); available in dviware/xdvi

Karl Berry’s version of xdvi, called xdvik, has features analogous to his dvipsk (see question 17); it is available in dviware/xdvik

dvipage For SunView on (old enough) Sun workstations. This was published

     in volume 15 of comp.sources.unix and is archived in dviware/dvipage

xtex An older previewer for the X Window System; available in dviware/

     seetex

dviapollo For Apollo Domain workstations; available in dviware/dviapollo

dvidis For (old enough, VMS) VAXstations running VWS; available in dviware/

     dvidis

dvitovdu for Tektronix 4010 and other terminals under Unix and VMS; avail-

     able as dviware/dvitovdu

dvi2tty A dvi to ASCII conversion program, for normal terminals; available

     as dviware/dvi2tty

texsgi For SGI under Irix; both a binary and source are available, but be sure to get the fonts as well. Available as dviware/texsgi

F PostScript and TEX

20 Using PostScript fonts with TEX

Before you start: in order to use PostScript fonts, TEX needs metric (called tfm) files. Several sets of metrics are available from the archives; for mechanisms for generating new ones, see question 21.

If you use L^{A}TEX 2ε, the best way to get PostScript fonts in your document is to use the PSNFSS package maintained by Sebastian Rahtz and Alan Jeffrey (available in macros/latex/packages/psnfss); it’s supported by the L^{A}TEX 2ε team, so bug reports can and should be submitted. The package will give you a set of packages for changing the default roman, sans-serif and typewriter fonts; eg, times.sty will set up Times Roman, Helvetica and Courier in place of Computer Modern, while avant.sty just changes the sans-serif family to AvantGarde. To go with these packages, you will need the font metric files (watch out for encoding problems! see question 21) and font description (.fd) files for each font family you want to use. These can be obtained from fonts/ metrics, arranged by vendor (eg Adobe, Monotype, etc). For convenience, metrics for the common ‘35’ PostScript fonts found in most printers are provided

with PSNFSS, packaged as macros/latex/packages/psnfss/lw35nfss.zip

For older versions of L^{A}TEX there are various schemes, of which the simplest to use is probably the PSL^{A}TEX macros distributed with dvips.

For plain TEX, you load whatever fonts you like; if the encoding of the fonts is not the same as Computer Modern it will be up to you to redefine various macros and accents.

Victor Eijkhout’s sophisticated Lollipop package (macros/lollipop) supports declaration of font families and styles in a similar way to L^{A}TEX’s NFSS, and so is easy to use with PostScript fonts.

Some common problems encountered are discussed elsewhere (see question 22).

21 TEX font metric files for PostScript fonts

Font vendors like Adobe supply metric files for each font, in AFM (Adobe Font Metric) form; these can be converted to tfm (TEX Font Metric) form. The CTAN archives have prebuilt metrics which will make be enough for many people (fonts/metrics), but you may need to do the conversion yourself if you have special needs or acquire a new font. One important question is the encoding of (Latin character) fonts; while we all more or less agree about the position of about 96 characters in fonts (the basic ASCII set), the rest of the (typically) 256 vary. The most obvious problems are with floating acccents and special characters like the pounds sign. There are three ways of dealing with this: either you change the TEX macros which reference the characters (not much fun, and error-prone); or you change the encoding of the font (easier than you think); or you use virtual fonts (see question 15) to pretend to TEX that the encoding is the same as it is used to. If you use L^{A}TEX 2ε, it allows for changing the encoding in TEX; read the L^{A}TEX Companion for more details. In practice, if you do much non-English typesetting, you are strongly recommended to use the t1nenc package, which switches to ‘T1’ encoding (aka Cork, and DC). The PSNFSS package (see question 20) provides support for PostScript (using virtual fonts) in this encoding.

Alan Jeffrey’s fontinst package (fonts/utilities/fontinst) is an afm to tfm converter written in TEX; it is used to generate the files used by L^{A}TEX 2ε’s PSNFSS package to support use of PostScript fonts. It is a sophisticated package, not for the faint-hearted, but is powerful enough to cope with most needs. Much of its power relies on the use of virtual fonts (see question 15).

For slightly simpler problems, Rokicki’s afm2tfm, distributed with dvips (dviware/dvips), is fast and efficient; note that the metrics and styles that come with dvips are not currently L^{A}TEX 2ε compatible.

For the Macintosh, there is a program called EdMetrics which does the job (and more). It comes with the TEXtures distribution, but is in fact free software,

available as systems/mac/textures/utilities/EdMetrics.sea.hqx

MSDOS users can buy Y&Y’s Font Manipulation Tools package which includes a powerful afmtotfm program among many other goodies.

22 Problems using PostScript fonts

For the typical L^{A}TEX user trying to use the PSNFSS (see question 20) package, three questions often arise.

Firstly, you have to declare to the dvi driver that you are using PostScript fonts; in the case of dvips, this means adding lines to the psfonts.map file. Otherwise, TEX will try to find PK files. If the font isn’t built into the printer, you have to buy it! And then instruct the driver to download it with each job (the mechanism depends on your driver). So its no good just installing the metrics for Optima and expecting it to work. You have to pay hard cash for the font itself, which will come (for Unix and DOS users) in pfb (Printer Font Binary) form.

Secondly, you cannot expect your previewer to suddenly start displaying PostScript fonts; most of them only know about PK bitmap fonts like Computer Modern. You can create these from PostScript fonts if you have bought the pfb file by using ps2pk (fonts/utilities/ps2pk); this would also let you use the fonts with non-PostScript device drivers like the emTEX ones. It is your responsibility to make sure you are not breaking the license restrictions on your font if you bought it.

Thirdly, the stretch and shrink between words is a function of the font metric. The PostScript metrics that come with PSNFSS do quite tight setting, which may produce a lot of hyphenation or overfull boxes if you are not careful. If you are having trouble, Alan Jeffrey recommends the following settings in a package file:

   \tolerance800
   \emergencystretch2em

   \doublehyphendemerits5000
   \hfuzz0pt
   \leftskip0pt minus 1pt
   \rightskip0pt minus 1pt

23 Including a PostScript figure in L^{A}TEX

L^{A}TEX 2ε (see question 71) has a standard package for graphics inclusion, rotation, colour, and other driver-related features. The package is documented in the second edition of the Lamport’s L^{A}TEX book (see question 9), and is available

in macros/latex/packages/graphics

If you don’t use L^{A}TEX 2ε, perhaps the best method is to use the psfig macros written by Trevor Darrell, available in graphics/psfig

You will also need a dvi to PostScript conversion program that supports the \specials. The drivers mentioned in question 17 do, and come with a version of psfig ready to use with them. The psfig macros work best with Encapsulated PostScript Files (EPS). In particular, psfig will need the file to have a BoundingBox (see Appendix H of the PostScript Language Reference Manual). If you don’t have an EPS file, life can be difficult.

One point to note about including PostScript figures is that they are not part of the dvi file, but are only included when you use a dvi to PostScript conversion program. As a result, most dvi previewers will simply show the blank space TEX has reserved for your figure, not the figure itself.

Anil K. Goel has written a long document describing in detail how to include figures, pictures, and images in L^{A}TEX documents, which is available as info/

figsinltx.ps

G TEX Systems

24 TEX/L^{A}TEX for different machines

Unix Instructions for retrieving the Unix TEX distribution via anonymous ftp are available in the document systems/unix/unixtex.ftp

AIX TEX for the IBM RS6000 running AIX is available in systems/unix/

     aix3.2

386/ix Executables for 386/ix are available in systems/unix/386ix

PC The emTEX package for PCs running MS-DOS or OS/2 includes L^{A}TEX, BibTEX, previewers, and drivers is available in systems/msdos/emtex

The package was written by Eberhard Mattes, and documentation is available in both German and English. Windows users should get the beta-test release of emTEX, and the RSX memory extender.

A second package, GTEX, runs under MS-DOS or Windows but is not otherwise as comprehensive as is emTEX (though its users speak well of it). It is available from systems/msdos/gtex TUG (and some of the other user groups) offer all freely-available TEX software for the PC. A catalogue is available free from TUG (see question 7).

Mac OzTEX is a shareware version of TEX for the Macintosh. A dvi Previewer and PostScript driver are also included. It should run on any Macintosh Plus, SE, II, or newer model, but will not work on a 128K or 512K Mac. It was written by Andrew Trevorrow, and is available in systems/mac/ oztex, or on floppy disks from TUG (see question 7). UK TUG prepays the shareware fee, so that members of UK TUG may acquire the software without further payment. Questions about OzTEX may be directed to

oztex@midway.uchicago.edu.

Another partly shareware program is CMacTeX (available as systems/ mac/cmactex), put together by Tom Kiffe. This is much closer to the Unix TEX setup (it uses dvips, for instance).

VMS TEX for VMS is available as systems/vms/Alpha/tex_axp_exe.zip (for
Alpha-based machines) or systems/vms/VAX/tex_vax_exe.zip (for VAX

machines). Standard tape distribution is through DECUS (see question 48) or Maria Code.

Atari TEX is available for the Atari ST in systems/atari If anonymous ftp is not available to you, send a message containing the

line “help” to atari@atari.archive.umich.edu. The mail server can

uuencode binary files.

Amiga Full implementations of TEX 3.1 (PasTEX) and 2.7 are

available in systems/amiga

You can also order a CDROM containing this and other Amiga software from Walnut Creek CDROM, telephone (+1) 510 947 5997.

TOPS-20 TEX was originally written on a DEC-10 under WAITS, and so was easily ported to TOPS-20. A distribution that runs on TOPS-20 is available via anonymous ftp from ftp.math.utah.edu (128.110.198.34)

in pub/tex/pub/web

25 Commercial TEX vendors

Blue Sky Research Y & Y TCI / SciWord Yannis for ScholarTEX(?)

7

7QUERY: CD-ROM vendors here?  Or elsewhere?

H Support Packages for TEX

26 Fig, a TEX-friendly drawing package

(X)Fig is a menu driven tool similar to MacDraw that allows you to draw objects on the screen of an X workstation. TransFig is a set of tools which translate the code fig produces to other graphics languages including PostScript and the L^{A}TEX picture environment. They are available in graphics/xfig and graphics/

transfig

Fig is supported by Micah Beck (beck@cs.cornell.edu) and Transfig is maintained by Brian Smith (bvsmith@lbl.gov). Another tool for fig conversion is fig2MF which generates code from fig input. It is available in

graphics/fig2mf

27 TEXCAD, a friendly drawing package for L^{A}TEX

TEXCAD is a program for the PC which enables the user to draw diagrams on screen using a mouse or arrow keys, with an on-screen menu of available picture-elements. Its output is code for the L^{A}TEX picture environment. Optionally, it can be set to include lines at all angles using dvihplj’s \specials (see question 16). TEXCAD is part of the emTEX distribution.

28 Spelling checkers for work with TEX

For Unix, ispell is probably the program of choice. It is available in support/

ispell

For DOS, there are several programs. amspell is a TSR program which can be called from within an editor (available as support/amspell). jspell is an extended version of ispell (available as support/jspell).

For VMS, a spell checker can be found in support/vmspell

29 The VORTEX package

VORTEX is a package of programs written at the University of California. It includes several nice previewers and some Emacs modes for TEX and BibTEX. It is available in support/vortex

The VORTEX distribution is not maintained, and now looks distinctly long in the tooth.

I Literate programming

30 What is Literate Programming

Literate programming is the combination of documentation and source together in a fashion suited for reading by human beings. In general, literate programs combine source and documentation in a single file. Literate programming tools then parse the file to produce either readable documentation or compilable source. The WEB style of literate programming was created by D.E. Knuth during the development of his TEX typsetting software.

31 WEB for C, FORTRAN, and other languages

TEX is written in the programming language WEB; WEB is a tool to implement the concept of “literate programming”. For more information on literate programming, see the newsgroup comp.programming.literate or the help/ LitProg-FAQ There is a version of WEB for C called CWEB written by Silvio Levy, available as web/c_cpp/cweb

There is a version of WEB called Spidery WEB which supports many languages including Ada, awk, and C. It was written by Norman Ramsey and, while not in the public domain, is usable free. It is available in web/spiderweb

FWEB is a version of WEB for Fortran, Ratfor, and C written by John Krommes.It is available in web/fweb

SchemeWEB is a Unix filter that translates SchemeWEB into L^{A}TEX source or Scheme source. It was written by John Ramsdell and is available in web/

schemeweb

APLWEB is a version of WEB for APL and is available in web/apl/aplweb FunnelWeb is a version of WEB that is language independent. It is available

in web/funnelweb

Another language independent version of WEB is NUWEB (which is written in ANSI C), available in web/nuweb

J Miscellaneous (for want of a better title)

32 Converting other formats to TEX or L^{A}TEX (and viceversa)

There are various programs which can convert between TEX or L^{A}TEX and other word-processor or similar formats (such as troff).

troff troff-to-latex (available as support/troff-to-latex), written by Kamal Al-Yahya at Stanford University (California, USA), assists in the translation of a troff document into L^{A}TEX format. It recognises most -ms and -man macros, plus most eqn and some tbl preprocessor commands. Anything fancier needs to be done by hand. Two style files are provided. There is also a man page (which converts very well to L^{A}TEX…). The program is copyrighted but free. An enhanced version of this program, tr2latex, is available in support/tr2latex

The DECUS TEX distribution (see question 48) also contains a program which converts troff to TEX.

scribe Mark James has a copy of scribe2latex he has been unable to test but which he will let anyone interested have. Send email to jamesm@procor. dialogic.com. The program was written by Van Jacobson of Lawrence Berkeley Laboratory.

wordperfect wp2latex (available as support/wp2latex) is a PC program written in Turbo Pascal by R. C. Houtepen at the Eindhoven University in the Netherlands. It converts WordPerfect 5.0 documents to L^{A}TEX. Pascal source is included. Users find it “helpful” and “decent” in spite of some limitations. It gets high marks for handling font changes. Limitations include no indices, table of contents, margins or graphics. It also won’t handle the new features of WordPerfect 5.1, in particular the equation formatter. The program is copyrighted but free.

Glenn Geers of the University of Sydney, Australia (glenn@qed.physics. su.oz.au) is translating wp2latex into C and adding some WordPerfect 5.1 features, in particular its equation handling. This is the ‘glenn’ sub-

directory of support/wp2latex
PC-Write pcwritex.arc is available in support/pcwritex

This is a print driver for PC-Write that “prints” a PC-Write V2.71 document to a TEX-compatible disk file. It was written by Peter Flynn at University College, Cork, Republic of Ireland.

runoff Peter Vanroose (vanroose@esat.kuleuven.ac.be) has written a RUNOFFto-TEX conversion program in VMS Pascal. It is available from comp.text archives (they do exist, don’t they? the program was submitted in December 1987) or from the author (peter@dit.lth.se) or from Mark James

(jamesm@procor.dialogic.com). ^{8}

refer/tib There are a few programs for converting bibliographic data between BibTEX and refer/tib formats. They are in biblio/bibtex/utils/

refer-tools

In spite of the directory name, it also contains a shell script to convert BibTEX to refer as well. Unfortunately, this collection is not maintained.

RTF A program for converting Microsoft’s Rich text Format to TEX is available

in support/rtf2tex

It was written and is maintained by Robert Lupton (rhl@astro.princeton. edu). There is also an rtf2LateX written by Erwin Wechtl available in

support/rtf2latex

Microsoft Word A rudimentary program for converting MS-Word to L^{A}TEX is wd2latex, for MS-DOS (dviware/wd2latex

A better idea, however, is to convert the document to RTF format and use the RTF converter mentioned above.

8QUERY: RF has a copy, and will test ASAP

In addition, a group at Ohio State University (Ohio, USA) is working on a common document format based on SGML. In theory any format could be translated to or from this one. Also, Framemaker supposedly has “import filters” to aid in the translation from alien formats (presumably including TEX) to Framemaker; perhaps other desktop publishing programs have similar things.

K Special sorts of typesetting

33 Typesetting music in TEX

A powerful package which allows the typesetting of orchestral and polyphonic music is MusicTEX, written by Daniel Taupin (taupin@rsovax.lps.u-psud.

fr). It is available in macros/musictex

Digital music fans can typeset notation for their efforts by using MIDI2TEX, which translates MIDI data files into MusicTEX source code. It is available from

support/midi2tex

A rather simpler notation than MusicTEX is supported by abc2mtex; this is a package designed to notate tunes stored in an ascii format (abc notation). It was designed primarily for folk and traditional tunes of Western European origin (such as Irish, English and Scottish) which can be written on one stave in standard classical notation. However, it should be extendable to many other types of music. It is available from support/abc2mtex

There is a mailing list for discussion of typesetting music in TEX. To subscribe, send mail to mutex-request@stolaf.edu containing the word ‘subscribe’ in the body.

34 Double-spaced documents in L^{A}TEX

Are you producing a thesis, and trying to obey regulations that were drafted in the typewriter era? Or are you producing copy for a journal that insists on double spacing for the submitted articles?

L^{A}TEX is a typesetting system, so the appropriate design conventions are for “real books”. If your requirement is from thesis regulations, find whoever is responsible for the regulations, and try to get the wording changed to cater for typeset theses (e.g., to say “if using a typesetting system, aim to make your thesis look like a well-designed book”). (If your requirement is from a journal, you’re probably even less likely to be able to get the rules changed, of course.)

If you fail to convince your officials, or want some inter-line space for copyediting:

   • Try changing \baselinestretch: \renewcommand{\baselinestretch}{1.2}

may be enough to give officials the impression you’ve kept to their regulations. Don’t try changing \baselineskip: its value is reset at any size-changing command.

• Alternatively, use a line-spacing package. Options available are:

       – macros/latex209/contrib/misc/doublespace.sty, and
       – macros/latex209/contrib/misc/setspace.sty, which is more

flexible, and is consistent with L^{A}TEX 2ε.

It’s not worth going to a lot of trouble. (If officials won’t allow standard typographic conventions, you won’t be able to produce an aesthetically pleasing document anyway!)

35 Including a file in the verbatim environment in L^{A}TEX

A good way to do this is to use Rainer Schöpf’s verbatim.sty, which provides the command \verbatiminput that takes a file as an argument. This package

is available as part of macros/latex/packages/tools

Another way to do this is to use the alltt environment, which requires the

package available in macros/latex209/contrib/misc/alltt.sty

36 Generating an index in TEX/L^{A}TEX

Making an index is not trivial; what to index, and how index it, is difficult to decide, and uniform implementation is difficult to achieve. You will need to mark all items to be indexed in your text (typically with \index commands).

It is impractical (though admittedly not entirely impossible) to sort an index within TEX, so a post-processing program is used to sort the output of one TEX run, to be included into the document at the next run.

The following programs are available:

makeindex for L^{A}TEX under Unix (but runs under other OS’s without changes). Available in indexing/makeindex; a version for the Macintosh is available

     as systems/mac/macmakeindex.sit

The Makeindex documentation is a good source of information on how to create your own index. Makeindex can be used with some TEX macro packages other than L^{A}TEX, such as Eplain.

idxtex for L^{A}TEX under VMS. Available (together with a glossary-maker called

     glotex) in indexing/glo+idxtex

texindex A witty little shell/sed-script-based for L^{A}TEX under Unix. Available

     from support/texindex

37 Formatting a thesis in L^{A}TEX

Thesis styles are usually very specific to your University, so it’s usually not profitable to ask around for a package outside your own University. Since many Universities (in their eccentric way) still require double-spacing, you may care to refer to question 34. If you want to write your own, a good place to start is the University of California style, available as macros/latex209/contrib/

ucthesis

38 Symbols for “the real numbers”, “the complex numbers”, etc.

It is a good idea to have commands like \R for the real numbers and other standard number sets. Traditionally these were typeset in bold. Because mathematicians usually do not have access to bold chalk, they invented the special symbols that are now often used for \R, \C etc. These symbols are known as “blackboard bold”. Before insisting on using them, consider whether going back to the old system of ordinary bold might not be acceptable (it is certainly simpler).

A set of blackboard bold capitals are available in the AMS fonts “msam” (e.g., “msam10” for 10pt) and “msbm”, which replace the older “msxm” and “msym”. The fonts have a large number of mathematical symbols to supplement the ones in the standard TEX distribution. The fonts are available in fonts/

ams/amsfonts/sources/symbols

Two files which load the fonts and define the symbols are provided, and both work with either TEX or L^{A}TEX 2.09. Questions or suggestions regarding these

fonts should be directed to tech-support@math.ams.com. ^{9}

Another complete set of blackboard bold fonts, the bbold family, is available in (in fonts/bbold). This set has the interesting property of offering blackboard bold forms of lower-case letters, something rather rarely seen on actual blackboards.

39 Converting TEX or L^{A}TEX file into plain ASCII file

The aim here is to emulate nroff, which formats text as best it can for the screen or very simple paper, from the same input as the typsetting program troff.

Ralph Droms (droms@bucknell.edu) has a style file and a C program that provide the L^{A}TEX equivalent of nroff. Although it doesn’t do a good job with tables and mathematics, it’s the best way to convert that I’ve seen. The software is available in support/txt

This is a modification of the dvi2tty program; the original often does an acceptable job and is available in dviware/dvi2tty

Another possibility is to use screen.sty (available as macros/latex209/ contrib/misc/screen.sty). Use a dvi2tty program of some kind; you might try dviware/crudetype as well. Another possibility is to use the L^{A}TEX-to-ASCII conversion program, l2a, available from comp.sources.misc archives (one archive site is ftp.uu.net (192.48.96.9)), although this is really more of a de-TeXing program. It is available as support/l2a

40 Using BibTEX with plain TEX

The file macros/eplain/btxmac.tex contains TEX macros and documentation for using BibTEX with plain TEX, either directly or with Karl Berry’s Eplain package. See question 11 for more information about BibTEX itself.

9QUERY: What's reference for 2e?

41 Drawing Feynman diagrams in L^{A}TEX

Michael Levine’s macro package for drawing Feynman diagrams in L^{A}TEX is avail-

able in macros/latex209/contrib/feynman (see also macros/latex/contrib/
supported/feynmf).

42 Changing the margins in L^{A}TEX

This answer first helps you change the margins throughout a document, then tells you how to change the margins in a portion of the document.

Perhaps the easiest way to get more out of a page in L^{A}TEX is to get macros/

latex209/contrib/misc/fullpage.sty, which sets the margins of the page

identical to those of Plain TEX, i.e., 1-inch margins at all four sides of the paper. It also contains an adjustment for A4 paper. ^{10}

   Somewhat more flexible is macros/latex/contrib/other/misc/vmargin.sty,

which has a canned set of paper sizes (a superset of that provided in L^{A}TEX 2ε), provision for custom paper, margin adjustments and provision for two-sided printing.

Here is a brief explanation of what’s going on with the page parameters in L^{A}TEX. They are explained in section C.4.2 of the L^{A}TEX manual (p. 163). The margin parameters represent measurements made to the dvi file. The origin in dvi coordinates is one inch from the top of the paper and one inch from the left side. This explains the “one inch less than” terminology used in the L^{A}TEX manual. In dvi coordinates, positive horizontal measurements extend right across the page, and positive vertical measurements extend down the page. Thus, for margins closer to the left and top edges of the page than 1 inch, the corresponding parameters, e.g., \evensidemargin, \oddsidemargin, \topmargin, can be set to negative values.

Finally, to change the margins of a document within the document, modifying the parameters listed on page 163 will not work. They can only be changed in the preamble of the document, e.g., before the \begin{document} statement. To adjust the margins within a document we define an environment which does it:

\newenvironment{changemargin}[2]{%
 \begin{list}{}{%
  \setlength{\topsep}{0pt}%
  \setlength{\leftmargin}{#1}%
  \setlength{\rightmargin}{#2}%
  \setlength{\listparindent}{\parindent}%
  \setlength{\itemindent}{\parindent}%
  \setlength{\parsep}{0pt plus 1pt}%
 }%
\item[]}{\end{list}}

10QUERY: Do we still want this?  -- cf.  vmargin

This environment takes two arguments, and will indent the left and right margins by their values, respectively. Negative values will cause the margins to be narrowed, so \begin{changemargin}{-1cm}{-1cm} narrows the left and right margins by 1cm. (Note that the value given for \parsep is the default for L^{A}TEX; what should be there is “the value in the surrounding text”).

43 Finding the width of a letter, word, or phrase in TEX

Put the word in a box, and measure the width of the box. For example,

  \setbox0=\hbox{hi}
  width=\wd0

Note that if the quantity in the hbox is a phrase, the actual measurement only approximates this width, since the inter-word glue can be adjusted in paragraph mode.

The same thing is expressed in L^{A}TEX by:

  \newlength{\gnat}
  \settowidth{\gnat}{\bf small}

This sets the value of the length command \gnat to the width of “small” in emboldened text.

44 Excluding blocks of text from the .dvi file

Rainer Schöpf’s verbatim.sty provides a comment environment which excludes everything between \begin{comment} and \end{comment}. This package is

available as part of macros/latex/packages/tools

A more general environment for doing the job is Victor Eijkhout’s comment.sty, which lets you define environments for inclusion or exclusion in a document, thus offering a primitive configuration structure. It is available from the CTAN

sites in macros/latex209/contrib/misc/comment.sty

45 Defining a new log-like function in L^{A}TEX

Use the \mathop command, as in:

  \newcommand{\diag}{\mathop{\rm diag}}

Subscripts and superscripts on \diag will be placed exactly as they are on \lim. If you want your subscripts and superscripts placed to the right, do:

  \newcommand{\diag}{\mathop{\rm diag}\nolimits}

L ��������

46 Getting �������� to do what you want

allows you to create your own fonts, and ordinary TEX users will never need to use it. , unlike TEX, requires some customisation. Each output device for which you will be generating fonts needs a mode associated with it. Modes are defined using the mode_def convention described on page 94 of The book (see question 9). So first create a file, which we will call local.mf, containing all the mode_defs you will be using. Karl Berry’s collection of modes, available as fonts/modes/modes.mf, is a good starting point for this (or can be used as a ‘local.mf’ without modification). Lists of settings for various output devices are also published periodically in TUGboat (see question 7). Now create a plain base file using inimf, plain.mf, and

local.mf:
      % inimf

This is METAFONT…

      *plain  you type ‘plain’

(output)

input local  you type this

(output)

dump  you type this

Beginning to dump on file plain…

(output)

This should create a base file named plain.base (or something close) and should be moved to the directory containing the base files on your system.

Now you need to make sure loads this new base when it starts up. If loads the plain base by default on your system, then you’re ready to go. Under Unix (using the default web2c distribution^{11}) this does indeed happen, but we could for instance define a command mf which executes virmf &plain loading the plain base file.

The usual way to create a font with plain is to start it with the line

\mode=<mode name>;mag=<magnification>;input <font file name>

in response to the ‘**’ prompt or on the command line. If <mode name> is unknown or omitted, then the mode defaults to proof mode. If this has happened will produce an output file called <font file name>.2602gf. The <magnification> is a floating point number or magstep (magsteps are defined in The book and The TEXbook). If mag=<magnification> is omitted, then the default is 1. For example, to generate cmr10 at 12pt for an epson printer you would type

   mf \mode=epson; mag=1.2; input cmr10

11 The command name is symbolically linked to virmf, and virmf loads command_name.base

Note that under Unix the \ and ; characters must usually be escaped, so this would typically look something like

   mf \\mode=epson\; mag=1.2\; input cmr10

If you don’t have inimf or need a special mode that isn’t in the base, you can put its commands in a file (e.g., ln03.mf) and invoke it on the fly with the \smode command. For example, to create cmr10.300gf for an LN03 printer, using the file

   % This is ln03.mf as of 2/27/90
   % mode_def courtesy of John Sauter
   proofing:=0;
   fontmaking:=1;
   tracingtitles:=0;
   pixels_per_inch:=300;
   blacker:=0.65;
   fillin:=-0.1;
   o_correction:=.5;

(note the absence of the mode_def and enddef commands), you would type

   mf \smode="ln03"; input cmr10

This technique isn’t something you should regularly do, but it may prove useful if you acquire a new printer and want to experiment with parameters, or for some other reason are regularly editing the parameters you’re using. Once you’ve settled on an appropriate set of parameters, you should use them to rebuild the base file that you use.

A summary of the above written by Geoffrey Tobin, and tips about common

pitfalls in using  , is available as documentation/metafont_for_beginners.tex

47 Which font files should be kept

produces from its run three files, a metrics (tfm) file, a generic font (gf) file, and a log file; all of these files have the same base name as does the input (e.g., if the input file was cmr10.mf, the outputs will be cmr10.tfm,

cmr10.nnngf and cmr10.log).

To operate TEX using the font, you need a tfm file, so you need to keep that. However, you are likely to want generate the same font at more than one magnification, and each time you do so you’ll (incidentally) generate another tfm file. However, these files are all the same, and you only therefore need to retain one of them.

To produce preview or printed output, the dvi processor will need a font raster file; this is what the gf file provides. However, while there used (once upon a time) to be dvi processors that could use gf files, modern processors use packed raster (pk) files. Therefore, you need to generate a pk file from the gf file; the program gftopk does this for you, and once you’ve done that you should throw the gf file away.

The log file should never need to be used, unless there was some sort of problem in the run, and shouldn’t be kept by any ordinary user.

M Acquiring the Software

48 Repositories of TEX material

To aid the archiving and retrieval of of TEX-related files, a TUG working group developed the Comprehensive TEX Archive Network (CTAN). Each CTAN site has identical material, and maintains authoritative versions of its material. These collections are extensive; in particular, almost everything mentioned in this document is archived at the CTAN sites, even if not explicitly stated.

The CTAN sites are currently ftp.dante.de (129.206.100.192), ftp.tex. ac.uk (128.232.1.87), and ftp.shsu.edu (192.92.115.10). The organisation of TEX files on all these sites is identical and starts at tex-archive/. To reduce network load, please use the CTAN site or mirror closest to you. A complete and current list of CTAN sites and mirrors can be obtained by using the finger

utility to finger ctan_us@ftp.SHSU.edu. ^{12}

To find software at a CTAN site, use anonymous ftp to the host, and then

execute the command ‘quote site index <search-term>’.

The mail servers of the CTAN sites are not yet identical, but this is planned. Here is the current method of access via electronic mail: For the SHSU site, send a message with the line “help” to ftpmail@ftp.shsu.edu. This provides an ftp-like interface through mail.^{13}

There are several other repositories of TEX material available:

• ftp.cs.ruu.nl (131.211.80.17) also contains a substantial TEX archive with ftp access. To use it via email, send a message containing the line “help” to mail-server@cs.ruu.nl. This mail server can send binary files in a variety of different formats.

• There are LISTSERV facilities for TEX at LISTSERV@DHDURZ1.BITNET. Send a message containing the line “help” to this address.

• For users on BITNET, access to anonymous ftp for some files can be obtained indirectly by sending mail to BITFTP@PUCC.BITNET. Send a message containing the line “help” to this address for more information.

There is also the DECUS TEX collection, a collection of TEX material for VMS, Unix, MS-DOS, and the Macintosh. It is available via anonymous ftp from wuarchive.wustl.edu (128.252.135.4) in decus/tex/. It can also be obtained from the DECUS Library (reference number VS0058) in the US, or through your DECUS office outside of the US. To contact the DECUS Library, send mail or telephone:

12QUERY: Can we automate this to include here at run time?

13QUERY: does Dante have an email server?

The DECUS Program Library 219 Boston Post Road BP02 Marlboro, MA 01752-1850 Tel: (+1) 508-480-3418

or send electronic mail to the DECUS TEX Collection Editor, Ted Nieland, at

decus_tex@nieland.dayton.oh.us^{14}

49 Contributing a file to the archives

Use anonymous ftp to any CTAN archive (see question 48) and retrieve the file README.uploads in the root directory. It contains instructions for uploading files and notifying the appropriate people for that site.

If you cannot use ftp, mail your contribution to sty-mgr@shsu.edu and it will be passed along. You will make everyone’s life easier if you choose a descriptive and unique name for your submission, so it’s probably good idea to check that your style file’s name is not already in use by means of the ‘site index’ command (see question 48).

50 Finding new fonts

A comprehensive list of fonts is posted to comp.fonts and to comp. text.tex, roughly every six weeks, by Lee Quin (lee@sq.sq.com); it is available

as info/metafont-list

The list contains details both of commercial fonts and of fonts available via anonymous ftp. Most of the fonts are available via anonymous ftp from the CTAN archives (see question 48). An article on fonts by Dominik Wujastyk, available from CTAN in digests/texhax/txh/wujastyk.txh, contains information on fonts as well.

N Things are Going Wrong…

51 Weird hyphenation of words

You may have a version mismatch problem. The hyphenation system changed between version 2.9 and 3.0. If you are using (plain) TEX version 3.0 or later, make sure your plain.tex file has a version number which is at least 3.0. ^{15}

If you’re using L^{A}TEX 2ε, the problem probably arises from your lthyphen.cfg file, which has to be created if you’re using a multi-lingual version.

For those of you curious about the change, here’s what happened: in versions of TEX before 3.0 the hyphenation algorithm would not break a word if the part before the break was not at least two characters long, and the part after the break at least three characters long. Starting with version 3.0 two integer parameters, \lefthyphenmin and \righthyphenmin, control the length of these fragments. These are set to 2 and 3, respectively, in the new plain and lplain formats. They can be set to any value, of course, but if \lefthyphenmin + \righthyphenmin is greater than 62, all hyphenation is suppressed.

14QUERY: This address doesn't work...

15QUERY: What do we say about lplain.tex?

52 (Merely) peculiar word division

You may have found that TEX’s famed automatic word-division does not produce the break-points recommended by your dictionary. This is because TEX is set up for American English, whose rules for word division (as specified, for example, in Webster’s Dictionary) are completely different from the British ones (as specified, for example, in the Oxford Dictionaries). This problem is being addressed by the UK TEX User community (see Baskerville, issue 4.4) but will take time to be solved. An interim hyphenation file is available in language/

english/ukhyph.tex

53 Enlarging TEX

People sometimes get messages saying ‘memory capacity exceeded’. Most of the time this error can be fixed without enlarging TEX. The most common causes are unmatched braces, extra-long lines, and poorly-written macros. Extra-long lines are often introduced when files are transferred incorrectly between operating systems, and line-endings are not preserved properly (the tell-tale sign of an extra-long line error is when the complaint is that the ‘buf_size’ has overflowed).

If you really need to extend your TEX’s capacity, the proper method varies depending on your installation. In the purest form, you change the parameters in module 11 (“The following parameters can be changed...”) In less pure forms, you might need to modify a change file, or perhaps change some environment variables; emTEX, for one, allows you to adjust the space parameters on the command line. Consult the documentation that came with your particular implementation.

54 Moving tables and figures

If you did not read the manual carefully, you may be surprised that your figures and tables in a L^{A}TEX document do not come out where you intended. Just as in real journals and books, figures and tables float to a place where there is room for them without violating certain typographic rules. Even if you use the placement specifier h for ‘here’, the figure or table will not be printed ‘here’ if there is not room for it or if printing it there would break the rules.

On the whole, the rules are pretty sensible. It is a fact of life that putting each table or figure exactly ‘here’ in the text is not consistent with fixed pre-specified page-size. It’s good to get in the habit of writing ‘...in Table~\ref{mytable}...’ rather than assuming that your table will come exactly where you put it relative to your words of wisdom.

The rules, and the parameters on which they depend, are described in Section C.9.1 of the L^{A}TEX manual (see question 9). Unless you have a document with very small pages or an unusually high density of floats, it is not worth fighting with the default parameter values.

55 Disappearing tables and figures

If you have several tables one after the other (for example at the end of a document, as many journal editors request) you may find that L^{A}TEX runs out of memory without printing a single one of these tables. The problem is that L^{A}TEX is saving up the tables in its memory while it searches for some text to put on the page first. You can cure this by making sure that every table has ‘p’ in its placement specifier, and by issuing a \clearpage command every so often, at a ‘natural break’.

56 \pagestyle{empty} on first page in L^{A}TEX

If you use \pagestyle{empty}, but the first page is numbered anyway, you are probably using the \maketitle command too. This is not a bug but a feature! The standard L^{A}TEX styles are written so that initial pages (pages containing a \maketitle, \part, or \chapter) have a different page style from the rest of the document. Hence, the commands internally issue \thispagestyle{plain}. This is usually not acceptable behaviour if the surrounding page style is ‘empty’.

Possible workarounds include:

• Put \thispagestyle{empty} immediately after the command, with no blank line between them.

• Use fancyheadings.sty, which allows you to customise the style for initial pages indepently of that for body pages. It is available in macros/

     latex/contrib/other/fancyheadings

57 Odd behaviour of \rm, \bf, etc.

If commands like \rm and \bf have suddenly stopped working in L^{A}TEX in the way that you expect, it is likely that your sysop has installed a version of L^{A}TEX 2.09 with NFSS (see question 70). Complain loudly; ask your sysop to replace this version with L^{A}TEX 2ε (see question 71), in which commands like \rm and \bf work just as before if you are using one of the standard classes— article, report and book (among others). In the meantime, use the option oldlfont.sty, which should have been installed at the same time as NFSS.

58 Old L^{A}TEX font references like \tenrm

L^{A}TEX 2.09 defined a large set of commands for access to the fonts that it had built in to itself. For example, various flavours of cmr could be found as \fivrm,

\sixrm, \sevrm, \egtrm, \ninrm, \tenrm, \elvrm, \twlrm, \frtnrm, \svtnrm,
\twtyrm and \twfvrm.

These commands were never documented, but certain packages nevertheless used them to achieve effects they needed.

Since the commands weren’t public, they weren’t included in L^{A}TEX 2ε; to use the unconverted L^{A}TEX 2.09 packages under L^{A}TEX 2ε, you need also to include

the rawfonts.sty package.

59 Missing symbols

If some symbols, such as \Box and \lhd no longer appear to exist, then your sysop has probably upgraded your version of L^{A}TEX to either NFSS (see question 70) or L^{A}TEX 2ε (see question 71). In the former case, use oldlfont.sty, as in the question 57. In the latter, use the package latexsym, which is part of the standard L^{A}TEX 2ε distribution, or the package amsfonts, if it is available.

60 Incorrect cross-references for floats (figures and tables) in L^{A}TEX

Sometimes, however many times you run L^{A}TEX, the cross-references are just wrong. Remember that the \label command must come after the \caption command, or be part of it. For example,

\begin{figure}          \begin{figure}
\caption{A Figure} or \caption{A Figure
\label{fig}                \label{fig}}
\end{figure}            \end{figure}

61 \@ in macro names

A common source of problem in a L^{A}TEX document is the diagnostic about the appearance of the command \@. The most common complaint is “You can’t use ‘\spacefactor’ in vertical mode”, but other similar ones occur.

Such problems are usually caused by including a L^{A}TEX 2ε class or package file into a L^{A}TEX document by some means other than \documentclass or \usepackage. L^{A}TEX defines internal commands whose names contain the character @; this enables it to avoid clashes between its internal names and names that we would normally use in our documents. In order that these commands may work at all, \documentclass and \usepackage play around with the meaning of @. Solve this problem by using the correct command to include the file.

But, you will say, “The L^{A}TEX Companion tells me to use commands containing @!”

Indeed; for example, there’s a lengthy section about \@startsection and how to use it to control the appearance of section titles. Page 15 of The Companion explains this; and suggests that you make such changes in the document preamble, between \makeatletter and \makeatother. So the definition of \subsection on page 26 would appear as:

  \makeatletter
  \renewcommand{\subsection}{\@startsection
    {subsection}%                      % the name
    ...
    {\normalfont\normalsize\itshape}}% % the style
  \makeatother

62 Where are the msx and msx fonts?

The msx and msy fonts were designed by the American Mathematical Society in the very early days of TEX, for use in typesetting papers for mathematical journals. They were designed using the ‘old’ , which wasn’t portable and is no longer available; for a long time they were only available in 300dpi versions which only imperfectly matched modern printers. The AMS has now redesigned the fonts, using the current version of , and the new versions are called the msa and msb families; they are available from fonts/

ams/amsfonts/sources/symbols

Nevertheless, msx and msy continue to turn up to plague us. There are of course still sites that haven’t got around to upgrading; but even if everyone upgraded, there would still be the problem of old documents that specify them.

If you have a .tex source that requests msx and msy, the best technique is to edit it so that it requests msa and msb (you only need to change the single letter in the font names).

If you have a .dvi file that requests the fonts, there is a package of virtual fonts (see question 15) to map the old to the new series; it’s available in fonts/

vf-files/msx2msa

63 Where are the am fonts?

One still occasionally comes across a request for the am series of fonts. The initials stood for ‘Almost [Computer] Modern’, and they were the predecessors of the Computer Modern fonts that we all know and love (or hate). There’s not a lot one can do with these fonts; they are (as their name implies) almost (but not quite) the same as the cm series; if you’re faced with a document that requests them, all you can reasonably do is to edit the document. The appearance of .dvi files that request them is sufficiently rare that no-one has undertaken the mammoth task of creating a translation of them by means of virtual fonts.

O Why does it do that?

64 Why doesn’t it apply those paragraph parameters?

When TEX is laying out text, it doesn’t work from word to word, or from line to line; the smallest complete unit it formats is the paragraph. The paragraph is laid down in a buffer, as it appears, and isn’t touched further until the endparagraph marker is processed. It’s at this point that the paragraph parameters have effect; and it’s because of this sequence that one often makes mistakes that lead to the paragraph parameters not doing what one would have hoped (or expected).

Consider the following sequence of L^{A}TEX:

{\raggedright % declaration for ragged text
Here's text we want ranged left in our
typeset results.  But this is the only
paragraph we want set this way, so we now
end the group.}
Here's more that needn't be ragged...

TEX will open a group, and set the ragged-setting parameters within that group; it will then save a couple of sentences of text and close the group (thus restoring the previous value of the ragged-setting parameters). Then it encounters a blank line, which it knows to treat as a \par token, so it typesets the two sentences; but because the enclosing group has now been closed, the parameter settings have been lost, and the paragraph will be typeset normally.

The solution is simple: close the paragraph inside the group, so that the setting parameters remain in place. An appropriate way of doing that, I find, is to replace the last three lines above with:

end the group.\par}
Here's more that needn't be ragged...

In this way, the paragraph is completed while the setting parameters are still in force within the enclosing group.

65 What’s the reason for ‘protection’?

Sometimes L^{A}TEX saves data it will reread later. These data are often the argument of some command; these are the so-called moving arguments. (‘Moving’ because data is moved around.) Places to look for are all arguments that may go into table of contents, list of figures, etc.; namely, data that is written to an auxilliary file and read in later. Other places are those data that might appear in head- or footlines. Section headers and figure captions are the most prominent examples; there’s a complete list in Lamport’s book (see question 9).

What’s going on really, behind the scenes? The commands in the moving arguments are already expanded to their internal structure during the process of saving. Sometimes this expansion results in invalid TEX code when processed again. “\protect\cmd” tells L^{A}TEX to save \cmd as \cmd, without expansion.

What is a ‘fragile command’? It’s a command that expands into illegal TEX code during the save process.

What is a ‘robust command’? It’s a command that expands into legal TEX code during the save process.

No-one (of course) likes this situation; the L^{A}TEX3 team have removed the need for protection of some things in the production of L^{A}TEX 2ε, but the techniques available to them within current L^{A}TEX mean that this is an expensive exercise. It remains a long-term aim of the team to remove all need for these things.

P How do I do X in L^{A}TEX

66 Proof environment

It is not possible to make a proof environment which automatically includes an ‘end-of-proof’ symbol. Some proofs end in displayed Maths; others do not. If the input file contains ...\] \end{proof} then L^{A}TEX finishes off the displayed Maths and gets ready for a new line before it reads any instructions connected with ending the proof. But traditionally the end-of-proof sign goes in the display, not on a new line. So you just have to put it in by hand in every proof.

67 Roman theorems

If you want to take advantage of the powerful \newtheorem command without the constraint that the contents of the theorem is in a sloped font (for example, to use it to create remarks, examples, proofs, …) then you can use the style

file theorem.sty (part of macros/latex/packages/tools). Alternatively, the

following sets up an environment remark whose content is in roman.

   \newtheorem{preremark}{Remark}
   \newenvironment{remark}{\begin{preremark}\rm}{\end{preremark}}

This will not work if you are using NFSS (see question 70) outside of L^{A}TEX 2ε (see question 71), because the command \rm behaves differently there.

68 Labels on lists

If you want your top-level enumerates to be labelled ‘I/’, ‘II/’…., then give these commands:

   \renewcommand{\theenumi}{\Roman{enumi}}
   \renewcommand{\labelenumi}{\theenumi/}

The possible styles of numbering are given in Section 6.3 of Lamport’s book (see question 9). If you are lazy and just change \labelenumi in one go then your cross-references will be wrong.

   For lower level enumerates, replace enumi by enumii, enumiii or enumiv,

according to the level.

69 Style of section headings

Suppose that the editor of your favourite journal has specified that section headings must be centred, in small capitals, and subsection headings ragged right in italic, but that you don’t want to get involved in the sort of programming described in The Companion (see question 61). The following hack will probably satisfy your editor. Define yourself new commands

   \newcommand{\ssection}[1]{%
         \section[#1]{\protect\centering \sc #1}}
   \newcommand{\ssubsection}[1]{%
         \subsection[#1]{\protect\raggedright \it #1}}
and then use \ssection and \ssubsection place of \section and \subsection.

This isn’t perfect: section numbers remain in bold, and starred forms need a separate redefinition. Also, this will not work if you are using NFSS (see question 70) outside of L^{A}TEX 2ε (see question 71), because the font-changing commands behave differently there.

Q Recent Developments

70 The New Font Selection Scheme (NFSS)

NFSS was an extension to L^{A}TEX written by Frank Mittelbach and Rainer Schöpf. It is described in TUGboat, volume 10 (1989), No. 2. In traditional typesetting, fonts are described by four parameters: the family (e.g., computer modern), the series (i.e., the weight and width of the font, like light or bold), the shape (e.g., italic), and the size. NFSS is a mechanism allowing the user to change any of these independently. NFSS makes it relatively easy to use nonstandard fonts such as the PostScript ones with L^{A}TEX, and easy to change math fonts. It also allows dynamic loading of fonts at runtime (not when the format file is created).

With the demise of L^{A}TEX 2.09 as supported software, the label ‘NFSS’ has become somewhat misleading, as there’s no ‘old’ scheme to contrast it with — L^{A}TEX has incorporated the NFSS.

71 L^{A}TEX 2ε (the new standard L^{A}TEX)

L^{A}TEX 2ε is a new version of the L^{A}TEX package, prepared and supported by the L^{A}TEX3 project team. It moved out of its test phase in June 1994, and is now the standard L^{A}TEX; L^{A}TEX 2.09 is no longer supported.

L^{A}TEX 2ε is upwardly compatible with L^{A}TEX 2.09, but supports many new features, including:

• NFSS (see question 70) is now standard.

• SLiTEX is consolidated into it, so that there is no longer a need for a separate format.

• The author has better control of floating environments, such as figures.

• There is a documented interface for package and class writers (though there’s still no documentation of the designer’s interface).

• Enhanced box commands, e.g., options to specify the height of a minipage.

• \ref is now robust and can be used in \caption without being protected.

• \newcommand can define commands with one optional argument.

• A standard package for colour and graphics inclusion.

Since L^{A}TEX 2ε is supported, you can report bugs or problems with it by typing ‘latex latexbug’ and sending the report thus generated to latex-bugs@

uni-mainz.de.

72 The L^{A}TEX3 project

The L^{A}TEX3 project team is a small group of volunteers whose aim is to produce a major new document processing system based on the principles pioneered by Leslie Lamport in the current L^{A}TEX. It will remain freely available and it will be fully documented at all levels.

The L^{A}TEX3 team has already delivered its first product, L^{A}TEX 2ε (see question 71), which is a macro package based very largely on Lamport’s original code, but with modifications to make the result more readily supportable than was Lamport’s.

73 The Omega project

Omega (Ω) is a program built on top of TEX which works internally with 16-bit characters (Unicode); this allows it to work with most scripts in the world without any complications of coding schemes. Omega also has a powerful concept of input and output filters to allow the user to work with existing transliteration schemes, etc. Omega is an ongoing project by John Plaice (plaice@ift.

ulaval.ca) and Yannis Haralambous (Yannis.Haralambous@univ-lille.fr).

Contact Yannis to get on the discussion list.

74 The N_{T}S project

The NTS project first saw the light of day at the Hamburg meeting of dante during 1992, as a response to an aspiration to produce something even better than TEX. The project is not simply enhancing TEX, for two reasons: firstly, that TEX itself has been frozen at its present level of functionality by Knuth (see question 6), and secondly, even if they were allowed to develop the program, the members of the NTS team feel that TEX in its present form is simply unsuited to further development. While all those involved in the project are involved with, and committed to, TEX, they recognise that the end product may very well have little in common with TEX other than its philosophy.

The project is proceeding in two phases. The first is to re-write TEX in a language of the project’s choice, and using more modern programming techniques than were available to Knuth. Once this version is complete (in the sense that it satisfies the stringent requirements that people have of Knuth’s implementation), it will be made available to the world at large, and will become the basis of experiments in the design of advanced typesetting facilities; this new version will be known as ε-TEX.

The second phase of the project will be to produce an entirely new typesetting system, building on the experience gained in the first phase. This system, to be known as NTS, is to provide a stable basis for typesetting in the future, in the way that TEX has since it was first offered to the world.

R Perhaps There isn’t an Answer

75 What to do if you find a bug

For a start, make entirely sure you have found a bug. Double-check with books about TEX, L^{A}TEX, or whatever you’re using; compare what you’re seeing against the other answers above; ask every possible person you know who has any TEXrelated expertise.

The reasons for all this caution are various.

If you’ve found a bug in TEX itself, you’re a rare animal indeed. Don Knuth is so sure of the quality of his code that he offers real money prizes to finders of bugs; the cheques he writes are such rare items that they are seldom, if ever, cashed. If you think you have found a genuine fault in TEX itself (or - , or the CM fonts, or the TEXbook), don’t immediately write to Knuth, however. He only looks at bugs once or twice a year, and even then only after they are agreed as bugs by a small vetting team. In the first instance, contact Barbara Beeton at the AMS (bnb@e-math.ams.com), or contact TUG.

If you’ve found a bug in L^{A}TEX 2ε, you should submit its details to the L^{A}TEX3 team. To do this, you should use L^{A}TEX to process the file latexbug.tex, which is part of the L^{A}TEX 2ε distribution. The process will give you instructions about what to do with your bug report. Please be sparing of the team’s time; they’re doing work for the good of the whole L^{A}TEX community, and any time they spend tracking down non-bugs is time not available to write or debug new code.

If you’ve found a bug in L^{A}TEX2.09, or some other such unsupported software, there’s not a lot you can do about it. You may find help or de facto support on a newsgroup such as comp.tex.tex or on a mailing list such as uktex@tex.ac. uk, but posting non-bugs to any of these forums can lay you open to ridicule! Otherwise you need to go out and find yourself a willing TEX-consultant.