How to write text H to left of O in chemfig?
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I am trying to put H to the left of O, what will be the correct syntax
Here is my MWE
documentclass[a4paper]article
usepackagechemfig
%%% Polymer symbol
newcommandsetpolymerdelim[2]defdelimleft#1defdelimright#2
defmakebraces[#1,#2]#3#4#5%
edefdelimhalfdimthedimexpr(#1+#2)/2%
edefdelimvshiftthedimexpr(#1-#2)/2%
chemmove%
node[at=(#4),yshift=(delimvshift)]
$leftdelimleftvrule heightdelimhalfdim depthdelimhalfdim
width0ptright.$;%
node[at=(#5),yshift=(delimvshift)]
$left.vrule heightdelimhalfdim depthdelimhalfdim
width0ptrightdelimright_rlap$scriptstyle#3$$;
setpolymerdelim()
begindocument
setpolymerdelim
setchemfigatom sep=2em
chemfig[:30]-[@left,0.65]-[:-30](-[6]OH)-[@right,0.75:30]
makebraces[15pt,35pt]nleftright
enddocument
Here is the output of the above MWE
chemfig
add a comment |Â
up vote
2
down vote
favorite
I am trying to put H to the left of O, what will be the correct syntax
Here is my MWE
documentclass[a4paper]article
usepackagechemfig
%%% Polymer symbol
newcommandsetpolymerdelim[2]defdelimleft#1defdelimright#2
defmakebraces[#1,#2]#3#4#5%
edefdelimhalfdimthedimexpr(#1+#2)/2%
edefdelimvshiftthedimexpr(#1-#2)/2%
chemmove%
node[at=(#4),yshift=(delimvshift)]
$leftdelimleftvrule heightdelimhalfdim depthdelimhalfdim
width0ptright.$;%
node[at=(#5),yshift=(delimvshift)]
$left.vrule heightdelimhalfdim depthdelimhalfdim
width0ptrightdelimright_rlap$scriptstyle#3$$;
setpolymerdelim()
begindocument
setpolymerdelim
setchemfigatom sep=2em
chemfig[:30]-[@left,0.65]-[:-30](-[6]OH)-[@right,0.75:30]
makebraces[15pt,35pt]nleftright
enddocument
Here is the output of the above MWE
chemfig
3
Wouldn't it be a lot easier to use-[6,,,2]HO
instead of-[6]OH
with<bond>[<angle>,<length factor>,<departure>,<arrival>,<tikz>]
as described in the answer to this very closely related (duplicate?) question: chemfig: order of atoms
– leandriis
1 hour ago
Thank you so much for your alternative solution @leandriis
– Biki Teron
1 hour ago
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I am trying to put H to the left of O, what will be the correct syntax
Here is my MWE
documentclass[a4paper]article
usepackagechemfig
%%% Polymer symbol
newcommandsetpolymerdelim[2]defdelimleft#1defdelimright#2
defmakebraces[#1,#2]#3#4#5%
edefdelimhalfdimthedimexpr(#1+#2)/2%
edefdelimvshiftthedimexpr(#1-#2)/2%
chemmove%
node[at=(#4),yshift=(delimvshift)]
$leftdelimleftvrule heightdelimhalfdim depthdelimhalfdim
width0ptright.$;%
node[at=(#5),yshift=(delimvshift)]
$left.vrule heightdelimhalfdim depthdelimhalfdim
width0ptrightdelimright_rlap$scriptstyle#3$$;
setpolymerdelim()
begindocument
setpolymerdelim
setchemfigatom sep=2em
chemfig[:30]-[@left,0.65]-[:-30](-[6]OH)-[@right,0.75:30]
makebraces[15pt,35pt]nleftright
enddocument
Here is the output of the above MWE
chemfig
I am trying to put H to the left of O, what will be the correct syntax
Here is my MWE
documentclass[a4paper]article
usepackagechemfig
%%% Polymer symbol
newcommandsetpolymerdelim[2]defdelimleft#1defdelimright#2
defmakebraces[#1,#2]#3#4#5%
edefdelimhalfdimthedimexpr(#1+#2)/2%
edefdelimvshiftthedimexpr(#1-#2)/2%
chemmove%
node[at=(#4),yshift=(delimvshift)]
$leftdelimleftvrule heightdelimhalfdim depthdelimhalfdim
width0ptright.$;%
node[at=(#5),yshift=(delimvshift)]
$left.vrule heightdelimhalfdim depthdelimhalfdim
width0ptrightdelimright_rlap$scriptstyle#3$$;
setpolymerdelim()
begindocument
setpolymerdelim
setchemfigatom sep=2em
chemfig[:30]-[@left,0.65]-[:-30](-[6]OH)-[@right,0.75:30]
makebraces[15pt,35pt]nleftright
enddocument
Here is the output of the above MWE
chemfig
chemfig
asked 2 hours ago


Biki Teron
1,821717
1,821717
3
Wouldn't it be a lot easier to use-[6,,,2]HO
instead of-[6]OH
with<bond>[<angle>,<length factor>,<departure>,<arrival>,<tikz>]
as described in the answer to this very closely related (duplicate?) question: chemfig: order of atoms
– leandriis
1 hour ago
Thank you so much for your alternative solution @leandriis
– Biki Teron
1 hour ago
add a comment |Â
3
Wouldn't it be a lot easier to use-[6,,,2]HO
instead of-[6]OH
with<bond>[<angle>,<length factor>,<departure>,<arrival>,<tikz>]
as described in the answer to this very closely related (duplicate?) question: chemfig: order of atoms
– leandriis
1 hour ago
Thank you so much for your alternative solution @leandriis
– Biki Teron
1 hour ago
3
3
Wouldn't it be a lot easier to use
-[6,,,2]HO
instead of -[6]OH
with <bond>[<angle>,<length factor>,<departure>,<arrival>,<tikz>]
as described in the answer to this very closely related (duplicate?) question: chemfig: order of atoms– leandriis
1 hour ago
Wouldn't it be a lot easier to use
-[6,,,2]HO
instead of -[6]OH
with <bond>[<angle>,<length factor>,<departure>,<arrival>,<tikz>]
as described in the answer to this very closely related (duplicate?) question: chemfig: order of atoms– leandriis
1 hour ago
Thank you so much for your alternative solution @leandriis
– Biki Teron
1 hour ago
Thank you so much for your alternative solution @leandriis
– Biki Teron
1 hour ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
A simple version using boxes.
documentclass[a4paper]article
usepackagechemfig
%%% Polymer symbol
newcommandsetpolymerdelim[2]defdelimleft#1defdelimright#2
defmakebraces[#1,#2]#3#4#5%
edefdelimhalfdimthedimexpr(#1+#2)/2%
edefdelimvshiftthedimexpr(#1-#2)/2%
chemmove%
node[at=(#4),yshift=(delimvshift)]
$leftdelimleftvrule heightdelimhalfdim depthdelimhalfdim
width0ptright.$;%
node[at=(#5),yshift=(delimvshift)]
$left.vrule heightdelimhalfdim depthdelimhalfdim
width0ptrightdelimright_rlap$scriptstyle#3$$;
setpolymerdelim()
newsaveboxleftofbox
newlengthwidthofbox
defleftof#1#2%
saveboxleftofbox#2%
setlengthwidthofboxwdleftofbox%
hskipwidthofbox
llap#1#2%
begindocument
setpolymerdelim
setchemfigatom sep=2em
chemfig[:30]-[@left,0.65]-[:-30](-[6]leftofHO)-[@right,0.75:30]
makebraces[15pt,35pt]nleftright
enddocument
Thank you so much @TeXnician
– Biki Teron
1 hour ago
add a 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
A simple version using boxes.
documentclass[a4paper]article
usepackagechemfig
%%% Polymer symbol
newcommandsetpolymerdelim[2]defdelimleft#1defdelimright#2
defmakebraces[#1,#2]#3#4#5%
edefdelimhalfdimthedimexpr(#1+#2)/2%
edefdelimvshiftthedimexpr(#1-#2)/2%
chemmove%
node[at=(#4),yshift=(delimvshift)]
$leftdelimleftvrule heightdelimhalfdim depthdelimhalfdim
width0ptright.$;%
node[at=(#5),yshift=(delimvshift)]
$left.vrule heightdelimhalfdim depthdelimhalfdim
width0ptrightdelimright_rlap$scriptstyle#3$$;
setpolymerdelim()
newsaveboxleftofbox
newlengthwidthofbox
defleftof#1#2%
saveboxleftofbox#2%
setlengthwidthofboxwdleftofbox%
hskipwidthofbox
llap#1#2%
begindocument
setpolymerdelim
setchemfigatom sep=2em
chemfig[:30]-[@left,0.65]-[:-30](-[6]leftofHO)-[@right,0.75:30]
makebraces[15pt,35pt]nleftright
enddocument
Thank you so much @TeXnician
– Biki Teron
1 hour ago
add a comment |Â
up vote
3
down vote
accepted
A simple version using boxes.
documentclass[a4paper]article
usepackagechemfig
%%% Polymer symbol
newcommandsetpolymerdelim[2]defdelimleft#1defdelimright#2
defmakebraces[#1,#2]#3#4#5%
edefdelimhalfdimthedimexpr(#1+#2)/2%
edefdelimvshiftthedimexpr(#1-#2)/2%
chemmove%
node[at=(#4),yshift=(delimvshift)]
$leftdelimleftvrule heightdelimhalfdim depthdelimhalfdim
width0ptright.$;%
node[at=(#5),yshift=(delimvshift)]
$left.vrule heightdelimhalfdim depthdelimhalfdim
width0ptrightdelimright_rlap$scriptstyle#3$$;
setpolymerdelim()
newsaveboxleftofbox
newlengthwidthofbox
defleftof#1#2%
saveboxleftofbox#2%
setlengthwidthofboxwdleftofbox%
hskipwidthofbox
llap#1#2%
begindocument
setpolymerdelim
setchemfigatom sep=2em
chemfig[:30]-[@left,0.65]-[:-30](-[6]leftofHO)-[@right,0.75:30]
makebraces[15pt,35pt]nleftright
enddocument
Thank you so much @TeXnician
– Biki Teron
1 hour ago
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
A simple version using boxes.
documentclass[a4paper]article
usepackagechemfig
%%% Polymer symbol
newcommandsetpolymerdelim[2]defdelimleft#1defdelimright#2
defmakebraces[#1,#2]#3#4#5%
edefdelimhalfdimthedimexpr(#1+#2)/2%
edefdelimvshiftthedimexpr(#1-#2)/2%
chemmove%
node[at=(#4),yshift=(delimvshift)]
$leftdelimleftvrule heightdelimhalfdim depthdelimhalfdim
width0ptright.$;%
node[at=(#5),yshift=(delimvshift)]
$left.vrule heightdelimhalfdim depthdelimhalfdim
width0ptrightdelimright_rlap$scriptstyle#3$$;
setpolymerdelim()
newsaveboxleftofbox
newlengthwidthofbox
defleftof#1#2%
saveboxleftofbox#2%
setlengthwidthofboxwdleftofbox%
hskipwidthofbox
llap#1#2%
begindocument
setpolymerdelim
setchemfigatom sep=2em
chemfig[:30]-[@left,0.65]-[:-30](-[6]leftofHO)-[@right,0.75:30]
makebraces[15pt,35pt]nleftright
enddocument
A simple version using boxes.
documentclass[a4paper]article
usepackagechemfig
%%% Polymer symbol
newcommandsetpolymerdelim[2]defdelimleft#1defdelimright#2
defmakebraces[#1,#2]#3#4#5%
edefdelimhalfdimthedimexpr(#1+#2)/2%
edefdelimvshiftthedimexpr(#1-#2)/2%
chemmove%
node[at=(#4),yshift=(delimvshift)]
$leftdelimleftvrule heightdelimhalfdim depthdelimhalfdim
width0ptright.$;%
node[at=(#5),yshift=(delimvshift)]
$left.vrule heightdelimhalfdim depthdelimhalfdim
width0ptrightdelimright_rlap$scriptstyle#3$$;
setpolymerdelim()
newsaveboxleftofbox
newlengthwidthofbox
defleftof#1#2%
saveboxleftofbox#2%
setlengthwidthofboxwdleftofbox%
hskipwidthofbox
llap#1#2%
begindocument
setpolymerdelim
setchemfigatom sep=2em
chemfig[:30]-[@left,0.65]-[:-30](-[6]leftofHO)-[@right,0.75:30]
makebraces[15pt,35pt]nleftright
enddocument
answered 1 hour ago


TeXnician
22k52882
22k52882
Thank you so much @TeXnician
– Biki Teron
1 hour ago
add a comment |Â
Thank you so much @TeXnician
– Biki Teron
1 hour ago
Thank you so much @TeXnician
– Biki Teron
1 hour ago
Thank you so much @TeXnician
– Biki Teron
1 hour ago
add a comment |Â
Â
draft saved
draft discarded
Â
draft saved
draft discarded
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%2f453054%2fhow-to-write-text-h-to-left-of-o-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
3
Wouldn't it be a lot easier to use
-[6,,,2]HO
instead of-[6]OH
with<bond>[<angle>,<length factor>,<departure>,<arrival>,<tikz>]
as described in the answer to this very closely related (duplicate?) question: chemfig: order of atoms– leandriis
1 hour ago
Thank you so much for your alternative solution @leandriis
– Biki Teron
1 hour ago