[Tex/LaTex] Boron molecular orbital diagram

chemistrymodiagram

Boron molecular orbital diagram have the following form:
enter image description here

The nuance is that the level pi lies below the level sigma2.

For building molecular orbital diagram I use modiagram package.

\documentclass[]{standalone}
\usepackage{mhchem, modiagram}
\begin{document}
            \begin{MOdiagram}[style=square, labels,names,AO-width=8pt,labels-fs=\footnotesize]
                \atom[\ce{B_a}]{left}{
                    1s  = {;pair}, 
                    2s  = {;pair}, 
                    2p = {;up}
                }
                \atom[\ce{B_b}]{right}{
                    1s  = {;pair}, 
                    2s  = {;pair}, 
                    2p = {;up}
                }
                \molecule[\ce{B2}]{
                    1sMO = {;pair,pair}, 
                    2sMO = {;pair,pair}, 
                    2pMO = {;,up,up},
                    color = { 1sigma*=red, 2sigma*=red }
                }
                \EnergyAxis
            \end{MOdiagram}
\end{document}

enter image description here

But, as one can see, in the diagram, the sigma-level lies below pi-level.
How can one fix this?

Best Answer

If you carefully read the description [modiagram_en.pdf][1], you can see the description of the \molecule command on page 6:

The argument <MO-spec> accepts a comma separated list of key/value pairs: 1sMO = {<energy gain>/<energy loss>; <s el-spec>, <s* el-spec>} connects the AOs specified by 1s.

<energy gain>/<energy loss> values specify vertical position of MO.

\documentclass{standalone}
\usepackage[version=3]{mhchem}
\usepackage{modiagram}

\begin{document}


    \MOsetup{
        style=square, 
        labels,
        names,
        AO-width=8pt,
        labels-fs=\footnotesize,
        labels-style={blue}
    }

        %============================== B2 ======================


                    \begin{MOdiagram}
                        \atom[\ce{a}]{left}{
                            1s  = {;pair}, 
                            2s  = {;pair}, 
                            2p = {;up}
                        }
                        \atom[\ce{b}]{right}{
                            1s  = {;pair}, 
                            2s  = {;pair}, 
                            2p = {;up}
                        }
                        \molecule[\ce{B2}]{
                            1sMO = {;pair,pair}, 
                            2sMO = {;pair,pair}, 
                            2pMO = {0.9/2,1.7/1;,up,up},
                            color = { 1sigma*=red, 2sigma*=red }
                        }
                        \EnergyAxis
                    \end{MOdiagram}



\end{document}
Related Question