tikz.dev / chemfig Manual

chemfig

Horizontal reactions

3 Compound names

To display the ⟨name⟩ of a ⟨compound⟩, either of the following syntaxes can be used:

  • \chemname[⟨dimension⟩]{⟨compound⟩}{⟨name⟩};

  • ⟨compound⟩\name[⟨dimension⟩]{⟨name⟩} or \name[⟨dimension⟩]{⟨name⟩}⟨compound⟩, the order of appearance being irrelevant

The optional ⟨dimension⟩ is the minimum distance between the ⟨compound⟩ box and the ⟨name⟩ box. When omitted, its default value is the value of the name sep key.

All names are numbered name⟨n⟩ where ⟨n⟩ is the integer corresponding to ⟨compound⟩. They are placed in boxes whose width is that of ⟨compound⟩. The upper borders of these boxes on the same horizontal line are positioned vertically so as to be below the compound with the greatest depth.

Compiled output

Names of compounds
\hreac[hreac debug]
\chemfig{*6(-=-=-=)}\name{cycle}
+
\chemfig{X=[1]Y}\name{nom}
+
Z > X + Y
\endhreac

If the width of a ⟨name⟩ exceeds that of its ⟨compound⟩, no adjustment is made to the width of the ⟨compound⟩ and the ⟨name⟩ will extend beyond the boundaries of the box containing it. It is up to the user to use the \\ macro to display the ⟨name⟩ on multiple lines.

Compiled output

Name of compounds
\hreac[hreac debug]
\chemfig{*6(-=-=-=)}\name{cycle}
+
\chemfig{X=[1]Y}\name{name much too long}
+
Z > X + Y
\endhreac\medbreak
\hreac[hreac debug]
\chemfig{*6(-=-=-=)}\name{cycle} +
\chemfig{X=[1]Y}\name{name\\too\\long} +
Z > X + Y
\endhreac