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. A little think about structure
  6. Sections
  7. Ordinary paragraphs

The Quick Start exercise in § 1.4 above was enough to show how a simple LATEX document works. Now we’re going to start looking at how a larger document is put together. If you skipped the whole of Chapter 1 ‘Writing documents’ above, 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 based on consistency. This means that as long as you identify each component of your document correctly, it will be typeset according to the conventions of the document class you have selected, in the same way as all the other components 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, and not keep chopping and changing.

The component parts of a document are called elements: all the pieces which make up the whole. Almost everyone who reads will be familiar with the common element types: books, reports, articles, parts, chapters, sections, subsections, headings, titles, subtitles, paragraphs, lists, tables, figures, sidebars, panels, notes, exercises, links, cross-references, bibliographies, indexes, and so on, even if they don’t consciously think about them.

Most of these are already built into LATEX in a styling suitable for drafts — it’s best to go with these to start with, as they are easy to modify later without having to change anything in your document text. LATEX gets the styles and some additional element type names from the document class which you specify in the first line of your LATEX document.

  1. Readers familiar with SGML, HTML, and XML will recognise 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: I don’t recommend it as there are much better ones you can use which you will find in the memoir package and the komascript bundle. 

  4. For most other purposes, especially for publication, you can use LATEX packages to extend these classes to do what you need. 

  5. ‘Letter’ size is 8½″×11″, which is the trimmed size of the long-obsolete Demy Quarto, still in use in North America. Other common US office sizes are ‘Legal’, which is 8½″×14″, a so-called ‘bastard’ (variant) cutting similar to the old Foolscap (8¼″×13¼″); Ledger or Tabloid (11″×17″, which is exactly twice ‘Letter’, in the same way that A3 is twice A4); and ‘Executive’ (7″×10″). The US still has many other sizes that are obsolete elsewhere, especially in government offices. International Organization for Standardization (ISO) standard ‘A’, ‘B’, and ‘C’ paper sizes, used everywhere else in the world, are still largely unknown in much of North America. 

  6. 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 the PostScript or PDF output. For this you need the geometry package 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. 

  7. Some publishers’ journal style packages REQUIRE the Abstract to be typed before the \maketitle because they do special formatting with it along with the title block. 

  8. It is arguable that parts and chapters are only used in very large reports: others 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 below). 

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