Chemfig MakeBraces error











up vote
1
down vote

favorite












I want to make polymer structures with chemfig like this:



documentclass{article}
usepackage{chemfig}
begin{document}
newcommandsetpolymerdelim[2]{defdelimleft{#1}defdelimright{#2}}
defmakebraces[#1,#2]#3#4#5{%
edefdelimhalfdim{thedimexpr(#1+#2)/2}%
edefdelimvshift{thedimexpr(#1#
2)/2}%
chemmove{%
node[at=(#4),yshift=(delimvshift)]
{$leftdelimleftvrule heightdelimhalfdim depthdelimhalfdim
width0ptright.$};%
node[at=(#5),yshift=(delimvshift)]
{$left.vrule heightdelimhalfdim depthdelimhalfdim
width0ptrightdelimright_{rlap{$scriptstyle#3$}}$};}}
setpolymerdelim()
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}\
end{document}


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 edefdelimvshift{thedimexpr(#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?










share|improve this question




























    up vote
    1
    down vote

    favorite












    I want to make polymer structures with chemfig like this:



    documentclass{article}
    usepackage{chemfig}
    begin{document}
    newcommandsetpolymerdelim[2]{defdelimleft{#1}defdelimright{#2}}
    defmakebraces[#1,#2]#3#4#5{%
    edefdelimhalfdim{thedimexpr(#1+#2)/2}%
    edefdelimvshift{thedimexpr(#1#
    2)/2}%
    chemmove{%
    node[at=(#4),yshift=(delimvshift)]
    {$leftdelimleftvrule heightdelimhalfdim depthdelimhalfdim
    width0ptright.$};%
    node[at=(#5),yshift=(delimvshift)]
    {$left.vrule heightdelimhalfdim depthdelimhalfdim
    width0ptrightdelimright_{rlap{$scriptstyle#3$}}$};}}
    setpolymerdelim()
    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}\
    end{document}


    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 edefdelimvshift{thedimexpr(#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?










    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I want to make polymer structures with chemfig like this:



      documentclass{article}
      usepackage{chemfig}
      begin{document}
      newcommandsetpolymerdelim[2]{defdelimleft{#1}defdelimright{#2}}
      defmakebraces[#1,#2]#3#4#5{%
      edefdelimhalfdim{thedimexpr(#1+#2)/2}%
      edefdelimvshift{thedimexpr(#1#
      2)/2}%
      chemmove{%
      node[at=(#4),yshift=(delimvshift)]
      {$leftdelimleftvrule heightdelimhalfdim depthdelimhalfdim
      width0ptright.$};%
      node[at=(#5),yshift=(delimvshift)]
      {$left.vrule heightdelimhalfdim depthdelimhalfdim
      width0ptrightdelimright_{rlap{$scriptstyle#3$}}$};}}
      setpolymerdelim()
      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}\
      end{document}


      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 edefdelimvshift{thedimexpr(#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?










      share|improve this question















      I want to make polymer structures with chemfig like this:



      documentclass{article}
      usepackage{chemfig}
      begin{document}
      newcommandsetpolymerdelim[2]{defdelimleft{#1}defdelimright{#2}}
      defmakebraces[#1,#2]#3#4#5{%
      edefdelimhalfdim{thedimexpr(#1+#2)/2}%
      edefdelimvshift{thedimexpr(#1#
      2)/2}%
      chemmove{%
      node[at=(#4),yshift=(delimvshift)]
      {$leftdelimleftvrule heightdelimhalfdim depthdelimhalfdim
      width0ptright.$};%
      node[at=(#5),yshift=(delimvshift)]
      {$left.vrule heightdelimhalfdim depthdelimhalfdim
      width0ptrightdelimright_{rlap{$scriptstyle#3$}}$};}}
      setpolymerdelim()
      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}\
      end{document}


      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 edefdelimvshift{thedimexpr(#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?







      chemfig






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 4 at 8:46









      Raaja

      2,0262527




      2,0262527










      asked Dec 4 at 8:45









      Maj-Britt ter Hell

      475




      475






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













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



          polymerdelim[<keys>=<values>]{<node1>}{<node2>}


          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.



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



          documentclass{article}
          usepackage{chemfig}

          begin{document}
          chemfig[scale=0.5]{
          -[@{op, 0.5}]O-[:60](=[:120]O)-*6(-=-(-(=[:60]O)-[:-60]O--[:60]-[@{cl, 0.5}])=-=)
          }
          polymerdelim[height = 28pt, depth = 4pt, indice = !!n]{op}{cl}
          end{document}


          enter image description here






          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "85"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463105%2fchemfig-makebraces-error%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote













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



            polymerdelim[<keys>=<values>]{<node1>}{<node2>}


            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.



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



            documentclass{article}
            usepackage{chemfig}

            begin{document}
            chemfig[scale=0.5]{
            -[@{op, 0.5}]O-[:60](=[:120]O)-*6(-=-(-(=[:60]O)-[:-60]O--[:60]-[@{cl, 0.5}])=-=)
            }
            polymerdelim[height = 28pt, depth = 4pt, indice = !!n]{op}{cl}
            end{document}


            enter image description here






            share|improve this answer

























              up vote
              1
              down vote













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



              polymerdelim[<keys>=<values>]{<node1>}{<node2>}


              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.



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



              documentclass{article}
              usepackage{chemfig}

              begin{document}
              chemfig[scale=0.5]{
              -[@{op, 0.5}]O-[:60](=[:120]O)-*6(-=-(-(=[:60]O)-[:-60]O--[:60]-[@{cl, 0.5}])=-=)
              }
              polymerdelim[height = 28pt, depth = 4pt, indice = !!n]{op}{cl}
              end{document}


              enter image description here






              share|improve this answer























                up vote
                1
                down vote










                up vote
                1
                down vote









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



                polymerdelim[<keys>=<values>]{<node1>}{<node2>}


                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.



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



                documentclass{article}
                usepackage{chemfig}

                begin{document}
                chemfig[scale=0.5]{
                -[@{op, 0.5}]O-[:60](=[:120]O)-*6(-=-(-(=[:60]O)-[:-60]O--[:60]-[@{cl, 0.5}])=-=)
                }
                polymerdelim[height = 28pt, depth = 4pt, indice = !!n]{op}{cl}
                end{document}


                enter image description here






                share|improve this answer












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



                polymerdelim[<keys>=<values>]{<node1>}{<node2>}


                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.



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



                documentclass{article}
                usepackage{chemfig}

                begin{document}
                chemfig[scale=0.5]{
                -[@{op, 0.5}]O-[:60](=[:120]O)-*6(-=-(-(=[:60]O)-[:-60]O--[:60]-[@{cl, 0.5}])=-=)
                }
                polymerdelim[height = 28pt, depth = 4pt, indice = !!n]{op}{cl}
                end{document}


                enter image description here







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 4 at 10:56









                andselisk

                6662621




                6662621






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f463105%2fchemfig-makebraces-error%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                    ComboBox Display Member on multiple fields

                    Is it possible to collect Nectar points via Trainline?