How to write a deck

A deck is plain text. You can write it in Notes, any text editor, or a chat, then paste it into iToth. No special app or file format needed.

On this page: The template · The rules · Formulas · Pictures · A complete example · Add it to iToth

The template

Copy this, change the words, and you have a deck.

= My First Deck
Subject: Geography
Tags: capitals, example

Card: What is the capital of Japan?
Answer: Tokyo
Explanation: Optional. Shown under the answer.

MCard: What is the capital of Brazil?
Option 1: Rio de Janeiro
Option 2: Brasília
Option 3: São Paulo
Answer: Option 2

The rules

Line What it does Needed?
= Title Starts a deck. Each = line starts a new deck, so one text can hold several decks. Yes
Subject: The deck’s subject, used to sort the Library. Goes before the first card. No
Tags: Words to search and sort by, separated by commas. Goes before the first card. No
Card: A card you flip: the question is on the front. One Card: or MCard: per question
Description: Extra text for the front of the card, like a picture or a longer question. No
Answer: The back of the card. For MCard:, the right option. Yes
Explanation: Shown under the answer, to say why. No
MCard: A multiple-choice card. List the choices with Option 1:, Option 2: and so on. —

Good to know

Formulas

Write formulas in LaTeX, the standard way to type math:

You write You get
$x^2$ A formula inside a sentence
$$\int_0^1 x^2\,dx = \frac{1}{3}$$ A formula on its own line, centered
\$5 A plain dollar sign, not a formula

Some useful pieces: \frac{a}{b} (fraction), \sqrt{x} (square root), x^{2} (power), x_{1} (index), \int \sum \lim (integral, sum, limit), \alpha \beta \pi (Greek letters), \rightarrow (arrow). For chemistry, use subscripts: $H_2O$, $CO_2$.

Pictures

Add a picture on its own line:

![Short description of the picture](picture address)

The description in square brackets is read aloud by VoiceOver and shown if the picture can’t load. The address in parentheses depends on where your picture is. Pick the one that fits:

From a website

Use the address of the picture itself, not of the page that shows it. On most websites, right-click (or touch and hold) the picture and choose Copy Image Address. The address usually ends in .png, .jpg, .gif or .webp.

![Lobes of the brain](https://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/Lobes_of_the_brain_NL.svg/960px-Lobes_of_the_brain_NL.svg.png)

From Google Drive

  1. In Google Drive, open the picture’s Share settings and set General access to Anyone with the link.
  2. Choose Copy link. You get something like:
    https://drive.google.com/file/d/1AbCdEfGhIjKlMnOp/view?usp=sharing
  3. Copy the part between /d/ and /view (here 1AbCdEfGhIjKlMnOp). That is the file ID.
  4. Put the ID into this address:
![My diagram](https://drive.google.com/thumbnail?id=1AbCdEfGhIjKlMnOp&sz=w1600)

The Drive share link itself opens a web page, not the picture, so it won’t work as it is.

From Dropbox

  1. In Dropbox, choose Share on the picture, then Copy link. You get something like:
    https://www.dropbox.com/scl/fi/abc123/heart.png?rlkey=xyz789&dl=0
  2. At the end, change dl=0 to raw=1. Keep everything else, including rlkey=…:
![Heart diagram](https://www.dropbox.com/scl/fi/abc123/heart.png?rlkey=xyz789&raw=1)

Inside the deck file (works offline)

  1. Put your deck in a file named exactly deck.cards, next to its pictures:
    deck.cards, heart.png, arm.jpg
  2. In the deck, use just the picture’s file name: ![Heart diagram](heart.png)
  3. Compress the files into a zip, then rename the zip to end in .cardsz (for example anatomy.cardsz).
  4. In iToth, tap +, then Add Cards, and choose the .cardsz file.

The pictures are saved with your library and sync through iCloud, so they show up even without internet.

If a picture doesn’t show

When a picture can’t load, the card shows its description instead, so the card still makes sense.

A complete example

This deck uses everything on this page: a deck header, a picture from the web, formulas inside a sentence and on their own line, and multiple choice. Copy it and paste it into iToth to try it.

= Science Sampler
Subject: Science
Tags: example, formulas, pictures

Card: The blue lobe
Description: ![Side view of the brain with the lobes in colors](https://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/Lobes_of_the_brain_NL.svg/960px-Lobes_of_the_brain_NL.svg.png)
Which lobe is shown in blue?
Answer: The frontal lobe.
Explanation: It handles planning, decisions, movement and speech.

Card: Area of a circle
Answer: $A = \pi r^2$, where $r$ is the radius.

Card: The quadratic formula
Description: Solve $ax^2 + bx + c = 0$.
Answer: $$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$

MCard: What is $\int_0^1 x^2\,dx$?
Option 1: $\frac{1}{2}$
Option 2: $\frac{1}{3}$
Option 3: $1$
Answer: Option 2
Explanation: $\int_0^1 x^2\,dx = \left[\frac{x^3}{3}\right]_0^1 = \frac{1}{3}$

Card: Water
Answer: $H_2O$: two hydrogen atoms and one oxygen atom.

Add it to iToth

If the text holds several decks, you can add them as separate decks or as one book, with each deck as a chapter. In the app, + → How to Write a Deck shows this template too, with a Copy Template button.