0

To determine the lewis structure of molecules, I used the method proposed here. But I am blocked for certain molecules such as dioxygen: enter image description here

How can I place double bonds and doublets on each atom?

\documentclass{standalone}
\usepackage{stackengine}
\usepackage{graphicx,ifthen}
\newcommand\lewis[7]{\,%
  \ifthenelse{\equal{#3}{}}%
    {\def\RHS{}\def\RRHS{\hspace{.5ex}}}%
    {\def\RHS{\,\rotatebox{90}{\makebox[1.5ex]{#3}}\,}\def\RRHS{}}%
  \stackengine{2ex}{%
  \rotatebox{90}{\makebox[1.5ex]{#5}}\,%
  \stackengine{0.6ex}{%
  \stackengine{1.9ex}{#1}{#2}{O}{c}{F}{F}{L}%
  }{#4}{U}{c}{F}{F}{L}%
  \RHS$^{#6}$\RRHS%
  }{$#7$}{U}{c}{F}{F}{L}%
}
\savestack\Bond{\rule{1.2ex}{0.75pt}}
\savestack{\PBond}{\rotatebox{90}{\Bond}}
\begin{document}
\sffamily
\stackunder{%
O\lewis{O}{}{\Bond}{}{\PBond}{}{}
}{}
\end{document}

1 Answer 1

3
\documentclass[border=2mm]{standalone}
\usepackage{chemfig}
\begin{document}
    \chemfig{\charge{135:-1pt=\|,225:-1pt=\|}{O}=\charge{45:-1pt=\|,315:-1pt=\|}{O}}
\end{document}

enter image description here

You must log in to answer this question.

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