All documentation

Writing a mathematics course or paper

This guide writes one page of a course from start to finish — a definition, a theorem, its proof, an aligned calculation and a reference back to the theorem — and shows the habits that keep a long mathematical document consistent.

The page we are writing

Definition 1.1 (Group). A group is a set G with an associative operation, an identity element e, and an inverse for every element.

Theorem 1.2 (Uniqueness of the identity). A group has exactly one identity element.

Proof. Let e and e′ be two identity elements. Then e = e · e′ = e′. □

By Theorem 1.2, we may speak of the identity of a group.

Step 1 — A chapter

Insert a Heading, set its level to Chapter, and type "Groups". Statements will now be numbered 1.1, 1.2… If you prefer 1, 2, 3 throughout, do not use chapters: start with an H1 section instead.

Step 2 — The definition

  1. Insert a Theorem block.
  2. Click its heading and choose Definition.
  3. In the name field after the heading, type "Group".
  4. Type the statement. For the symbols, type $G$, $e$ and so on: each becomes a formula as you close the $.

The heading reads Definition 1.1 (Group).

Step 3 — The theorem

  1. Press Enter on the empty last line of the definition to leave it — or click below it — and insert another Theorem block.
  2. Leave its kind as Theorem, and name it "Uniqueness of the identity".
  3. Type the statement.

It is numbered 1.2: definitions and theorems share one counter, so the reader finds any statement by its number alone.

Step 4 — The proof

Hover the theorem and click Add a proof. Type the argument.

To set a calculation on its own lines inside the proof, press Enter for a new line, then insert an Equation from the left column: it lands inside the proof. Choose align to line the steps up:

e &= e \cdot e' \\
  &= e'

Choose Plain numbering for a calculation you will never refer to.

The □ that closes the proof is added by LaTeX.

Step 5 — Referring to the theorem

In the paragraph after the proof, type "By Theorem ", press Ctrl+Alt+R, and choose Theorem 1.2 in the list. Then finish the sentence.

If you later insert a lemma before the theorem, it becomes Theorem 1.3 — in its heading and in every sentence that refers to it.

Habits that pay off

  • Name the important results. A name is printed in the heading and makes the statement easy to find in the reference list.
  • Refer, never retype a number. A number typed by hand is wrong after the next insertion.
  • Number the equations you refer to, and only those. Mark the others Plain.
  • Put a sentence before a list in a statement. A statement that starts directly with a list prints its first item on the heading's line.
  • Keep one statement per block. A corollary after its theorem is a block of its own, not a paragraph inside the theorem.
  • Use remarks and examples for commentary. They are not numbered, so adding one never shifts your numbering.

Useful commands

You wantYou type
ℝ, ℕ, ℤ, ℚ, ℂ\mathbb{R}, \mathbb{N}…
A fraction\frac{a}{b}
Indices and powersx_i, x^{2n}
A sum with bounds\sum_{k=0}^{n} k
An integral\int_a^b f(x)\,dx
A limit\lim_{n \to \infty} u_n
Words inside a formula\text{if } x > 0
A definition by cases\begin{cases} x & \text{if } x \ge 0 \\ -x & \text{otherwise} \end{cases}
A norm, an absolute value\lVert x \rVert, \lvert x \rvert
Brackets that grow\left( \frac{a}{b} \right)

The symbol list has the rest, searchable by name.

What to know before a long document

  • Statements hold paragraphs, lists and equations only — no figure or table inside a theorem. Place them just after it.
  • The kinds are fixed: theorem, lemma, proposition, corollary, definition, remark, example, proof. For an axiom, a conjecture or an exercise, use the closest kind and say so in its name.
  • All numbered statements share one counter, restarted at each chapter.
  • Your own macros (\newcommand) are not available yet: write commands in full.