  Skyrmion lattices (SkL) in centrosymmetric materials typically have a
magnetic period on the nanometer-scale, so that the coupling between magnetic
superstructures and the underlying crystal lattice cannot be neglected. Here,
we reveal the commensurate locking of a SkL to the atomic lattice in
Gd$_3$Ru$_4$Al$_{12}$ via high-resolution resonant elastic x-ray scattering
(REXS). Weak easy-plane magnetic anisotropy, demonstrated here by a combination
of ferromagnetic resonance and REXS, penalizes placing a skyrmion core on a
site of the atomic lattice. Under these conditions, a commensurate SkL, locked
to the crystal lattice, is stable at finite temperatures -- but gives way to a
competing incommensurate ground state upon cooling. We discuss the role of
Umklapp-terms in the Hamiltonian for the formation of this lattice-locked
state, its magnetic space group, the role of slight discommensurations, or
(line) defects in the magnetic texture, and contrast our findings with the case
of SkLs in noncentrosymmetric material platforms.
