I want to recreate this picture found on wikipedia, but with only the group in the parentheses.
Asked
Active
Viewed 409 times
0
cgnieder
- 66,645
Emilgardis
- 103
1 Answers
1
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}
MarcoG
- 1,437
-
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


\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:19chemfigis explained in detail in thechemfigmanual?! – cgnieder Oct 12 '15 at 13:06\makebracesmacro and how to use it in the answer I linked. If you have concrete questions about that I can also answer them. Otherwise I'd just reproduce my answer here (exchangingCwithSiandO…) – cgnieder Oct 12 '15 at 13:35\chemfig{-[:30]Si(-[:90])(-[:-90])-[:-30]O-[:30]}where branches are inserted in between braces? – cgnieder Oct 12 '15 at 14:15