Guide · 6 of 8
Figures, tables and math
Bring in pictures and data, and write math as you would in LaTeX.
Bring in data
A figure can refer to an image file. A table can read a CSV. Paths are relative to the document’s folder.
[title: Three rooms]
[subtitle: Echo time after a balloon pop]
[main:
[col:
[figure:
[image src="assets/decay.svg" alt="Sound level falling over time in three rooms":]
Level after the balloon pop
]
]
[col:
[table src="assets/rooms.csv" widths=(2, 1, 1):
The rooms we measured
]
]
]Write math
Type a formula between $ signs within text, or use $$ on separate lines to give it a line of its own.
[title: Break a wave into frequencies]
[subtitle: The Fourier transform]
[main:
**Fourier transform** finds tones.[^f]
- $f(t)$ is the signal in time.
- $\hat{f}(\omega)$ is the spectrum.
$$
\hat{f}(\omega) = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{\infty} f(t)\,e^{-i\omega t}\,dt
$$
[^f]: The inverse recovers $f(t)$.
]Choose a math face
A theme draws its math in one face. style="--math-font: fira" on an element draws the math inside it in another (fira, stix2 or newcm), nested elements included.
[title: One formula, two math fonts]
[subtitle: Pick the face by where the formula sits]
[main:
[col style="--math-font: stix2":
**STIX** — for the text
$$
\omega = \Omega\cos\varphi + \alpha
$$
]
[col style="--math-font: fira":
**Fira** — for a figure
$$
\omega = \Omega\cos\varphi + \alpha
$$
]
]Write chemistry
Inside math, \ce{…} writes formulas and reactions as the mhchem package does: numbers become subscripts (\ce{H2O}), a charge follows ^ (\ce{Fe^3+}), and -> is the arrow of a reaction.
For ring structures like the ones below, insert an SVG image. The formulas under the rings use \ce{…}.
[title: One aromatic ring, two molecules]
[subtitle: Phenol has a hydroxyl group in place of one hydrogen]
[main:
[col:
[figure h=480px:
[image src="assets/benzene-ring.svg" alt="A hexagonal benzene ring with a circle inside":]
Benzene · $\ce{C6H6}$
]
]
[col:
[figure h=480px:
[image src="assets/phenol-ring.svg" alt="The same aromatic ring with one OH group bonded to a corner":]
Phenol · $\ce{C6H5OH}$
]
]
]