# Create with chemfig a repeating unit of Si-O

I want to recreate this picture found on wikipedia, but with only the group in the parentheses.

• Welcome to TeX - LaTeX! Please have a look at tex.stackexchange.com/a/96634/5049 – cgnieder Oct 12 '15 at 12:10
• Thank you! Yes, I looked at that one and I'm trying to implement it, but I don't have a clue how the chemfig syntax works. I'm currently doing \chemfig{Si-[:30]O-[:-30]Si} but it doesn't look good and it's missing the empty carbon bonds – Emilgardis Oct 12 '15 at 12:19
• The syntax of chemfig is explained in detail in the chemfig manual?! – cgnieder Oct 12 '15 at 13:06
• Naturally, but I would rather have someone explain it for me. But I'll try and then post my answer. Oh well. – Emilgardis Oct 12 '15 at 13:21
• Which aspects of the syntax should we explain? If there are details of the syntax you don't understand you should ask questions about those details. the someone can add an answer explaining said details. Explaining the whole syntax would otherwise require to more or less repeat the whole manual… – cgnieder Oct 12 '15 at 13:33

You could get this output with this code:

\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}


That produces:

As you can see, I took the code for the brackets from chemfig manual (part III, section 12.5). I adjusted the length of the empty bonds with -[:<angle>,<length multiplier>].

EDIT: If you want to get only one Si-O group like the following:

You only need this code:

\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}

• Thank you! I'll use this in my document. However my question was for the part enclosed by the parentheses. I'll mark this as the answer if you add the same formula for n=1. (Only one Si-O) – Emilgardis Oct 12 '15 at 13:56
• @Emilgardis Do you mean e.g. only the first Si-O group, without brackets? I'll edit my answer in a moment. – MarcoG Oct 12 '15 at 14:06