How to write text H to left of O in chemfig?

The name of the pictureThe name of the pictureThe name of the pictureClash 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
enter image description here










share|improve this question

















  • 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














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
enter image description here










share|improve this question

















  • 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












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
enter image description here










share|improve this question













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
enter image description here







chemfig






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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












  • 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










1 Answer
1






active

oldest

votes

















up vote
3
down vote



accepted










A simple version using boxes.



chemfig



 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





share|improve this answer




















  • Thank you so much @TeXnician
    – Biki Teron
    1 hour 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%2f453054%2fhow-to-write-text-h-to-left-of-o-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










A simple version using boxes.



chemfig



 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





share|improve this answer




















  • Thank you so much @TeXnician
    – Biki Teron
    1 hour ago














up vote
3
down vote



accepted










A simple version using boxes.



chemfig



 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





share|improve this answer




















  • Thank you so much @TeXnician
    – Biki Teron
    1 hour ago












up vote
3
down vote



accepted







up vote
3
down vote



accepted






A simple version using boxes.



chemfig



 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





share|improve this answer












A simple version using boxes.



chemfig



 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






share|improve this answer












share|improve this answer



share|improve this answer










answered 1 hour ago









TeXnician

22k52882




22k52882











  • 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




Thank you so much @TeXnician
– Biki Teron
1 hour 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%2f453054%2fhow-to-write-text-h-to-left-of-o-in-chemfig%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

List of Gilmore Girls characters

What does second last employer means? [closed]

One-line joke