2. Basic LATEX

Society for Industrial and Applied Mathematics eBooks · 1997

2.1 Sample Document and Key Concepts We begin with an example. Illustrated on the next page is a LATEX document generated from the source file example.tex. The contents of the file are reproduced on the left and the box on the right shows the output produced when the file is run through LATEX and displayed. We follow this convention throughout the book: raw LATEX on the left, output on the right. Of course, rather than appearing in a little box, your output will be formatted in full-size pages. If you glance through the raw LATEX on the left of the next page (and at this stage you shouldn't look too carefully at the details) you will see various extra words preceded by the “backslash” character “\” such as \begin{equation} and \end{equation}, and special characters like $, ^, and _. These tell LATEX how to format the document. LATEX knows a large number of formatting commands, but we hope to make it clear in this book that most situations can be handled with a relatively small subset. You will also notice the lines \documentclass{article} \begin{document} at the beginning of the file and \end{document} at the end. Lines like these must appear in every LATEX. document; their use is discussed in §4.1. The rest of the examples in the book are to be regarded as small chunks of LATEX that live inside a complete document, and hence they will not include these commands. Extra commands are sometimes placed between \documentclass and \begin{document}; this part of the document is known as the preamble (see Figure 4.1, page 37).

Read the paper · More papers on PaperTik