reaction is a complex datastructure that describes an experiment involving a multi-step reaction scheme (structures, roles, stoichiometry) and corresponding quantities and other metadata. Reactions can be embedded using the [reaction] shortcode.

The first level of rendering is typically the scheme, which is the universally recognised diagram format that all chemists are familiar with from the literature, and all kinds of electronic lab notebooks (whether paper or digital):

[reaction source="http://molpress.com/wp-content/uploads/2017/06/experiment.ds" facet="scheme"/]

The reaction scheme is displayed like so:

In addition to the scheme, there are other modes of content that can be presented from the experiment datastructure:

quantity:

metrics:

header:

There are several publicly available datastructures for describing chemical reactions, but most of them are relatively weak, especially the MDL RXN and RDfile formats, which provide very little detail about the reaction (essentially just reactant and product structures, with no reagents, stoichiometry or quantity information). The only format that is supported at the moment is the XML datasheet format with the Experiment aspect (which is a superset of the ReactionSheet and YieldSheet aspects).

Attributes that can be used with the reaction shortcode are as follows:

  • source: a URL to fetch the collection from, when the payload is not embedded. This is recommended over the embedding option. While any URL is valid, the content needs to be on the same server, since most web browsers forbid cross-domain lookup.
  • facet: one of scheme, quantity, metrics or header (see above for specific examples).
  • format: an optional force-format. The parameter can be a MIME type, or datasheet (currently only one format is supported).
  • row: by default the first reaction is rendered (row 0). If the datasheet contains multiple experiments, they can be referenced by providing this attribute.
  • stoichiometry: true by default; if false, stoichiometry labels are hidden.
  • annotations: false by default; if true, glyphs are used to annotate component role (primary reactants, waste products, stoichiometric reagents).
  • scheme: one of 4 available colouring schemes: wob = white on black, cob = colour on black, bow = black on white, cow = colour on white (default).
  • scale: the natural size of molecules, in pixels-per-Angstrom. The default is 20. This applies to reactants and products, while reagents may be scaled proportionately smaller.
  • maximumwidth: specifies a width that is used as a guideline for rendering multistep reactions: if adding additional steps increases the width beyond this value, the rendering direction is switched to bent mode, in order to more comfortably fit within the available space.
  • padding: number of pixels to space around the content (refers to the entire reaction, rather than individual components).
  • border: indicate the border colour to draw around the entire reaction; by default a faint border is drawn. The value should be provided as an HTML-style RGB string (#RRGGBB) or transparent to switch the border off.
  • background: indicate the background, which can be transparent, and HTML-style RGB string (#RRGGBB) or two colours separated by a comma to achieve a shading effect.
  • radius: the rounded corner effect, which is enabled by default. Specify 0 to make the enclosing box rectangular.
  • tight: by default the collection is given a healthy amount of padding, but this can be disabled by setting the value to false.

See also: Collections, Reactions