![](https://secure.gravatar.com/avatar/ac3fbaf0a287c4cffbc9f18fa931586c.jpg?s=120&d=mm&r=g)
On Sun, 27 Sep 2015 18:00:23 +0100
DesdeChaves
Some time ago I wrote the code attached to create random branched organic molecules. However, with recent versions of Context the carbon-carbon bonds overwrites the radicals. How can I fix this?
The mkiv chemistry module (replacing the mkii PPCHTEX code) uses tighter spacing around the nodes, which looks nicer with single atomic symbols. You are placing CH and CH_2 groups so it is necessary to increasing the spacing at these spots. One trick could be: \chemical [ONE,.2MOV1] which moves .2 bond lengths in the x-direction. You also need to pay attention to the automatic alignment of symbols, in particular when using ONE. For Z0 is centered, Z1 is right adjusted, Z5 is left adjusted... One can explicitly fix the alignment using: \chemical [ONE,simalign=lft,Z1] (MetaPost alignment keys) but it is much easier to leave simalign=auto and to choose appropriate nodes (using [ONE,MOV1,Z0] rather than [ONE,Z1] for example).
Another question: is there a way to change the bonds color? I would like to blank some radicals and bonds and ask the students to draw it.
\chemical [rulecolor=red,ONE,B] Of course, it is a "global" so you will need to use multiple calls in order to color particular bonds. Alan