Your support for our advertisers helps cover the cost of hosting, research, and maintenance of this document

Formatting Information — An introduction to typesetting with LATEX

Chapter 2: Basic structures

In this chapter…

  1. The Document Class Declaration
  2. The document environment
  3. Titling
  4. Abstracts and summaries
  5. Sections
  6. Ordinary paragraphs
  7. Table of contents

If the quick-start exercise in § 1.2 was enough to show you how a LATEX document works, then this is where you get the rest of the basic information. If you skipped the chapter ‘Writing documents’ then be prepared to go back to some of the sections in it, because I'll be referring to things you might not have come across yet.

LATEX's approach to formatting is to aim for consistency. This means that as long as you identify each element of your document correctly, it will be typeset in the same way as all the other elements like it, so that you achieve a consistent finish with minimum effort.

Consistency helps make documents easier to read and understand, as well as making them more visually attractive. Consistency is also what editors, reviewers, and publishers look for. Publishers have a house style, and often a reputation to keep, so they rightly insist that if you do something a certain way once, you should do it the same way each time.

‘Elements’ are the component parts of a document: all the pieces which make up the whole. Almost everyone who reads books, newspapers, magazines, reports, articles, and other classes of documents will be familiar with the common structure of parts, chapters, sections, subsections, subsubsections, titles, subtitles, paragraphs, lists, tables, figures, and so on, even if they don't consciously think about them.

  1. Readers familiar with SGML, HTML, and XML will recognize the concept as similar to the Document Type Declaration (it's still called a ‘type’ there, not a ‘class’). 

  2. Theses and dissertations require an Abstract, which is provided in the report class but not in the book class. Many universities provide a special thesis class of their own. 

  3. The built-in letter class is rather idiosyncratic: there are much better ones you can use which you will find in the memoir package and the komascript bundle. 

  4. Letter size is 8½″×11″, which is the trimmed size of the long-obsolete Demy Quarto, still in use in North America. The other common US office size is ‘Legal’, which is 8½″×14″, a variant cutting close to the old Foolscap (8¼″×13¼″). ISO standard ‘A’, ‘B’, and ‘C’ paper sizes, used everywhere else, are still virtually unknown in most parts of North America. 

  5. Note that the standard built-in document classes (book, article, report, or letter) only use the paper size to adjust the margins: they do not embed the paper size name in any PostScript or PDF output file. For this you need the geometry package. If you are using pdf LATEX, or intend creating PostScript output, and you want to change the default paper size, you must specify it both in the Document Class option and as an option to the geometry package (see the example ‘Read all about it’), in order to ensure that the paper size name gets embedded correctly in the output, otherwise printers may select the wrong paper tray, or reject the job. 

  6. If you're familiar with HTML, you'll recognise this technique: just like start-tags and end-tags. 

  7. It is arguable that chapters also have no place in reports, either, as these are conventionally divided into sections as the top-level division. LATEX, however, assumes your reports have chapters, but this is only the default, and can be changed very simply (see § 7.6). 

  8. Paragraph spacing and indentation are cultural settings. If you are typesetting in a language other than English, you should use the babel package, which alters many things, including the spacing and the naming of sections, to conform with the standards of different countries and languages.