Trouble with hooks in chemfig

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite












I am trying to construct this EDTA molecule coordinated to a metal:



molecule aim



and this is what I have so far:



current molecule



With this code:



chemfig
O=[2,,]C
(-[3,2,,1]CH_2-[1,,1]N
(-[7,,,2]H_2C-[0,,]C
(=[7,,]O)
(-[1,,]O^-))
(-[4,,,2]H_2C-[2,,2,2]H_2C-[0,,]N
(-[1,,,2]H_2C-[0,,2]C
(=[1,,]O)
(-[7,,]O^-))
(-[3,,,2]H_2C-[1,2,2]C
(=[2,,]O)
(-[7,,]O^-))))
(-[1,,]O^-)



What I can't figure out how to do is include the metal in the center. I know I have to use hooks somehow but I don't know where to start. Would I have to start over and begin the figure at the metal?



Bonus question: how do I change the color of the bonds to the metal?










share|improve this question

























    up vote
    4
    down vote

    favorite












    I am trying to construct this EDTA molecule coordinated to a metal:



    molecule aim



    and this is what I have so far:



    current molecule



    With this code:



    chemfig
    O=[2,,]C
    (-[3,2,,1]CH_2-[1,,1]N
    (-[7,,,2]H_2C-[0,,]C
    (=[7,,]O)
    (-[1,,]O^-))
    (-[4,,,2]H_2C-[2,,2,2]H_2C-[0,,]N
    (-[1,,,2]H_2C-[0,,2]C
    (=[1,,]O)
    (-[7,,]O^-))
    (-[3,,,2]H_2C-[1,2,2]C
    (=[2,,]O)
    (-[7,,]O^-))))
    (-[1,,]O^-)



    What I can't figure out how to do is include the metal in the center. I know I have to use hooks somehow but I don't know where to start. Would I have to start over and begin the figure at the metal?



    Bonus question: how do I change the color of the bonds to the metal?










    share|improve this question























      up vote
      4
      down vote

      favorite









      up vote
      4
      down vote

      favorite











      I am trying to construct this EDTA molecule coordinated to a metal:



      molecule aim



      and this is what I have so far:



      current molecule



      With this code:



      chemfig
      O=[2,,]C
      (-[3,2,,1]CH_2-[1,,1]N
      (-[7,,,2]H_2C-[0,,]C
      (=[7,,]O)
      (-[1,,]O^-))
      (-[4,,,2]H_2C-[2,,2,2]H_2C-[0,,]N
      (-[1,,,2]H_2C-[0,,2]C
      (=[1,,]O)
      (-[7,,]O^-))
      (-[3,,,2]H_2C-[1,2,2]C
      (=[2,,]O)
      (-[7,,]O^-))))
      (-[1,,]O^-)



      What I can't figure out how to do is include the metal in the center. I know I have to use hooks somehow but I don't know where to start. Would I have to start over and begin the figure at the metal?



      Bonus question: how do I change the color of the bonds to the metal?










      share|improve this question













      I am trying to construct this EDTA molecule coordinated to a metal:



      molecule aim



      and this is what I have so far:



      current molecule



      With this code:



      chemfig
      O=[2,,]C
      (-[3,2,,1]CH_2-[1,,1]N
      (-[7,,,2]H_2C-[0,,]C
      (=[7,,]O)
      (-[1,,]O^-))
      (-[4,,,2]H_2C-[2,,2,2]H_2C-[0,,]N
      (-[1,,,2]H_2C-[0,,2]C
      (=[1,,]O)
      (-[7,,]O^-))
      (-[3,,,2]H_2C-[1,2,2]C
      (=[2,,]O)
      (-[7,,]O^-))))
      (-[1,,]O^-)



      What I can't figure out how to do is include the metal in the center. I know I have to use hooks somehow but I don't know where to start. Would I have to start over and begin the figure at the metal?



      Bonus question: how do I change the color of the bonds to the metal?







      chemfig






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 hours ago









      Antidisestablishmentarianism

      806




      806




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          Placing the M is rather straightforward: use chemmove, which produces an overlay tikzpicture and then e.g. the calc syntax. What I find more difficult is to reproduce the bond styles. I ended up looking up the definitions and then to repeat what I think they do. (EDIT: Minor fine-tuning, big thanks to AndréC for pushing me.)



          documentclassarticle

          usepackagechemfig
          usetikzlibrarycalc
          begindocument
          chemfig
          O=[2,,]C
          (-[3,1.8,,1]CH_2-[1,,1]@N1N
          (-[7,,,2]H_2C-[0,,]@C1C
          (=[7,,]O)
          (-[1,,]@OM1O^-))
          (-[4,,,2]H_2C-[2,,2,2]H_2C-[0,,]@N2N
          (-[1,,,2]H_2C-[0,,2]@C2C
          (=[1,,]O)
          (-[7,,]@OM2O^-))
          (-[3,1.2,,2]H_2C-[1,2,2]C
          (=[2,,]O)
          (-[7,,]@OM3O^-))))
          (-[1,,]@OM4O^-)

          chemmove[brown!70!black]%
          node (M) at ($(OM1)!0.5!(N2)$) M;
          fill let p1=($(M)-(OM1)$),n1=atan2(y1,x1) in
          ($(OM1.n1)!1mm!(M)$) coordinate (aux1) (M) --
          ($ (aux1)!1mm!90:(M) $) -- ($ (aux1)!1mm!-90:(M) $)
          -- cycle;
          fill let p1=($(M)-(N1)$),n1=atan2(y1,x1) in
          ($(N1.n1)!1mm!(M)$) coordinate (aux2)
          (M) --
          ($ (aux2)!1mm!90:(M) $) -- ($ (aux2)!1mm!-90:(M) $)
          -- cycle;
          draw[thick,-,shorten >=1mm] (M) to (OM3.south -
          enddocument


          enter image description here






          share|improve this answer






















          • The vertical line from one O- to the other is not well centered, it is slightly too far to the left.
            – AndréC
            33 mins ago










          • @AndréC One can either have a vertical line or a centered line in the OP's setup. If one makes the C--H_2C lines a bit longer, it is better centered.
            – marmot
            31 mins ago










          • Unfortunately I can't get this to work properly. Can this be used in a figure environment?
            – Antidisestablishmentarianism
            20 mins ago










          • +1, perfect now!
            – AndréC
            19 mins ago






          • 1




            @Antidisestablishmentarianism You have to compile twice to get the right placement!
            – AndréC
            18 mins ago










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "85"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f456672%2ftrouble-with-hooks-in-chemfig%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          3
          down vote



          accepted










          Placing the M is rather straightforward: use chemmove, which produces an overlay tikzpicture and then e.g. the calc syntax. What I find more difficult is to reproduce the bond styles. I ended up looking up the definitions and then to repeat what I think they do. (EDIT: Minor fine-tuning, big thanks to AndréC for pushing me.)



          documentclassarticle

          usepackagechemfig
          usetikzlibrarycalc
          begindocument
          chemfig
          O=[2,,]C
          (-[3,1.8,,1]CH_2-[1,,1]@N1N
          (-[7,,,2]H_2C-[0,,]@C1C
          (=[7,,]O)
          (-[1,,]@OM1O^-))
          (-[4,,,2]H_2C-[2,,2,2]H_2C-[0,,]@N2N
          (-[1,,,2]H_2C-[0,,2]@C2C
          (=[1,,]O)
          (-[7,,]@OM2O^-))
          (-[3,1.2,,2]H_2C-[1,2,2]C
          (=[2,,]O)
          (-[7,,]@OM3O^-))))
          (-[1,,]@OM4O^-)

          chemmove[brown!70!black]%
          node (M) at ($(OM1)!0.5!(N2)$) M;
          fill let p1=($(M)-(OM1)$),n1=atan2(y1,x1) in
          ($(OM1.n1)!1mm!(M)$) coordinate (aux1) (M) --
          ($ (aux1)!1mm!90:(M) $) -- ($ (aux1)!1mm!-90:(M) $)
          -- cycle;
          fill let p1=($(M)-(N1)$),n1=atan2(y1,x1) in
          ($(N1.n1)!1mm!(M)$) coordinate (aux2)
          (M) --
          ($ (aux2)!1mm!90:(M) $) -- ($ (aux2)!1mm!-90:(M) $)
          -- cycle;
          draw[thick,-,shorten >=1mm] (M) to (OM3.south -
          enddocument


          enter image description here






          share|improve this answer






















          • The vertical line from one O- to the other is not well centered, it is slightly too far to the left.
            – AndréC
            33 mins ago










          • @AndréC One can either have a vertical line or a centered line in the OP's setup. If one makes the C--H_2C lines a bit longer, it is better centered.
            – marmot
            31 mins ago










          • Unfortunately I can't get this to work properly. Can this be used in a figure environment?
            – Antidisestablishmentarianism
            20 mins ago










          • +1, perfect now!
            – AndréC
            19 mins ago






          • 1




            @Antidisestablishmentarianism You have to compile twice to get the right placement!
            – AndréC
            18 mins ago














          up vote
          3
          down vote



          accepted










          Placing the M is rather straightforward: use chemmove, which produces an overlay tikzpicture and then e.g. the calc syntax. What I find more difficult is to reproduce the bond styles. I ended up looking up the definitions and then to repeat what I think they do. (EDIT: Minor fine-tuning, big thanks to AndréC for pushing me.)



          documentclassarticle

          usepackagechemfig
          usetikzlibrarycalc
          begindocument
          chemfig
          O=[2,,]C
          (-[3,1.8,,1]CH_2-[1,,1]@N1N
          (-[7,,,2]H_2C-[0,,]@C1C
          (=[7,,]O)
          (-[1,,]@OM1O^-))
          (-[4,,,2]H_2C-[2,,2,2]H_2C-[0,,]@N2N
          (-[1,,,2]H_2C-[0,,2]@C2C
          (=[1,,]O)
          (-[7,,]@OM2O^-))
          (-[3,1.2,,2]H_2C-[1,2,2]C
          (=[2,,]O)
          (-[7,,]@OM3O^-))))
          (-[1,,]@OM4O^-)

          chemmove[brown!70!black]%
          node (M) at ($(OM1)!0.5!(N2)$) M;
          fill let p1=($(M)-(OM1)$),n1=atan2(y1,x1) in
          ($(OM1.n1)!1mm!(M)$) coordinate (aux1) (M) --
          ($ (aux1)!1mm!90:(M) $) -- ($ (aux1)!1mm!-90:(M) $)
          -- cycle;
          fill let p1=($(M)-(N1)$),n1=atan2(y1,x1) in
          ($(N1.n1)!1mm!(M)$) coordinate (aux2)
          (M) --
          ($ (aux2)!1mm!90:(M) $) -- ($ (aux2)!1mm!-90:(M) $)
          -- cycle;
          draw[thick,-,shorten >=1mm] (M) to (OM3.south -
          enddocument


          enter image description here






          share|improve this answer






















          • The vertical line from one O- to the other is not well centered, it is slightly too far to the left.
            – AndréC
            33 mins ago










          • @AndréC One can either have a vertical line or a centered line in the OP's setup. If one makes the C--H_2C lines a bit longer, it is better centered.
            – marmot
            31 mins ago










          • Unfortunately I can't get this to work properly. Can this be used in a figure environment?
            – Antidisestablishmentarianism
            20 mins ago










          • +1, perfect now!
            – AndréC
            19 mins ago






          • 1




            @Antidisestablishmentarianism You have to compile twice to get the right placement!
            – AndréC
            18 mins ago












          up vote
          3
          down vote



          accepted







          up vote
          3
          down vote



          accepted






          Placing the M is rather straightforward: use chemmove, which produces an overlay tikzpicture and then e.g. the calc syntax. What I find more difficult is to reproduce the bond styles. I ended up looking up the definitions and then to repeat what I think they do. (EDIT: Minor fine-tuning, big thanks to AndréC for pushing me.)



          documentclassarticle

          usepackagechemfig
          usetikzlibrarycalc
          begindocument
          chemfig
          O=[2,,]C
          (-[3,1.8,,1]CH_2-[1,,1]@N1N
          (-[7,,,2]H_2C-[0,,]@C1C
          (=[7,,]O)
          (-[1,,]@OM1O^-))
          (-[4,,,2]H_2C-[2,,2,2]H_2C-[0,,]@N2N
          (-[1,,,2]H_2C-[0,,2]@C2C
          (=[1,,]O)
          (-[7,,]@OM2O^-))
          (-[3,1.2,,2]H_2C-[1,2,2]C
          (=[2,,]O)
          (-[7,,]@OM3O^-))))
          (-[1,,]@OM4O^-)

          chemmove[brown!70!black]%
          node (M) at ($(OM1)!0.5!(N2)$) M;
          fill let p1=($(M)-(OM1)$),n1=atan2(y1,x1) in
          ($(OM1.n1)!1mm!(M)$) coordinate (aux1) (M) --
          ($ (aux1)!1mm!90:(M) $) -- ($ (aux1)!1mm!-90:(M) $)
          -- cycle;
          fill let p1=($(M)-(N1)$),n1=atan2(y1,x1) in
          ($(N1.n1)!1mm!(M)$) coordinate (aux2)
          (M) --
          ($ (aux2)!1mm!90:(M) $) -- ($ (aux2)!1mm!-90:(M) $)
          -- cycle;
          draw[thick,-,shorten >=1mm] (M) to (OM3.south -
          enddocument


          enter image description here






          share|improve this answer














          Placing the M is rather straightforward: use chemmove, which produces an overlay tikzpicture and then e.g. the calc syntax. What I find more difficult is to reproduce the bond styles. I ended up looking up the definitions and then to repeat what I think they do. (EDIT: Minor fine-tuning, big thanks to AndréC for pushing me.)



          documentclassarticle

          usepackagechemfig
          usetikzlibrarycalc
          begindocument
          chemfig
          O=[2,,]C
          (-[3,1.8,,1]CH_2-[1,,1]@N1N
          (-[7,,,2]H_2C-[0,,]@C1C
          (=[7,,]O)
          (-[1,,]@OM1O^-))
          (-[4,,,2]H_2C-[2,,2,2]H_2C-[0,,]@N2N
          (-[1,,,2]H_2C-[0,,2]@C2C
          (=[1,,]O)
          (-[7,,]@OM2O^-))
          (-[3,1.2,,2]H_2C-[1,2,2]C
          (=[2,,]O)
          (-[7,,]@OM3O^-))))
          (-[1,,]@OM4O^-)

          chemmove[brown!70!black]%
          node (M) at ($(OM1)!0.5!(N2)$) M;
          fill let p1=($(M)-(OM1)$),n1=atan2(y1,x1) in
          ($(OM1.n1)!1mm!(M)$) coordinate (aux1) (M) --
          ($ (aux1)!1mm!90:(M) $) -- ($ (aux1)!1mm!-90:(M) $)
          -- cycle;
          fill let p1=($(M)-(N1)$),n1=atan2(y1,x1) in
          ($(N1.n1)!1mm!(M)$) coordinate (aux2)
          (M) --
          ($ (aux2)!1mm!90:(M) $) -- ($ (aux2)!1mm!-90:(M) $)
          -- cycle;
          draw[thick,-,shorten >=1mm] (M) to (OM3.south -
          enddocument


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 23 mins ago

























          answered 38 mins ago









          marmot

          68.2k475147




          68.2k475147











          • The vertical line from one O- to the other is not well centered, it is slightly too far to the left.
            – AndréC
            33 mins ago










          • @AndréC One can either have a vertical line or a centered line in the OP's setup. If one makes the C--H_2C lines a bit longer, it is better centered.
            – marmot
            31 mins ago










          • Unfortunately I can't get this to work properly. Can this be used in a figure environment?
            – Antidisestablishmentarianism
            20 mins ago










          • +1, perfect now!
            – AndréC
            19 mins ago






          • 1




            @Antidisestablishmentarianism You have to compile twice to get the right placement!
            – AndréC
            18 mins ago
















          • The vertical line from one O- to the other is not well centered, it is slightly too far to the left.
            – AndréC
            33 mins ago










          • @AndréC One can either have a vertical line or a centered line in the OP's setup. If one makes the C--H_2C lines a bit longer, it is better centered.
            – marmot
            31 mins ago










          • Unfortunately I can't get this to work properly. Can this be used in a figure environment?
            – Antidisestablishmentarianism
            20 mins ago










          • +1, perfect now!
            – AndréC
            19 mins ago






          • 1




            @Antidisestablishmentarianism You have to compile twice to get the right placement!
            – AndréC
            18 mins ago















          The vertical line from one O- to the other is not well centered, it is slightly too far to the left.
          – AndréC
          33 mins ago




          The vertical line from one O- to the other is not well centered, it is slightly too far to the left.
          – AndréC
          33 mins ago












          @AndréC One can either have a vertical line or a centered line in the OP's setup. If one makes the C--H_2C lines a bit longer, it is better centered.
          – marmot
          31 mins ago




          @AndréC One can either have a vertical line or a centered line in the OP's setup. If one makes the C--H_2C lines a bit longer, it is better centered.
          – marmot
          31 mins ago












          Unfortunately I can't get this to work properly. Can this be used in a figure environment?
          – Antidisestablishmentarianism
          20 mins ago




          Unfortunately I can't get this to work properly. Can this be used in a figure environment?
          – Antidisestablishmentarianism
          20 mins ago












          +1, perfect now!
          – AndréC
          19 mins ago




          +1, perfect now!
          – AndréC
          19 mins ago




          1




          1




          @Antidisestablishmentarianism You have to compile twice to get the right placement!
          – AndréC
          18 mins ago




          @Antidisestablishmentarianism You have to compile twice to get the right placement!
          – AndréC
          18 mins ago

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f456672%2ftrouble-with-hooks-in-chemfig%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What does second last employer means? [closed]

          Installing NextGIS Connect into QGIS 3?

          One-line joke