Trouble with hooks in chemfig
Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
I am trying to construct this EDTA molecule coordinated to a metal:
and this is what I have so far:
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
add a comment |Â
up vote
4
down vote
favorite
I am trying to construct this EDTA molecule coordinated to a metal:
and this is what I have so far:
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
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I am trying to construct this EDTA molecule coordinated to a metal:
and this is what I have so far:
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
I am trying to construct this EDTA molecule coordinated to a metal:
and this is what I have so far:
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
chemfig
asked 2 hours ago
Antidisestablishmentarianism
806
806
add a comment |Â
add a comment |Â
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
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
 |Â
show 1 more comment
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
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
 |Â
show 1 more comment
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
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
 |Â
show 1 more comment
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
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
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
 |Â
show 1 more comment
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
 |Â
show 1 more comment
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password