\pagenumbering{roman} \begin{titlepage} \vspace*{1.3in} \begin{center} {\LARGE The \LATEX{} Document}\\[.25in] {\LARGE Preparation System}\\[.4in] {\large Leslie Lamport}\\[.6in] Second Preliminary Edition \\ \today\\[.5in] For \LATEX{} version 2.0., \TEX{} version 1.0 \end{center} \vspace{1in} \begin{center} Copyright \copyright 1983 \end{center} \end{titlepage} \pagestyle{plain} \chapter*{Preface} \addcontentsline{toc}{chapter}{Preface} \setcounter{page}{3} This is still a preliminary version of the \LATEX{} manual. In the final version, this preface will thank those who have helped me. The people who have helped me so far, by their comments on an earlier version or by their help in getting \LATEX{} running, are: Todd Allen, Robert Amsler, David Bacon, Stephen Barnard, Daniel Brotsky, David Fuchs, Richard Furuta, Andrew Hanson, Arthur Keller, Donald E. Knuth, Kenneth Laws, Tim Morgan, Mark Moriconi, Oren Patashnik, Martin Reges, Lynn Ruggles, Michael Spivak, and Gio Wiederhold. (Please let me know if your name was inadvertently omitted from this list.) You can join this select list by giving me your comments and suggestions on the following topics. \begin{itemize} \item This manual. Let me know about any errors, omissions, or things that aren't clear. \item \LATEX{} itself. People obviously will complain about bugs, but I'd also like to know about anomalies such as poor page breaking, and about anything else that \LATEX{} does or doesn't do which you find surprising. \end{itemize} To all you early users of \LATEX, good luck. Those who come after you will appreciate your efforts. \vspace{.15in} \begin{flushleft} Menlo Park\\ December 1983 \end{flushleft} \cleardoublepage \pagestyle{myheadings} \head{Contents} \thispagestyle{empty} \label{contents} \tableofcontents %\newpage %\thispagestyle{empty} %\vspace*{1pt} \newpage \thispagestyle{plain} \label{lof} \listoffigures \vspace{40pt} \listoftables \newpage \pagestyle{plain} \pagenumbering{arabic} \chapter*{Introduction} \addcontentsline{toc}{chapter}{Introduction} \LATEX{} is a computer program for generating many kinds of printed documents. You type in your text and some commands to say how you want it formatted, and \LATEX{} does the rest. For example, typing\index{!chapter} \begin{verbatim} \chapter{Getting Started} \end{verbatim} produced the chapter heading on page~\pageref{strt}, complete with chapter number, and the table of contents entry on page~\pageref{contents}. Even the page references in the preceding sentence were generated by \LATEX{}; as I'm typing this, I don't know on what page things will \index{!footnote}appear.\footnote{And I produced this footnote by typing \begin{flushleft} \tt ... will appear.\bs footnote \lb And I produced this footnote by ... \rb \end{flushleft}} Of course, \LATEX{} also does the obvious things, like deciding where to start a new line or a new page. \LATEX{} is a version of Donald \index{Knuth, Donald E.} Knuth's \TEX{}\index{tex} typesetting system, but it is much easier to use than the standard version of \TEX. This manual tells you everything you need to know to generate most documents; no prior knowledge of \TEX{} is required. The first thing you probably want to know about \LATEX{} is how it's pronounced. I won't tell you because I believe that pronunciation\index{pronunciation} should be determined by usage rather than fiat. \TEX{} is usually pronounced {\it teck}, so {\it lah}-teck, lah-{\it teck}, and {\it lay}-teck are logical choices. Since logic doesn't have much to do with such things, {\it lay}-tecks is also a possibility. However, pronouncing it as ``L.~A.~\TEX'' is definitely frowned upon. \LATEX{} was inspired by Brian Reid's\index{reid,brian} Scribe\index{scribe} system \cite{reid-popl,reid-scribe-manual}. While many ideas were stolen directly from Scribe, \LATEX{} does not attempt to emulate Scribe. A primary goal of a document preparation system like Scribe or \LATEX{} is to separate the specification of the document's logical \index{logical structure} structure from the specification of how it is to be printed. I typed \verb:\chapter{Getting Started}: to specify the beginning of a new chapter, a chapter being a logical component of the document. \LATEX{} decided how this logical structure is to be translated onto the printed page---i.e., by starting a new page, printing a chapter number followed by the chapter name in large type, etc. You tell \LATEX{} how it should print things like chapter headings by specifying the {\it document \index{document style} style}. \LATEX{} provides several standard document styles for you to choose from. You can easily change some aspects of the document style, such as producing a larger indentation at the beginning of a paragraph, or using Roman instead of Arabic numerals in the chapter number. Using the standard document styles with suitable modifications, most people will like the way \LATEX{} typesets their papers, reports and books. There will always be special cases that no standard document style can handle. For example, the standard \LATEX{} document styles aren't well suited for typesetting the Old Testament. Fortunately, you can design your own document \index{document styles, new} style. Unfortunately, it's not easy to do; you have to know a lot about \TEX{}, and you have to read the \LATEX{} {\it Document-Style Designer's Guide}, which has not yet been written. I expect there to be a few hardy souls who design new document styles and make them available to other \LATEX{} users. A document style created for typesetting the Old Testament can be used by someone else to typeset the New Testament. However, most users will be happy with document styles designed by others. A document style tells \LATEX{} how to print logical structures like chapters and enumerated lists. However, no document style can know about all possible logical structures. A recipe is a logical component of a cookbook, but none of the standard document styles knows about recipes. There's no \verb"\recipe" command that's analogous to the \verb"\chapter" command; you have to tell \LATEX{} how to print your recipe. \LATEX{} has commands for specifying exactly how something is to be printed---what type style to use for the list of ingredients, how to number the cooking steps, etc. You can even define your own \verb"\recipe" command. While \LATEX{} provides simple commands for typesetting things the way you want them, these commands are not as powerful as the more complicated ones provided by \TEX{}. Since \LATEX{} is a version of \TEX, you can use almost all the ordinary \TEX{} commands in \LATEX. So, if you find yourself trying to do something that you can't in \LATEX, you can read \knuth{}\index{texbook} by Donald \index{knuth} Knuth \cite{knuth-tex82} to learn how to use the ordinary version of \TEX. \TEX{} was designed especially for typesetting \index{typesetting mathematics} mathematics, and it has many powerful commands for producing complicated mathematical formulas. If your documents contain only a few formulas, you'll be able to get by with the \LATEX{} commands and a little fudging. If they contain many formulas, then you'll probably want to read the parts of \knuth{} that talk about typesetting mathematics. If you are a mathematician, or a mathematician's typesetter, you should find out about \AMSTEX{}, a version of \TEX{} specially made for mathematicians. There will also be a version called {\it L}\AMSTEX{} that combines the features of \LATEX{} and \AMSTEX. \yspace Producing a document with \LATEX{} is a lot different from typing it directly. Your input file is filled with lots of funny commands, and you can't see exactly what the printed output will look like. Various document-production programs have been developed that are a lot easier to use---programs that show you on the screen what your document will look like when it's printed. These are sometimes called ``what you see \index{what you see is what you get} is what you get'' formatting systems, so I'll call them ``WYSIWYG\index{WYSIWYG systems} systems''. If these WYSIWYG programs are so easy to use, why did Knuth\index{knuth} bother to implement \TEX, and why did I compound the foolishness by implementing \LATEX{} on top of it? There are two reasons why someone should use \LATEX{} instead of a WYSIWYG program. The first is that it produces better quality output. The quality of typesetting done by \TEX{} is comparable to that of a book publisher, so your \LATEX{} output will look as good as an ordinary typeset book or journal. This is not true of any WYSIWYG system that I know about. The second and more important reason for using \LATEX{} is the enormous flexibility that it provides. In the words of Brian \index{reid,brian} Reid, these WYSIWYG systems are ``what you see is all you've got'' formatters. They can produce exactly what you see on your screen, but that's all they can do. With \LATEX{}, by changing a few declarations, you can completely change the appearance of your document. The same text may appear first in a short note, then as a chapter of a final report, and again as a journal article. Each time, it should be formatted differently. Even if your document will be printed only once, you may change your mind about how you want it formatted. With a WYSIWYG program, you'd have to reformat it yourself each time. With \LATEX, you just change some declarations. \yspace When casually reading this manual, it may seem like the names ``\TEX{}'' and ``\LATEX{}'' have been used interchangeably. However, the careful reader will note that I have tried to distinguish between standard \TEX{} and those features provided by \LATEX{}. This distinction is important only when you read \knuth{}, where you will learn that most of the \LATEX{} commands you have grown to know and love are not part of standard \TEX. Before telling you how to use \LATEX, I need to tell you how to use this manual. Chapter~1 tells you everything you have to know to start using \LATEX. You should read it very carefully, and finish reading it before doing anything else. The rest of the manual is a reference book; you can turn to it when you come to something that you don't know how to do. Chapter~1 tells you how to find what you need.