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?
chemfig
add a comment |
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?
chemfig
add a comment |
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?
chemfig
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
chemfig
edited Dec 4 at 8:46
Raaja
2,0262527
2,0262527
asked Dec 4 at 8:45
Maj-Britt ter Hell
475
475
add a comment |
add a comment |
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}
add a comment |
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}
add a comment |
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}
add a comment |
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}
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}
answered Dec 4 at 10:56
andselisk
6662621
6662621
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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