Molecular Orbital Diagrams in LaTeX (MO Diagrams)
Date Published

Molecular Orbital Diagrams in LaTeX
Create publication-quality MO diagrams for chemistry papers and presentations.
The modiagram Package
The easiest way to draw MO diagrams:
\usepackage{modiagram}
Basic MO Diagram
\begin{MOdiagram} \atom{left}{1s, 2s} \atom{right}{1s, 2s} \molecule{1sMO, 2sMO} \end{MOdiagram}
Diatomic Molecules
H₂ Molecule
\begin{MOdiagram} \atom[H]{left}{1s=1} \atom[H]{right}{1s=1} \molecule{1sMO} \end{MOdiagram}
O₂ Molecule
\begin{MOdiagram}[names] \atom[O]{left}{2s, 2p} \atom[O]{right}{2s, 2p} \molecule{2sMO, 2pMO} \end{MOdiagram}
Energy Levels
Adding Electrons
Use numbers to indicate electrons:
1s=2 — 2 electrons in 1s 2p={1;up,1;up,0} — 2 unpaired in 2p
Bonding and Antibonding
\molecule{1sBond, 1smark{*}}
Customizing Appearance
Labels
\begin{MOdiagram}[labels] ... \end{MOdiagram}
Colors
\begin{MOdiagram}[style={draw=blue}]
Positioning
\AO{s}{0;up, 0;down} — orbital with electrons
Using TikZ Directly
For more control, use TikZ:
\begin{tikzpicture} % Left atom \draw (-3,0) -- (-2,0); \node[left] at (-3,0) {1s};
% Right atom \draw (2,0) -- (3,0); \node[right] at (3,0) {1s};
% Molecular orbitals \draw (0,1) -- (0.5,1); \node[right] at (0.5,1) {$\sigma^*$};
\draw (0,-1) -- (0.5,-1); \node[right] at (0.5,-1) {$\sigma$};
% Connecting lines \draw[dashed] (-2,0) -- (0,-1); \draw[dashed] (2,0) -- (0,-1); \end{tikzpicture}
Electron Configuration
Show electrons with arrows:
\draw[->] (0,0) -- (0,0.3); — up electron
\draw[->] (0.2,0.3) -- (0.2,0); — down electron
Pi Orbitals
\begin{MOdiagram}[names, labels] \atom{left}{2p={;pair}} \atom{right}{2p={;pair}} \molecule{2pMO={1.5,0;pair,pair,pair,pair}} \end{MOdiagram}
Common Molecules
N₂ (Triple Bond)
Bond order = (8-2)/2 = 3
Electron configuration: σ²σ*²π⁴σ²
O₂ (Double Bond with Paramagnetism)
Bond order = (8-4)/2 = 2
Has 2 unpaired electrons in π* orbitals.
F₂ (Single Bond)
Bond order = (8-6)/2 = 1
Energy Level Spacing
Control vertical spacing:
\setMOaliases{AO}{level=0.5}
Annotations
Add labels and notes:
\node at (0,-2) {Bond Order = 2};
Combining with Chemistry Packages
Use with mhchem for formulas:
\usepackage{mhchem}
\ce{O2} renders as O₂
Tips for Good Diagrams
1. Keep energy ordering correct 2. Show all relevant orbitals 3. Label bonding (σ, π) and antibonding (σ, π) 4. Indicate electron spins with arrows 5. Use consistent styling
Draw Chemistry Diagrams with Octree
Octree helps with chemistry:
- Preview diagrams instantly - AI helps with complex syntax - Export publication-ready figures - Beautiful PDF output
Try it at https://useoctree.com