1

I have trouble on positioning the red arrow using chemfig version 1.52.

my result

The code return an error:

line 8: Package pgf Error: No shape named `db2' is known. ...rols +(+180:5mm) and +(+210:5mm) .. (ep2);}

That's my code.

\documentclass{article}
\usepackage{chemfig}
\begin{document}
    \setchemfig{atom sep=16pt, bond offset=0.75pt}
    \chemfig{-[::30]([@{db2}::60]=@{ep2}\charge{45=\:,135=\:}{O})-[@{sb2}::-60]=_[@{db1}::+60]-[@{sb1}::-60]@{ep1}\charge{-45=\:,-135=\:}{O}-[::60]}
    \chemmove[blue, shorten <=4pt, shorten >=3pt]{\draw(ep1) .. controls +(-135:5mm) and +(-120:5mm) .. (sb1);}
    \chemmove[blue, shorten <=2pt, shorten >=2pt]{\draw(db1) .. controls +(+120:4mm) and +(+60:4mm)  .. (sb2);}
    \chemmove[red,  shorten <=2pt, shorten >=2pt]{\draw(db2) .. controls +(+180:5mm) and +(+210:5mm) .. (ep2);}
\end{document}

This it the expected result:

expected result

What is happen here? Am I missing something?

2

You just put the @{db2} at the wrong place in the code.

\documentclass{article}
\usepackage{chemfig}
\begin{document}
    \setchemfig{atom sep=16pt, bond offset=0.75pt}
    \chemfig{-[::30]([::60]@{db2}=@{ep2}\charge{45=\:,135=\:}{O})-[@{sb2}::-60]=_[@{db1}::+60]-[@{sb1}::-60]@{ep1}\charge{-45=\:,-135=\:}{O}-[::60]}
    \chemmove[blue, shorten <=4pt, shorten >=3pt]{\draw(ep1) .. controls +(-135:5mm) and +(-120:5mm) .. (sb1);}
    \chemmove[blue, shorten <=2pt, shorten >=2pt]{\draw(db1) .. controls +(+120:4mm) and +(+60:4mm)  .. (sb2);}
    \chemmove[red,  shorten <=2pt, shorten >=2pt]{\draw(db2) .. controls +(+180:5mm) and +(+210:5mm) .. (ep2);}
\end{document}

enter image description here

Or, in order to label the double line, use

\documentclass{article}
\usepackage{chemfig}
\begin{document}
    \setchemfig{atom sep=16pt, bond offset=0.75pt}
    \chemfig{-[::30](=[@{db2}::60]@{ep2}\charge{45=\:,135=\:}{O})-[@{sb2}::-60]=_[@{db1}::+60]-[@{sb1}::-60]@{ep1}\charge{-45=\:,-135=\:}{O}-[::60]}
    \chemmove[blue, shorten <=4pt, shorten >=3pt]{\draw(ep1) .. controls +(-135:5mm) and +(-120:5mm) .. (sb1);}
    \chemmove[blue, shorten <=2pt, shorten >=2pt]{\draw(db1) .. controls +(+120:4mm) and +(+60:4mm)  .. (sb2);}
    \chemmove[red,  shorten <=2pt, shorten >=2pt]{\draw(db2) .. controls +(+180:5mm) and +(+210:5mm) .. (ep2);}
\end{document}

enter image description here

| improve this answer | |
  • It's works. Thank you very much. I'm sorry about exclamation mark. I really didn't know that. I didn't have intention of be disrespectful. – GRSousaJr May 3 at 21:46
  • @GRSousaJr No worries! – user194703 May 3 at 21:47

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.