[Tex/LaTex] Drawing atomic orbitals upon a chemfig structure

chemfig

Is there a way to draw an atomic orbital in a chemfig structure? I think you can better understand if you see want I want to get:resonance between different diradical structure: it's worth to note that one radicalic center is sigma, the other pi

Here is what I've already done. Any improvement would be appreciated.

\documentclass[a4paper,12pt,twoside,openright,titlepage]{book}
\usepackage{chemfig,chemmacros,chemnum,modiagram}
    \usepackage[version=3]{mhchem}
        \makeatletter
        \def\CF@node@content{%
            \expandafter\expandafter\expandafter
                \printatom\expandafter\expandafter\expandafter
                {\csname atom@\number\CF@cnt@atomnumber\endcsname}%
                \ensuremath{\CF@node@strut}%
            }
        \makeatother
        \chemsetup[chemformula]{format=\sffamily}
        %\renewcommand*\printatom[1]{\ensuremath{\mathsf{#1}}}
        \renewcommand*{\printatom}[1]{{\sffamily\cf{#1}}}
        \setdoublesep{0.32500 em}  % 'Bond Spacing'
        \setatomsep{1.78500 em}    % 'Fixed Length'
        \setbondoffset{0.18265 em} % 'Margin Width'
        \newcommand{\bondwidth}{0.06642 em} % 'Line Width'
        \setbondstyle{line width = \bondwidth}

\begin{document}
\schemestart
\setbondoffset{0pt}
 \chemsetup[orbital]{
   overlay ,
   opacity = 0.5 ,
   p/scale = 1.25 ,
   s/color = gray!50 ,
   s/scale = 1.25
 }
 \chemfig{*6(-=(-(-[,.2,,,draw=none]\Lewis{0.,}\orbital{s}))-=(-[,.4,,,draw=none]\Lewis{0.,}{\orbital[half,angle=90]{p}})-=-)}
\arrow
\setbondoffset{0pt}
 \chemsetup[orbital]{
   overlay ,
   opacity = 0.5 ,
   p/scale = 1.25 ,
   s/color = gray!50 ,
   s/scale = 1.25
 }
\chemfig{[:-60]*6(-=-(=)-(-[,.0,,,draw=none]\Lewis{0.,}\orbital{s})-(-[,.4,,,draw=none]\Lewis{0.,}{\orbital[half,angle=90]{p}})=)}
\arrow
\setbondoffset{0pt}
 \chemsetup[orbital]{
   overlay ,
   opacity = 0.5 ,
   p/scale = 1.25 ,
   s/color = gray!50 ,
   s/scale = 1.25
 }
\chemfig{*6(-=(-\orbital{s})-=-=)}
\schemestop

\end{document}

Best Answer

Final result, quite satisfactory:

\documentclass{article}
\usepackage[T1]{fontenc}
    \usepackage[english,italian]{babel}
    \usepackage{graphicx}
    \usepackage{chemfig,chemmacros,modiagram}
    \usepackage[version=3]{mhchem}
        \makeatletter
        \def\CF@node@content{%
            \expandafter\expandafter\expandafter
                \printatom\expandafter\expandafter\expandafter
                {\csname atom@\number\CF@cnt@atomnumber\endcsname}%
                \ensuremath{\CF@node@strut}%
            }
        \makeatother
        \chemsetup[chemformula]{format=\sffamily}
        \renewcommand*{\printatom}[1]{{\sffamily\cf{#1}}}
        \setdoublesep{0.32500 em} 
        \setatomsep{1.78500 em}    
        \setbondoffset{0.18265 em} 
        \newcommand{\bondwidth}{0.06642 em} 
        \setbondstyle{line width = \bondwidth}

\begin{document}
\begin{figure}\centerline{
\schemestart
\chemsetup[orbital]{
  overlay,
  opacity=.4,
  p/scale=1.5,
  p/half,
  s/scale=1.3
}
\chemname{\chemfig[][scale=0.75]{*6(-=(-(-[,.2,,,draw=none]\Lewis{0.,}\orbital{s}))-=(-[-2,0.001,,,draw=none]{{\orbital{p}}})(-[2,.4,,,draw=none]\lewis{2.,})-=)}}{{\footnotesize A'': \textsigma\ap{1},\textpi\ap{1}}}
\arrow{<->}
\chemsetup[orbital]{
  overlay,
  opacity=.4,
  p/scale=1.5,
  p/half,
  s/scale=1.3
}
\chemname{\chemfig[][scale=0.75]{[:-60]*6(-=-(=)-(-[-2,0.001,,,draw=none]{{\orbital{s}}})(-[0,.1,,,draw=none]\lewis{2.,})-(-[-2,0.001,,,draw=none]{{\orbital{p}}})(-[2,.4,,,draw=none]\lewis{2.,})=)}}{{\footnotesize A'': \textsigma\ap{1},\textpi\ap{1}}}
\arrow{<->}
\chemsetup[orbital]{
  overlay,
  opacity=.4,
  p/scale=1.5,
  p/half,
  s/scale=1.3
}
\chemname{\chemfig[][scale=0.75]{*6(-=(-\orbital{s})-=(-[-2,0.001,,,draw=none]{{\orbital{p}}})(-[2,.6,,,draw=none]\lewis{2.,})(-[2,.4,,,draw=none]\lewis{2.,})-=)}}{{\footnotesize A': \textsigma\ap{2},\textpi\ap{0}}}
\schemestop
}
\end{figure}\end{document}

enter image description here

Related Question