I'm using this code to generate chemical structure with chemfig package:


enter image description here

I am not happy how chemfig makes connection, which is crossed with red. I need to have bond going from Nto first C atom, not to the second one.

How the code should be changed to avoid this problem.

2 Answers 2


Here is another idea: if you place each of the parentheses between braces ({(} and {)}) they are treated like an atom (i.e. like C or H) and you can use the optional argument of the bonds to determine where the bond arrives:

<bond>[<angle>,<length factor>,<departure atom>,<arrival atom>,<TikZ options>]

Where <departure atom> and<arrival atom> are the position numbers of the atoms where the bond should start or end, respectively.

In your case the following fragment (the rest of the MWE unchanged)



enter image description here


It can be done like this:

{$\left\delimleft\vrule height\delimhalfdim depth\delimhalfdim
{$\left.\vrule height\delimhalfdim depth\delimhalfdim

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .