tikz.dev / chemfig Manual

chemfig

Operation of chemfig

5 Bond angle

Each bond takes an optional argument in brackets. This optional argument can adjust every aspect of a bond, and consists of five optional fields separated by commas. The first of these fields defines the bond angle. Angles increase counterclockwise, and are relative to the horizontal. If the angle field is empty, the angle takes its default value of 0°. We will see later how to change this default.

There are several ways of specifying the bond angle.

5.1 Predefined angles

When the angle field contains an integer, this represents the angle the bond makes relative to the horizontal, in multiples of 45°. For example, [0] specifies an angle of 0°, [1] is 45°, and so on.

Compiled output

Predefined angles
\chemfig{A-B-[1]C-[3]-D-[7]E-[6]F}

These angles remain valid if the atoms are empty, and this is the case for all the features we will see below:

Compiled output

Predefined angles with empty groups
\chemfig{--[1]-[3]--[7]-[6]}

The ⟨key⟩ angle increment = ⟨angle⟩ sets the default angle used to calculate the angle of a bond:

Compiled output

Set the predefined angle
Default (45) : \chemfig{-[1]-[-1]-[1]-[-1]}

Angle of 30 : \chemfig[angle increment=30]{-[1]-[-1]-[1]-[-1]}
5.2 Absolute angles

If one wishes to specify an angle in degrees relative to the horizontal, then the optional angle field must take this form: [:⟨absolute angle⟩]. If necessary, the ⟨absolute angle⟩ is reduced to the interval \([0,360)\):

Compiled output

Absolute angles
\chemfig{A-[:30]B=[:-75]C-[:10]D-[:90]>|[:60]-[:-20]E-[:0]~[:-75]F}
5.3 Relative angles

It is often useful to specify a bond angle relative to the preceding bond. This syntax must be then be used: [::⟨relative angle⟩]. The sign of the ⟨relative angle⟩ can be omitted if it is a +.

Here is a molecule where the first bond has an absolute angle of \(-5\degres\), and the rest of the bond angles are incremented by 20°:

Compiled output

Result of relative angles
\chemfig{A-[:-5]-[::+20]-[::20]B-[::+20]-[::20]C-[::20]}

One can “break” a chain of relative angles by putting an absolute or predefined angle where desired. Here, atom “B” is followed by a bond at an absolute angle of 315°.

Compiled output

Result of relative angles followed by absolute
\chemfig{A-[:-5]-[::20]-[::20]B-[7]-[::20]C-[::20]}