I want to make polymer structures with chemfig like this:

{$\left\delimleft\vrule height\delimhalfdim depth\delimhalfdim
{$\left.\vrule height\delimhalfdim depth\delimhalfdim
\chemfig[][scale=0.5]{-[@{op, 0.75}]O-[:30](=[:120]O)-*6(-=-(-(=[:60]O)-[:-30]O--[:30]-[@{cl, 0.25}])=-=)}
\makebraces[8pt, 8pt]{\!\!n}{op}{cl}\\

Overleaf makes the polymer structures and also the brackets, but gives me a lot of error messages:

Illegal parameter number in definition of \makebraces.

l.70 \edef\delimvshift{\the\dimexpr(#1#

You meant to type ## instead of #, right? Or maybe a } was forgotten somewhere earlier, and things are all screwed up? I'm going to assume that you meant ##.

Does anyone know, what I did wrong?


Note that chemfig package has been recently updated, and version 1.33 includes \polymerdelim macro with the following syntax:


For more detailed info on usage refer to section 12.4 Draw a ploymer element on p. 43 of the chemfig manual. I'm not sure whether Overleaf has already updated the package on their side or not, but I'd stick to the new syntax anyway. I also wouldn't use scaling; instead, make the bonds a bit shorter.

So, in your case for the structure of polyethylene terephthalate I suggest the following (I also adjusted angles a bit):

        atom sep = 1.75em,
        double bond sep = 0.3em,
        bond join = true,


    -[@{op, 0.5}]O-[:60](=[:120]O)-*6(-=-(-(=[:60]O)-[:-60]O--[:60]-[@{cl, 0.5}])=-=)
\polymerdelim[height = 32pt, depth = 4pt, indice = \!\!n]{op}{cl}


enter image description here

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.