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
- Any text can go on for several lines; it continues until the next keyword.
- In an
MCard:, theAnswer:can beOption 2, just2, the letterB, or the option’s own text. - Options can also be written as simple lines starting with
-. - Leave a blank line between cards to keep the text easy to read.
- If iToth finds a problem, it tells you the line number so you can fix it.
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:

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.

From Google Drive
- In Google Drive, open the picture’s Share settings and set General access to Anyone with the link.
- Choose Copy link. You get something like:
https://drive.google.com/file/d/1AbCdEfGhIjKlMnOp/view?usp=sharing - Copy the part between
/d/and/view(here1AbCdEfGhIjKlMnOp). That is the file ID. - Put the ID into this address:

The Drive share link itself opens a web page, not the picture, so it won’t work as it is.
From Dropbox
- 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 - At the end, change
dl=0toraw=1. Keep everything else, includingrlkey=…:

Inside the deck file (works offline)
- Put your deck in a file named exactly
deck.cards, next to its pictures:deck.cards,heart.png,arm.jpg - In the deck, use just the picture’s file name:
 - Compress the files into a zip, then rename the zip to end in
.cardsz(for exampleanatomy.cardsz). - In iToth, tap +, then Add Cards, and choose the
.cardszfile.
The pictures are saved with your library and sync through iCloud, so they show up even without internet.
If a picture doesn’t show
- The address must start with
https://. Plainhttp://addresses are blocked by iOS for security. - The picture must be public. Anyone with the address has to be able to open it without signing in. Paste the address into a private browser window to check: you should see only the picture.
- The address can’t contain a
)character. Some addresses do (for example Wikipedia pages with parentheses in the name). Upload the picture somewhere else, or put it inside the deck file. - Pictures from the web need internet. For studying offline, put the pictures inside the deck file.
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: 
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
- Paste it: copy the whole text, open iToth and tap +, then Paste Deck. (iToth may also offer it on its own when you come back to the app.)
- Import a file: save the text as a file ending in
.cards(or.cardszwith pictures), then tap +, then Add Cards.
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.