  We present a formalism for the resonant inelastic x-ray scattering (RIXS)
cross section. The resulting compact expression in terms of polarizability
matrix elements, particularly lends itself to the implementation in an
all-electron many-body perturbation theory (MBPT) framework, which is realized
in the full-potential package exciting. With the carbon K edge RIXS of diamond
and the oxygen K edge RIXS of $\beta-\mathrm{Ga_2 O_3}$, respectively, we
demonstrate the importance of electron-hole correlation and atomic coherence in
the RIXS spectra.
