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 1: Writing documents

Section 1.1: Markup

In a LATEX document, you type your text along with markup to identify the important bits by name, for example ‘title’, ‘author’, ‘chapter’, ‘section’, ‘figure’, etc. LATEX does all the typesetting for you automatically, using the markup to apply the formatting rules (styles) you tell it to use.

Figure 1.1: Markup through history

The term ‘markup’ editorial notes or proofreader’s corrections, but the practice goes back to the beginning of writing (a very long time). It now means information added to a document for identification or formatting.

doc-55-1L-part
Anon , ‘Táin bó Cúailnge’1100
doc-23-part
Marjorie Kinnan Rawlings, ‘Varmints’1932
.h1 Interest RatesRunoff, Script1960s
:h1.Interest RatesGML/DCFc.1975
@Heading[Interest Rates]Scribec.1976
\section{Interest Rates}LATEX1984
<SEC><TTL>Interest Rates</TTL>...SGML (American Association of Publishers (AAP) DTD)1985
<div1><head>Interest Rates</head>...SGML (TEI)1989
<H1>Interest Rates</H1>SGML (HTML)1989
<sect1><title>Interest Rates</title>XML (DocBook)1995
<h1>Interest Rates</h1>XML (HTML5)2005

You can even see the history of computer markup in the names (h1 and H1, section, sec, sect1, etc).

In Figure 1.1 above you can see some examples of markup over the years. In the manuscript era (before printing) scribes often added extra information to what they were copying. In the days of the typewriter, publishers would add handwritten markup to the author’s typescript so the printer would know what to do with it. When computers started being used for text processing, systems tended to follow the established conventions: the similarity between the computer forms is striking, and not coincidental.

LATEX markup is all in (American) English, with a few abbreviations for long words to minimise typing, and a few exceptions in the case of packages written in other languages. Most people use an editor or online service with a menu or toolbar button which knows about LATEX markup, so actually typing it by hand is rare.

You do not need to format any of your text in your editor, because LATEX does the formatting all by itself when it typesets. You can of course regularise or neaten its appearance in your editor for your own ease of editing (for example, keeping each item in a list on a separate line), but this is not required.

You will often hear LATEX markup referred to as ‘commands’ or sometimes ‘control sequences’ (the proper TEXnical term for them). For all practical purposes these terms all mean the same thing.

Exercise 1.2 — Markup clarity check

See if you can remember, work out, or guess what the LATEX markup for these document elements is:

  1. a footnote  👁

  2. a section heading  👁

  3. the Table of Contents  👁

  4. an item in a list  👁

  5. a URL (web link)  👁

In the web version of this exercise you can click on the button after each one to see the answer at the place in this book where it is explained.