Skip to content

Templates

nodemode-ai edited this page Dec 6, 2026 · 1 revision

Templates

From 0.14.0 the template library holds only starter molecule structures and whole real molecules, not single parts: that is the owner's rule for it. A protecting group, a linkage, a bare ring skeleton or a generic projection is not a template; Boc, Fmoc, TBS and the other groups are in the abbreviation library (Stereo and Queries), and glassware has its own gallery.

The library

Insert > Template... and Home's Templates page show 260 named compounds in ten categories:

Category Count Examples
Starter structures 36 benzene, toluene, phenol, aniline, the cycloalkanes, cyclohexane chairs, cubane, adamantane, trans-decalin
Heterocycles 45 pyridine, pyrrole, thiophene, indole, purine as parent compounds
Polycyclic aromatics 15 naphthalene, anthracene, phenanthrene, pyrene
Amino acids 26 the L amino acids, D-alanine, L-ornithine, GABA
Sugars 18 glucose and the common sugars in Haworth and skeletal forms
Nucleobases and nucleosides 18 adenine to uracil and their nucleosides
Common drugs 27 aspirin, ibuprofen, caffeine, paracetamol, morphine, codeine
Natural products 22 camphor, cholesterol, cocaine
Reagents and catalysts 30 NaBH4, LiAlH4, LDA, n-BuLi, DIBAL-H, HATU, AIBN; salts drawn as ions
Solvents 23 THF, dioxane, DMSO, DMF, the chlorinated solvents

Every entry is a real compound with its InChIKey, checked against PubChem's record and built by the engine without problems. Search by name or tag in the dialog; on Home, typing 14 or more characters of an InChIKey finds the compound too. Haworth and Fischer drawings carry their stereo by the drawing convention, which FormChem does not read back, so their computed key has no stereo layer; the skeletal entries of the same sugars carry full stereo.

Placing a template

With a drawing open and "Place by clicking on the canvas" on (the default, remembered), picking a card arms the Template tool in the rail's Rings group:

  • click an atom: the template attaches through its free attachment atom (or its least connected atom) along the atom's next free direction;
  • click a bond: the template's first ring bond is laid onto the clicked bond and the template goes to the emptier side, or the side you drag toward;
  • click empty paper: the template is placed there.

Template atoms that land on an existing atom merge with it, and each placement is one undo step. Turn the option off, or use Home, to insert a template in the middle of the view as before. Agents use attach_template and fuse_ring (Agents).

Glassware

Insert > Glassware... places the eleven glassware drawings (round-bottom and Erlenmeyer flasks, beaker, test tube, graduated cylinder, separatory, filter and Buchner funnels, condenser, thermometer and stirrer hotplate) as editable vector groups, one undo step each. They live apart from the template library (backend/app/data/templates/glassware/, GET /api/glassware).

Your own templates

Put JSON files in ~/formchem/templates (or FORMCHEM_DATA_DIR/templates) in the format of docs/TEMPLATES.md; they show with the built-in ones, marked as yours. The whole-molecule rule is for the built-in library; your own files are yours to fill.

Changed in 0.14.0

The 0.5.0 library had 206 templates in nine categories, among them 25 protecting groups, generic steroid skeletons, generic Haworth rings, a phosphodiester and a dipeptide backbone. Those parts are gone. Ids were kept where the compound stayed (benzene, pyridine, l-alanine, glucose-smiles), so drawings and agent calls that name them still work; tetrahydrofuran is now thf in Solvents and decalin is trans-decalin.

Clone this wiki locally