# Issue with cram bonds in chemfig

Using chemfig v1.1a, cram bonds are not drawn well in a way similar to the issue found in previous versions.

Edit: My precise question here would be: does anyone know how to fix this? Or, worst case, is there a good-looking workaround?

\documentclass[border=5pt]{standalone}
\usepackage{chemfig}
\begin{document}
\chemfig{A<B}
\end{document}

• Welcome to TeX.SX! And what is the precise question here? – user31729 Apr 9 '15 at 0:09
• Thanks! I've edited the question to state what I would like. – gbacic Apr 9 '15 at 3:39

Disclaimer: I did not know how to solve this myself when I asked the question, but managed to figure it out almost immediately after asking it.

The author of chemfig said he did not speak English well enough to participate in the previous issue that was similar to this, and the correspondence was written in French. Although I'm Canadian, my French is shamefully inadequate and I figured I'd post this answer here, attempt to contact the author, and direct him here so that the new version of chemfig may include my solution.

I suspected that this was due to the same inherent drawing solution that Christian Tellechea, author of chemfig, mentioned in the correspondence quoted in the question "Ugly bond joints in chemfig," namely that each bond was drawn one-after-another such that tikz could not fix the joints itself.

After looking at the source, it became clear that the cram bonds' shapes were not drawn in the same way, and that something else must have been the issue.

Tellechea has a clever solution to allow the cram bonds to follow the user's style specifications that involved drawing two nodes half the base-width above and below the centre on the appropriate side.

I did some searching here on Stack Exchange and found that node and coordinate and both are just macros for path operations, and that a node can be set to have the shape coordinate.

I set the option shape=coordinate for the appropriate node commands in the source on lines 840, 841, 844 and 845. Here is what I got (it's the same code the MWE in the question above).

It seemed as if the cram bond was not a closed path, so I located the code that draws the bond and closed each one. What results is the, in my opinion, properly drawn cram bond.

The paths were closed by adding --cycle to the end of each path definition on lines 935, 939, 944, 951, 957, and 959.

The hollow cram bonds (i.e. \chemfig{A<|B}) are also drawn properly now.

Note that if you set the cram bond width to be too small, the miter join at the point will be too sharp and is cut off by tikz defaults. I tried changing the miter limit in the source, but the point protrudes too far to be tenable.

Here is the version with a very sharp point

and the version I have left it as in my version

• Good job. I hope This fix will get to the official chemfig package. – pisoir Apr 14 '15 at 18:28
• Hi @gbacic, I'm using your .tex file from ge.tt but it draws the bonds with the sharp point that gets too close to the symbol. – Arch Stanton Jun 7 '15 at 11:54
• Solved. Lowering the miter limit corrected it. – Arch Stanton Jun 7 '15 at 21:30