Math & Sciencechemfig | Bond Departure

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
niteshs
Posts: 45
Joined: Wed Jun 06, 2012 9:57 pm

chemfig | Bond Departure

Post by niteshs »

Hi,

I am trying to make a reaction scheme using chemfig, using lower case letters for the compound. This is causing the package to react differently, resulting in inability to assign departure and arrival 'atoms'.

For example:

Code: Select all

\documentclass{article}
\usepackage{chemfig}
\begin{document}
\schemestart
\chemfig{abcdefgh-[:30]ijk-[:-30]lm}\+\chemfig{nop}
\schemestop
\end{document}
results in the bond leaving the compound 'abcdefgh' from the center.

Specifying the departure atom works only if the 'compound' is given by capital letters. Using:

Code: Select all

\chemfig{ABCDEFGH-[:30,,8]ijk-[:-30]lm}\+\chemfig{nop}
results in the bond leaving 'atom' H.

But using this with the lower case 'compound' name results in error, with the 'atom' numbers (8 in this case) not being recognized.

I tried using the <tikz code> parameter in bond option to specify the anchor (I don't know if this is supposed to work, but I tried anyway):

Code: Select all

\chemfig{abcdefgh-[:30,,,,.east--.west]ijk-[:-30]lm}\+\chemfig{nop}
It is probably clear from this example that I have no idea about tikz code. The above code is used for anchoring arrows in the package manual, and does not work here.

How can I get the bond to 'depart' correctly?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

chemfig | Bond Departure

Post by cgnieder »

You can use | to logically divide the abcdefgh into two parts:

Code: Select all

\chemfig{abcdefg|h-[:30]ijk-[:-30]lm}
Regards
site moderator & package author
niteshs
Posts: 45
Joined: Wed Jun 06, 2012 9:57 pm

chemfig | Bond Departure

Post by niteshs »

I had never heard of the | tags before.

Anyway, your code works just right. I have just now realized that this was described at the very beginning of the "advanced usage" chapter of the manual. Somehow I managed to skip that part while trying to find the solution!

Thanks again!
Post Reply