2

I'd like to use for copolymers. I have followed the demo for creating for polymers, but I've been having trouble figuring out how to get the two middle to line up without increasing the bond length between the O and the C. These 3 attempts show what I've been trying. Each is close, but just not quite right. I would like the O-C spacing of the middle one with the alignment and bracket spacing of the top one and would greatly appreciate suggestions, Thanks!

\documentclass[12pt,twoside,openright]{report}
\usepackage{chemfig}

%For polymer braces - copied from documentation
\newcommand\setpolymerdelim[2]{\def\delimleft{#1}\def\delimright{#2}}\def\makebraces[#1,#2]#3#4#5{%
\edef\delimhalfdim{\the\dimexpr(#1+#2)/2}%
\edef\delimvshift{\the\dimexpr(#1-#2)/2}%
\chemmove{% 
    \node[at=(#4),yshift=(\delimvshift)]
    {$\left\delimleft\vrule height\delimhalfdim depth\delimhalfdim width0pt\right.$};%
    \node[at=(#5),yshift=(\delimvshift)]
    {$\left.\vrule height\delimhalfdim depth\delimhalfdim width0pt\right\delimright_{\rlap{$\scriptstyle#3$}}$};}} \setpolymerdelim()

\begin{document}
\chemfig{[:30]-[@{left,.5}]C(=[:90]O)-[:-30]C(-[:90]H)(-[:-90]H)-[:30]C(-[:90]CH_3)-[:-30]O-[@{right,0.5}][@{left2,.5}]-C(=[:90]O)-[:-30]C(-[:90]H)(-[:-90]H)-[:30]C(-[:90]CH_2-CH_3)-[:-30]O-[@{right2,0.5}:30]}
\makebraces[25pt,25pt]{\!\!\!m}{left}{right}
\makebraces[25pt,25pt]{\!\!\!n}{left2}{right2}

\chemfig{[:30]-[@{left,.5}]C(=[:90]O)-[:-30]C(-[:90]H)(-[:-90]H)-[:30]C(-[:90]CH_3)-[:-30]O[@{right,0.4}]-[@{left2,.6}]C(=[:90]O)-[:-30]C(-[:90]H)(-[:-90]H)-[:30]C(-[:90]CH_2-CH3)-[:-30]O-[@{right2,0.5}:30]}
\makebraces[25pt,25pt]{\!\!\!m}{left}{right}
\makebraces[25pt,25pt]{\!\!\!n}{left2}{right2}

\chemfig{[:30]-[@{left,.5}]C(=[:90]O)-[:-30]C(-[:90]H)(-[:-90]H)-[:30]C(-[:90]CH_3)-[:-30]O-[@{right,0.5}]-[@{left2,.5}]C(=[:90]O)-[:-30]C(-[:90]H)(-[:-90]H)-[:30]C(-[:90]CH_2-CH_3)-[:-30]O-[@{right2,0.5}:30]}
\makebraces[25pt,25pt]{\!\!\!m}{left}{right}
\makebraces[25pt,25pt]{\!\!\!n}{left2}{right2}

\end{document}

1 Answer 1

2

Looks like PHBV! Assuming I'm right, you are missing hydrogens on your third carbons in both HB and HV. Also, the bond angles for the hydrogens on the second carbons aren't right. I took the liberty of adjusting accordingly and cleaning things up a bit.

As for your question, you can modify the \chemmove macro call in the preamble to draw both the right and left parentheses in the same node. Then, another call at the end will manually move the right parenthesis of the second monomer into position.

\documentclass[12pt,twoside,openright]{report}
\usepackage{chemfig}


%For polymer braces - copied from documentation
\newcommand\setpolymerdelim[2]{\def\delimleft{#1}\def\delimright{#2}}\def\makebraces[#1,#2]#3#4#5{%
\edef\delimhalfdim{\the\dimexpr(#1+#2)/2}%
\edef\delimvshift{\the\dimexpr(#1-#2)/2}%
\chemmove{% 
    \node[at=(#4),yshift=(\delimvshift)]
    {$\left\delimleft\vrule height\delimhalfdim depth\delimhalfdim width0pt\right.$};%
    \node[at=(#5),yshift=(\delimvshift)]
    {$\left.\vrule height\delimhalfdim depth\delimhalfdim width0pt\right\delimright_{\rlap{$\scriptstyle#3$}}\left\delimleft\vrule height\delimhalfdim depth\delimhalfdim width0pt\right.$};}}
\setpolymerdelim()

\newcommand{\alignC}{C}

\begin{document}

\chemfig{[:30]-[@{left,.5}]C(=[:90]O)-[:-30]CH_{2}-#(6pt,)[:30,,1]CH(-[:90,1]CH_{3})-#(6pt,)[:-30,,1]O-[@{right,0.5}]C(=[:90]O)-[:-30]CH_{2}-#(6pt,)[:30,,1]CH(-[:90,,1,2]H_{2}C-CH_{3})-#(6pt,)[:-30,,1]O-[@{right2,0.5}:30]}
\makebraces[25pt,25pt]{\!\!\!m}{left}{right}
\chemmove{\node[at=(right2),yshift=(\delimvshift)]{$\left.\vrule height\delimhalfdim depth\delimhalfdim width0pt\right\delimright_{\rlap{$\scriptstyle{\!\!\!n}$}}$};}

\end{document}

PHBV

Edit: Skeletal alternative:

\documentclass[12pt,twoside,openright]{report}
\usepackage{chemfig}


%For polymer braces - copied from documentation
\newcommand\setpolymerdelim[2]{\def\delimleft{#1}\def\delimright{#2}}\def\makebraces[#1,#2]#3#4#5{%
\edef\delimhalfdim{\the\dimexpr(#1+#2)/2}%
\edef\delimvshift{\the\dimexpr(#1-#2)/2}%
\chemmove{% 
    \node[at=(#4),yshift=(\delimvshift)]
    {$\left\delimleft\vrule height\delimhalfdim depth\delimhalfdim width0pt\right.$};%
    \node[at=(#5),yshift=(\delimvshift)]
    {$\left.\vrule height\delimhalfdim depth\delimhalfdim width0pt\right\delimright_{\rlap{$\scriptstyle#3$}}\left\delimleft\vrule height\delimhalfdim depth\delimhalfdim width0pt\right.$};}}
\setpolymerdelim()

\newcommand{\alignC}{C}

\begin{document}
    \chemfig{[:30]-[@{left,0.5}]{}(=[:90]O)-[:-30]{}-[:30]{}(-[:90]CH_{3})-[:-30,,1]O-[@{right,0.5}]{}(=[:90]O)-[:-30]{}-[:30]{}(-[:90]{}-CH_{3})-[:-30]O-[@{right2,0.5}:30]}
\makebraces[25pt,25pt]{\!\!\!m}{left}{right}
\chemmove{\node[at=(right2),yshift=(\delimvshift)]{$\left.\vrule height\delimhalfdim depth\delimhalfdim width0pt\right\delimright_{\rlap{$\scriptstyle{\!\!\!n}$}}$};}
\end{document}

Skeletal

1
  • Yes, indeed it is PHBV, and thank you for that catch and the answer.
    – cr123
    Nov 2, 2015 at 4:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .