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?

1 Answer 1

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

2
  • 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. Commented May 3, 2020 at 21:46
  • @GRSousaJr No worries!
    – user194703
    Commented May 3, 2020 at 21:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .