我想使用化学无花果共聚物。我按照演示创建括号对于聚合物,但我一直在努力弄清楚如何获得中间的两个括号对齐而不增加 O 和 C 之间的键长。这 3 次尝试展示了我一直在尝试的东西。每次都很接近,但就是不太正确。我希望中间的 OC 间距与顶部的对齐和括号间距一致,并非常感谢您的建议,谢谢!
\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
看起来像 PHBV!假设我没记错的话,HB 和 HV 中的第三个碳上都缺少氢。此外,第二个碳上氢的键角也不正确。我擅自做了相应调整,并稍微清理了一下。
至于你的问题,你可以修改\chemmove
序言中的宏调用,将左右括号都画在同一个节点中。然后,在末尾的另一个调用将手动将第二个单体的右括号移动到位。
\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}
编辑:骨骼替代方案:
\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}