使用 chemfig 创建 Si-O 重复单元

使用 chemfig 创建 Si-O 重复单元

我想重新创建在维基百科,但只有括号中的组。硅橡胶的重复单元

答案1

你可以通过以下代码获得以下输出:

\documentclass[border=3mm]{standalone}

\usepackage{chemfig}

% Set chemical bonds length
\setatomsep{20pt}

% From chemfig manual
\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{#3}}
      $};
  }%
}

\begin{document}

\setpolymerdelim()

\chemfig{-[:-30,0.7]Si(-[:90,0.7])(-[:-90,0.7])-[:30]O-[@{op,.5}:-30]Si(-[:90,0.7])(-[:-90,0.7])-[:30]O-[@{cl,.5}:-30]Si(-[:90,0.7])(-[:-90,0.7])-[:30,0.7]}

\makebraces(10pt,20pt){$\!\!\!n$}{op}{cl}

\end{document}

得出的结果为:

在此处输入图片描述

如你所见,括号中的代码来自chemfig手动的(第三部分,第 12.5 节)。我用 调整了空键的长度-[:<angle>,<length multiplier>]

编辑:如果您只想获得一个 Si-O 组,如下所示:

在此处输入图片描述

您只需要此代码:

\documentclass[border=3mm]{standalone}

\usepackage{chemfig}

% Set chemical bonds length
\setatomsep{20pt}

\begin{document}

\chemfig{-[:-30,0.7]Si(-[:90,0.7])(-[:-90,0.7])-[:30]O-[:-30,0.7]}

\end{document}

相关内容