4

The next code produces the molecule shown in the picture:

\documentclass{article}
\usepackage{chemfig}
\begin{document}

\chemfig[bond join=true,atom sep=2em]{\charge{[extra sep=4.5pt]0=\.}{}(-[4]*6(=-=-=-))(=^[2]O)}

\end{document}

molecule

As you can see there are two problems related with the shifted double bond. The first problem is that the oxygen atom remains in the same place (upper arrow). The second problem (bottom arrow) is that the joint between single and double bond doesn't look fine, even when I'm using the comand: bond join = true. Any recommendations for this issues?

2

1 Answer 1

2
\documentclass{article}
\usepackage{chemfig}
\begin{document}
\chemfig[bond join=true,atom sep=2em]{
  \charge{[extra sep=4.5pt]0=\.}{}(-[4]*6(=-=-=-))(=^[2,,,,line cap=rect]{O\rule{2pt}{0pt}})
}
\end{document}

enter image description here

2
  • 2
    Very good. Please, can you put the explanations how do you have solved the problem. My it is +1.
    – Sebastiano
    Apr 11, 2021 at 20:34
  • 2
    @Sebastiano thanks. The addition of the \rule{2pt}{0pt} increased the width by 2pt and pushed the O left by 1pt. line cap=rect from tikz filled the gap.
    – polyn
    Apr 11, 2021 at 20:47

You must log in to answer this question.

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