tikz.dev / chemfig Manual

chemfig

Operation of chemfig

10 Default values

At the beginning of each molecule, the default values for the optional arguments are initialized. They are:

  • 0° for the bond angle;

  • 1 for the length multiplication coefficient;

  • ⟨empty⟩ for the numbers of the departure and arrival atoms, which lets chemfig calculate these based on the bond angle;

  • ⟨empty⟩ for the parameters passed to TikZ.

These default values can be changed for the whole molecule by beginning the molecule code with

[⟨angle⟩,⟨coeff⟩,⟨n1⟩,⟨n2⟩,⟨code tikz⟩]

Thus, if the code of a molecule begins with [:20,1.5], then all the bonds will be at angle of 20° by default, and the interatomic distances will have a length 1.5 times the default length. These default values can be overridden at any time by giving an optional argument, such as for the bond which follows atom “C” in this example:

Compiled output

Overriding default values
\chemfig{[:20,1.5]A-B-C-[:-80,0.7]D-E-F}

If something odd like [1,1.5,2,2,red,thick] is written, then unless otherwise indicated all the bonds will have an angle of 45°, the interatomic distances will be 1.5 times the default distance, the bonds will begin and end on the second atom of each group, and the bonds will be red and thick:

Compiled output

Default values
\chemfig{[1,1.5,2,2,red,thick]ABC-DEF=GHI}