Skip to content

Examples

Real chemistry, real AsciiChem. Each example shows the source, the model, and the rendered MathML.

Source Rendered
H_2O CuSO_4
Install the asciichem gem to see this rendered.

(Hydrate notation — the middle-dot separator — is not yet in the grammar; carry the water of crystallisation as a separate term or an annotation.)

Source Rendered
^14C ^131I ^238U
Install the asciichem gem to see this rendered.

Carbon-14 for radiodating, iodine-131 for medical imaging, uranium-238 for the decay series.

Source Rendered
[Fe(CN)_6] [Fe(CN)_6]_3
Install the asciichem gem to see this rendered.

(Charges outside a bracket group don’t parse in v1 — see Molecules.)

Source Rendered
HAc <=> Ac^- + H^+
Install the asciichem gem to see this rendered.

For the K_a expression, see embedded math.

Source Rendered
2Na + Cl_2 -> 2NaCl MnO_4^- + 8H^+ -> Mn^2+ + 4H_2O
Install the asciichem gem to see this rendered.

(Electrons as e^- are not yet in the grammar — no pseudo-element for the electron; balance the half-reaction without it or carry the electron count in prose.)

Source Rendered
CH_4 + 2O_2 -> CO_2 + 2H_2O CH_2=CH_2
Install the asciichem gem to see this rendered.
Source Rendered
1s^2 2s^2 2p^6 3s^2 3p^6 4s^2 3d^10
Install the asciichem gem to see this rendered.

Ground state of zinc.

Source Rendered
N_2 + 3H_2 <=>[Fe][400°C] 2NH_3 2SO_2 + O_2 <=>[V_2O_5] 2SO_3
Install the asciichem gem to see this rendered.

The Haber process and the contact process — both with catalysts and conditions on the equilibrium arrow.

Every example on this page round-trips through the parser. Verify locally:

Terminal window
bundle exec asciichem roundtrip -i "N_2 + 3H_2 <=>[Fe][400°C] 2NH_3"
Play