  We develop a length-gauge formalism for treating one-dimensional periodic
lattice systems in the presence of a photon cavity inducing light-matter
interaction. The purpose of the formalism is to remove mathematical ambiguities
that occur when defining the position operator in the context of the
Power-Zienau-Woolley Hamiltonian. We then use a diagrammatic approach to
analyze perturbatively the interaction between an electronic quantum system and
a photonic cavity mode of long wavelength. We illustrate the versatility of the
formalism by studying the cavity-induced electric charge imbalance and
polarization in the Rice-Mele model with broken inversion symmetry.
