Chemical Structures (SMILES)

Use a fenced smiles block to draw a chemical structure from a SMILES string. For example, CCO describes ethanol:

```smiles, [.description: Ethanol, a two-carbon chain ending in a hydroxyl group]
CCO
```

Rendering is local and works offline. Diagrams appear in your slides and in PDF, image, and HTML exports.

Reading the diagram

Structures use skeletal notation. Unlabeled corners and line endpoints represent carbon atoms, and hydrogens attached to carbon are implicit. Other atom labels remain visible.

The ethanol example therefore has two line segments and a hydroxyl label, rather than a separate letter for every atom. Depending on the bond direction, a hydroxyl group may be labeled OH or HO; both identify an oxygen bonded to a hydrogen.

Wedge and hashed bonds show stereochemistry. Additional R/S labels and whole-molecule chirality annotations are omitted to keep the diagram readable.

Diagrams alongside text

The diagram fits its molecule’s bounds, so it can scale alongside headings, prose, and columns. This complete slide places caffeine beside an explanation of its structure:

theme: Fira, 6

# Caffeine

[.column]

## Fused rings

- Five- and six-membered rings
- Four nitrogen atoms
- Two carbonyl groups

[.column]

```smiles, [.desc: Caffeine, showing two fused rings with four nitrogen atoms and two carbonyl oxygen atoms]
CN1C=NC2=C1C(=O)N(C(=O)N2C)C
```

**C₈H₁₀N₄O₂**

Caffeine structure beside a two-column explanation of its fused rings, nitrogen atoms, and carbonyl groups

Accessible descriptions

Use .description or its shorter alias .desc after the fence language. Quoted descriptions are supported. Describe the molecule and the structural features relevant to your slide; these descriptions are used in accessible PDF and HTML exports. Missing or blank descriptions use “SMILES Molecule”.

See Accessible media for description syntax and export guidance.

Input and limits

Put one complete SMILES string in each block. Ring closures support single digits, two-digit labels such as %12, and parenthesized labels such as %(123). For example, C%(123)CCCCC%(123) and C1CCCCC1 draw the same six-carbon ring. Ring labels must match and close; at most 100 ring closures can be open at once.

Each block accepts up to 8,192 UTF-8 bytes and a structure of at most 256 atoms and 512 bonds. Invalid, empty, or overly complex input produces a readable error image instead of stopping the presentation. Its alternate text includes the error reason.

Find a topic, command, or Markdown example.