2
\documentclass{article}
\usepackage[left=3.17cm,right=3.17cm,top=2.54cm,bottom=2.54cm,includeheadfoot]{geometry}% normal page sutep
\usepackage[rgb,svgnames,dvipsnames]{xcolor} 
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[version=4]{mhchem}
\usepackage{array}
\usepackage{chemfig}
\usepackage{chemformula}
\usetikzlibrary{arrows.meta}%نوع الاسهم للتحكم بها
\usepackage{tikz}
\usepackage{amsmath}
\begin{document}
\disablefixedbondlength%لعدم ضبط المسافات بين الذرات بصورة الية
\enablefixedbondlength%لاعادة ضبط طول الاواصر بصورة الية
\chemfig[][scale=2]{[:330]{\color{red}N}*6(-*6(=(-{\color{red}HO})-=-([:350]-{\color{red}N}([:300]={\color{red}N}?[a](-[:235]*6(=-=-=([:360]-C([:55]-{\color{blue}O}([:90]-{\color{YellowOrange}Zn}?[a,{>:},blue]?[b]([:90]-{\color{blue}O}([:65]-C([:140]={\color{blue}O})([8]-*6(=([:240]-{\color{red}N}?[b,{<:},green]([:300]={\color{red}N}(-[:5]*6(=(*6(-=-={\color{red}N}--))-=(-{\color{red}OH})-=-))))-=-=-))))))([:310]={\color{blue}O}))-))))=-)--=-=)}
\end{document}

output

How do I change the type of bond {<:} in my chemfig to the {\rightarrow} (a dative bond)?

  • Welcome to TeX.SE. Please shorten the title and add the real question to your post – user31729 Jun 17 '17 at 23:34
  • I want t change bond {>:} to another type \rightarrow – ali Jun 17 '17 at 23:41
  • 3
    Possible duplicate of How do you draw a dative bond with chemfig? – cgnieder Jun 18 '17 at 7:08
  • @Troy Because Zn and N are distant atoms, the OP used the ? hook to create a bond between those atoms. However, the syntax for customization of this bond is different to customization of bonds between adjacent atoms. While clemens answer is certainly relevant, it is a solution for adjacent atoms and won't work for distant atoms. Does N coordinate to Zn (->) or vice versa (<-)? – Ross Jun 18 '17 at 7:44
  • @ali I have added an example output, and (hopefully) stated your question clearly. Feel free to revert if I have butchered the original meaning. – Troy Jun 18 '17 at 8:14
2

This molecule uses the hook "?", explained in section 9 of the Chemfig manual, to connect distant atoms. The syntax for customization of the bond set between atoms that have the hook applied is ?[<name>,<bond>,<tikz>].

Here, I applied a bond customization with [a,,{line width=2pt},{<-},{blue}], where a is the name of the hook, the empty key is a provision for the type of bond (which can be any of the 9 types of bonds described in section 2 of the Chemfig manual), while the follow are TikZ keys giving the line width, arrow type, and color. Applying this to the OP's question gives the following molecule. Note: the direction of the arrow could be incorrect, each TikZ key must be surrounded by braces {}, and the line width is just applied for emphasis of the result.

enter image description here

This is the MWE:

\documentclass{article}
\usepackage[left=3.17cm,right=3.17cm,top=2.54cm,bottom=2.54cm,includeheadfoot]{geometry}% normal page sutep
\usepackage[rgb,svgnames,dvipsnames]{xcolor} 
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[version=4]{mhchem}
\usepackage{array}
\usepackage{chemfig}
\usepackage{chemformula}
\usetikzlibrary{arrows.meta}%نوع الاسهم للتحكم بها
\usepackage{tikz}

\begin{document}
    \disablefixedbondlength%لعدم ضبط المسافات بين الذرات بصورة الية
    \enablefixedbondlength%لاعادة ضبط طول الاواصر بصورة الية
    \chemfig[][scale=1]{[:330]{\color{red}N}*6(-*6(=(-{\color{red}HO})-=-([:350]-{\color{red}N}([:300]={\color{red}N}?[a](-[:235]*6(=-=-=([:360]-C([:55]-{\color{blue}O}([:90]-{\color{YellowOrange}Zn}?[a,,{line width=2pt},{<-},{blue}]?[b]([:90]-{\color{blue}O}([:65]-C([:140]={\color{blue}O})([8]-*6(=([:240]-{\color{red}N}?[b,,{line width=2pt},{->},{green}]([:300]={\color{red}N}(-[:5]*6(=(*6(-=-={\color{red}N}--))-=(-{\color{red}OH})-=-))))-=-=-))))))([:310]={\color{blue}O}))-))))=-)--=-=)}
\end{document} 
  • thanks for you, this solution was very useful to this question – ali Jun 21 '17 at 3:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.