chemfig
Operation of chemfig
7 Departure and arrival atoms¶
A group of atoms can contain several atoms. Suppose we want to connect the group “ABCD” to the group “EFG” with a bond. chemfig calculates which atom of the first group and which of the second group are to be connected by looking at the angle of bond relative to the horizontal. If the angle is between (but not including) \(-90\degres\) and 90° (modulo 360°) then the bond is made between the last atom of the first group and the first atom of the second group. In all other cases, the bond is made between the first atom of the first group and the last atom of the second group.
Here are some examples where the bond is in the interval \((-90,90)\), and where the bond is made between D and E:
\chemfig{ABCD-[:75]EFG}\quad
\chemfig{ABCD-[:-85]EFG}\quad
\chemfig{ABCD-[1]EFG}
In the following examples, the angles are in the interval \([90,270]\) and so the bond is made between A and G:
\chemfig{ABCD-[:100]EFG}\quad
\chemfig{ABCD-[:-110]EFG}\quad
\chemfig{ABCD-[5]EFG}
In some cases, you may want a bond to start from atoms other than those calculated by chemfig. You can force a starting atom or an ending atom with the optional argument of the bond. You must write:
[,,⟨integer 1⟩,⟨integer 2⟩]
where ⟨integer 1⟩ and ⟨integer 2⟩ are the numbers of the desired departure and arrival atoms. These atoms must exist, otherwise an error message will be given.
\chemfig{ABCD-[:75,,2,3]EFG}\qquad
\chemfig{ABCD-[:75,,,2]EFG}\qquad
\chemfig{ABCD-[:75,,3,2]EFG}