4

Hy everybody,

I am a newbie in LaTeX so I apologize if the question is not so precisely. I try to draw polymers with the Chemfig package. Everything works fine with except the brackets for the polymer. The polymer is the monomer of an epoxy resin.

Here is my code:

\documentclass[a0paper]{scrartcl}
\usepackage[ansinew]{inputenc}
\usepackage[decimalsymbol=comma,per=frac]{siunitx}
\usepackage{chemfig}
\usepackage{graphicx}
\begin{document}

\chemfig[]{[:30]?-([:150]-O?)-[0]-[1]O-[0]**6(---(-([2]-)([6]-)-**6(---(-[0]O(-[7]-[0](-[6]OH)-[1]-[0]O-**6(---(-[0](-[2])(-[6])-**6(---(-[0]O-[7]-[0]?[b]-[:-30]-[2]O?[b])---))---)))---))---)}
\end{document}

The result should look like this (it is third pic (c)): How should it look like

I already tried to use the \polymerdelim[height = 15pt, indice = \!\!n]{op}{cl} operation, but it does not work in the way I want to (shifting and rotating of the molecule after compiling). Maybe there some formal mistakes in my code, which makes the setting of the brackets with the \polymerdelim difficult.

I hope you can help me with my problem. Thank you. Greetings Martin

1

I think this works:

\documentclass[a0paper]{scrartcl}
\usepackage{chemfig}
\begin{document}



     \chemfig[]{[:30]?-([:150]-O?)-[0]-[1]O-[@{op}]**6(---(-([2]-)([6]-)-**6(---(-[0]O(-[7]-[0](-[6]OH)-[:60]-[@{cl}]O-**6(---(-[0](-[2])(-[6])-**6(---(-[0]O-[7]-[0]?[b]-[:-30]-[2]O?[b])---))---)))---))---)}
        \polymerdelim[delimiters={[]},h align=false,height = 15pt, indice = \!\!n]{op}{cl}
               Ugly angles
    \vspace{5em}


    \chemfig[]{[:30]?-([:150]-O?)-[0]-[1]O-[@{op}:0]**6(---(-([2]-)([6]-)-**6(---(-[0]O(-[7]-[0](-[6]OH)-[:60]-[@{cl}:0]O-**6(---(-[0](-[2])(-[6])-**6(---(-[0]O-[7]-[0]?[b]-[:-30]-[2]O?[b])---))---)))---))---)}
    \polymerdelim[delimiters={[]},height = 15pt, indice = \!\!n]{op}{cl}
    Corrected angles
\end{document}

Note that you can specify the angle of the bond associated with the bracket/delimiter like this: [@{op}:0] (angle info is in bold). The location and proper "syntax" of the angle info is not explicitly stated in the chemfig documentation, but you can see it in one of the examples for brackets/delimiters. If you don't specify the angle of the bonds that are associated with the brackets, you get some "ugly" angles for your polymer. If you specify the angles of those bonds, you can control the "flow" of the polymer backbone. **several edits to clean up my answer.

<code>enter image description here</code>

  • 1
    Thank you very much! :) – Martin Sep 18 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.